FileDocCategorySizeDatePackage
DeleteDomainCommand.javaAPI DocGlassfish v2 API3837Fri May 04 22:25:08 BST 2007com.sun.enterprise.cli.commands

DeleteDomainCommand

public class DeleteDomainCommand extends BaseLifeCycleCommand
Deletes a domain of the Application server

Fields Summary
Constructors Summary
public DeleteDomainCommand()
Creates new DeleteDomainCommand

    
Methods Summary
private voiddeleteLoginInfo()
This method will delete the entry in the .asadminpass file if exists

        return;
    
public voidrunCommand()
Executes the command

throws
CommandException

        validateOptions();
	
	String domainName = null;
        try
        {            
	    domainName = (String)operands.firstElement();
            DomainConfig domainConfig = getDomainConfig(domainName);
            DomainsManager manager = getFeatureFactory().getDomainsManager();
            manager.deleteDomain(domainConfig);
            deleteLoginInfo();
        }
        catch (Exception e)
        {
	    CLILogger.getInstance().printDetailMessage(e.getLocalizedMessage());
	    throw new CommandException(getLocalizedString("CouldNotDeleteDomain",
							  new Object[] {domainName}));
        }

	CLILogger.getInstance().printDetailMessage(getLocalizedString("DomainDeleted",
                                             new Object[] {domainName}));
    
public booleanvalidateOptions()
Validates the Options for correctness

return
boolean returns true if validation is succesful else false

        return super.validateOptions();