FileDocCategorySizeDatePackage
MyCLI.javaAPI DocGlassfish v2 API4820Fri May 04 22:23:16 BST 2007com.sun.enterprise.config.backup

MyCLI

public class MyCLI extends Object
author
Byron Nevins

Fields Summary
Constructors Summary
public MyCLI()
Creates a new instance of MyCLI

	
Methods Summary
public static voidmain(java.lang.String[] args)

param
args the command line arguments

		try
		{
			String drive = "C:";
			String tempDirDomains = drive + "/tmp/domains";
			String iasroot = drive + "/ee";
			System.setProperty("com.sun.aas.instanceRoot", iasroot);
			System.setProperty("com.sun.aas.domainsRoot", iasroot + "/domains");
			System.setProperty("com.sun.aas.instanceName", "server");
			System.setProperty("java.library.path", iasroot + "/bin");
			System.setProperty("com.sun.aas.configRoot", iasroot + "/config" );
			System.setProperty("java.endorsed.dirs", iasroot + "/lib/endorsed");
			//System.setProperty("com.sun.appserv.admin.pluggable.features=com.sun.enterprise.ee.admin.pluggable.EEClientPluggableFeatureImpl

			MyCLI cli = new MyCLI();
			Enumeration urls = MyCLI.class.getClassLoader().getResources("CLIDescriptor.xml");

			if ((urls == null) || (!urls.hasMoreElements()))
			{
				System.out.println("No URLS");
			}
			else
				System.out.println(urls);

			while (urls.hasMoreElements())
			{
				URL url = (URL) urls.nextElement();
				System.out.println(url);
			}

			//String cmdline = "restore-domain --domaindir " + tempDirDomains
			//	 + " domain1 ";
			//String cmdline = "restore-domain --domaindir " + tempDirDomains
				//+ " --filename C:/tmp/domains/domain1/backups/1080108915404.zip " + " domain23 ";
			//String cmdline = "backup-domain --domaindir " + tempDirDomains + " domain1";

			//String cmdline = "list-backups domain1";
			String cmdline = "backup-domain domain1 --verbose --description foobarski";
			//String cmdline = "restore-domain domain1";


			System.out.println(cmdline);
			CLIMain.invokeCLI(cmdline, InputsAndOutputs.getInstance());
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}