FileDocCategorySizeDatePackage
VerifyDomainXmlCommand.javaAPI DocGlassfish v2 API4866Fri May 04 22:25:12 BST 2007com.sun.enterprise.cli.commands

VerifyDomainXmlCommand

public class VerifyDomainXmlCommand extends BaseLifeCycleCommand
This is a command which invokes the configuration validator tool
version
$Revision: 1.1

Fields Summary
private static final String
VERBOSE
private static final String
DOMAINDIR
private static final String
CONFIG
private static final String
DOMAIN_XML
Constructors Summary
Methods Summary
private java.lang.StringgetDomainXMLFile()
This method returns the xml file location for the given domain

return
String returns the domainXMLFile

        String domainDir = getDomainsRoot();
        String domainName = getDomainName();
        String domainXMLFile = domainDir + File.separator + domainName + File.separator + 
                                CONFIG + File.separator + DOMAIN_XML;
        CLILogger.getInstance().printDebugMessage("Domain XML file = " + domainXMLFile);
        return domainXMLFile;
    
public voidrunCommand()
An abstract method that Executes the command

throws
CommandException


                    

       
              
    
            validateOptions();
    	    boolean verbose = getBooleanOption(VERBOSE);
            String domainXMLFile = getDomainXMLFile();
            File f = new File(domainXMLFile);
            if(!f.exists())
	        throw new CommandException(getLocalizedString("DomainXMLDoesNotExist",
                                                               new Object[]{getDomainName()}));
            else {
                try {
                    DomainXmlVerifier validator = new DomainXmlVerifier(domainXMLFile);
                    validator.setDebug(verbose);                
                    validator.invokeConfigValidator();
                    CLILogger.getInstance().printDetailMessage(getLocalizedString(
                                                               "CommandSuccessful",
                                                               new Object[] {name}));
                } catch(Exception e){
                    throw new CommandException(e.getMessage());
                }
            }
    
public booleanvalidateOptions()
An abstract method that validates the options on the specification in the xml properties file This method verifies for the correctness of number of operands and if all the required options are supplied by the client.

return
boolean returns true if success else returns false

	return super.validateOptions();