Package com.sun.enterprise.cli.framework

Examples of com.sun.enterprise.cli.framework.CommandValidationException


    protected void verifyPortBasePortIsValid(String portName, int portNum)
        throws CommandValidationException
    {
        if (portNum <= 0 || portNum > PORT_MAX_VAL)
        {
            throw new CommandValidationException(getLocalizedString("InvalidPortBaseRange",
                                         new Object[] {portNum, portName}));
        }
        if (getBooleanOption(CHECKPORTS_OPTION) && !NetUtils.isPortFree(portNum))
        {
            throw new CommandValidationException(getLocalizedString("PortBasePortInUse",
                                         new Object[] {portNum, portName}));
        }
        CLILogger.getInstance().printDebugMessage("Port =" + portNum);
    }
View Full Code Here


      // domain name is validated before the ports
      //

      String domainFilePath = (domainPath + File.separator + domainName);
      if (FileUtils.safeGetCanonicalFile(new File(domainFilePath)).exists()) {
              throw new CommandValidationException(
                  getLocalizedString("DomainExists", new Object[] {domainName}));
      }
   
        final Integer instancePort = getPort(domainProperties,
                                             DomainConfig.K_INSTANCE_PORT,
View Full Code Here

    protected boolean usePortBase() throws CommandValidationException
    {
        if (getOption(PORTBASE_OPTION) != null)
        {
            if (getCLOption(ADMIN_PORT) != null)
                throw new CommandValidationException(getLocalizedString("MutuallyExclusiveOption",
                                                                        new Object[] {ADMIN_PORT, PORTBASE_OPTION}));
            else if (getOption(INSTANCE_PORT) != null)
                throw new CommandValidationException(getLocalizedString("MutuallyExclusiveOption",
                                                                        new Object[] {INSTANCE_PORT, PORTBASE_OPTION}));
            else if (getOption(DOMAIN_PROPERTIES) != null)
                throw new CommandValidationException(getLocalizedString("MutuallyExclusiveOption",
                                                                        new Object[] {DOMAIN_PROPERTIES, PORTBASE_OPTION}));
            else
                return true;
        }
        return false;
View Full Code Here

            {
                propertyString = propertyString.concat(st.nextToken());
            }
            final int index = propertyString.indexOf(Character.toString(EQUAL_SIGN));
            if (index == -1)
                throw new CommandValidationException(getLocalizedString("InvalidPropertySyntax"));
            final String propertyName = propertyString.substring(0, index);
            final String propertyValue = propertyString.substring(index+1);
            propertyList.put(propertyName, propertyValue);
        }
        CLILogger.getInstance().printDebugMessage("domain properties = " + propertyList);
View Full Code Here

        {
            return Integer.parseInt(port);
        }
        catch(Exception e)
        {
            throw new CommandValidationException(
                getLocalizedString("InvalidPortNumber",
                                   new Object[] {port}));
        }
    }
View Full Code Here

        //prompt for the master password.
        mpassword = promptMasterPassword();
        if (isPasswordValid(mpassword))
            return mpassword;
        else
            throw new CommandValidationException(getLocalizedString("PasswordLimit",
                                                                    new Object[]{MASTER_PASSWORD}));
    }
View Full Code Here

                                                  getLocalizedString(
                                                      "MasterPasswordConfirmationWithDefaultPrompt"));
        if (optionValueAgain.length()==0)
            optionValueAgain = DEFAULT_MASTER_PASSWORD;           
        if (!optionValue.equals(optionValueAgain)) {
            throw new CommandValidationException(getLocalizedString("OptionsDoNotMatch",
                new Object[] {MASTER_PASSWORD}));
        }
        return optionValue;
    }
View Full Code Here

     @throws CommandException
     */
    public void runCommand() throws CommandException, CommandValidationException
    {
        if (!validateOptions())
            throw new CommandValidationException("Validation is false");

        try {
            prepareProcessExecutor();
            CLIProcessExecutor cpe = new CLIProcessExecutor();
            cpe.execute(pingDatabaseCmd(false), true);
View Full Code Here

                {
                    validateAdminPassword();
                }
                catch(Exception e)
                {
                    throw new CommandValidationException(getLocalizedString(
                            "BadUsernameOrPassword"));
                }
                try
                {
                    validateMasterPassword();
                }
                catch(Exception e)
                {
                    throw new CommandValidationException(getLocalizedString(
                            "BadMasterPassword"));
                }
                saveExtraPasswordOptions();
                doBackupMessage = true;
                mgr.startDomain(config);
View Full Code Here

    {
        super.validateOptions();

        //verify adminpassword is greater than 8 characters 
        if (!isPasswordValid(newMasterPassword)) {
            throw new CommandValidationException(_strMgr.getString("PasswordLimit",
                new Object[]{ADMIN_PASSWORD}));
        }
               
        return true;
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.cli.framework.CommandValidationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.