Examples of CommandValidationException


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

  throws CommandValidationException
    {
        try {
            return Integer.parseInt(port);
        } catch(Exception e) {
            throw new CommandValidationException(e);
        }
    }
View Full Code Here

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

            adminPort = NetUtils.getFreePort();           
        } else {
            adminPort = convertPortStr(adminPortStr);
        }
        if (!NetUtils.isPortFree(adminPort)) {
            throw new CommandValidationException(_strMgr.getString("AdminPortInUse",
                adminPortStr));
        }
        CLILogger.getInstance().printDebugMessage("agentPort =" + adminPort);
        return adminPort;
    }
View Full Code Here

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

            //System.out.println("adminPassword=" + adminPassword + " masterPassword=" + masterPassword +
            //    " saveMasterPassword=" + saveMasterPassword);           
           
            if (adminHost == null || adminPort == null || adminUser == null || adminPassword == null) {
                throw new CommandValidationException(_strMgr.getString("InvalidDASConfiguration"));
            }
       
            // defaulted protocol and clientHostName until moved to cli if deemed appropriate ???
            // temporary fix to remove agent user & password, for now map them to das user & password???
            AgentConfig agentConfig = new AgentConfig(agentName, getAgentPath(), adminUser,
View Full Code Here

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

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

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

                zip = (String)operands.firstElement();
            }

            if (rootDir==null || target==null || zip==null) {

                throw new CommandValidationException(_strMgr.getString(
                    "InvalaidApplyRepositoryCommandConfiguration"));
            }

            // target name will be part of root dir
            if (rootDir.indexOf(target) > 0) {

                Unzipper z = new Unzipper(rootDir);
                z.writeZipFile(zip);

                // successful msg
                CLILogger.getInstance().printDetailMessage(
                    _strMgr.getString("ApplyRepositoryZipCommandSuccessful",
                    new Object[] {name, zip}));
            } else {
                throw new CommandValidationException(_strMgr.getString(
                    "InvalaidRootDir", new Object[] {rootDir, target}));
            }

        } catch (Exception e) {                       
            e.printStackTrace();
View Full Code Here

Examples of org.glassfish.api.admin.CommandValidationException

    private void validateNodeInstallDirLocal(String nodeInstallDir, String installDir) throws CommandValidationException {
        String canonicalNodeInstallDir = FileUtils.safeGetCanonicalPath(new File(nodeInstallDir));
        String canonicalInstallDir = FileUtils.safeGetCanonicalPath(new File(installDir));
        if (canonicalNodeInstallDir == null || canonicalInstallDir == null) {
            throw new CommandValidationException(
                Strings.get("Instance.installdir.null", node,
                           canonicalInstallDir, canonicalNodeInstallDir));
        }

        if ( !canonicalInstallDir.equals(canonicalNodeInstallDir) ) {
            throw new CommandValidationException(
                Strings.get("Instance.installdir.mismatch", node,
                           canonicalInstallDir, canonicalNodeInstallDir));
        }
    }
View Full Code Here

Examples of org.glassfish.api.admin.CommandValidationException

        if (backupFilename != null) {
            File f = new File(backupFilename);

            if (!f.exists()) {
                throw new CommandValidationException(
                    strings.get("FileDoesNotExist", backupFilename));
            }

            if (!f.canRead()) {
                throw new CommandValidationException(
                    strings.get("FileCanNotRead", backupFilename));
            }

            if (f.isDirectory()) {
                throw new CommandValidationException(
                    strings.get("FileIsDirectory", backupFilename));
            }
        }

        setBackupDir(backupdir);
View Full Code Here

Examples of org.glassfish.api.admin.CommandValidationException

        File backupdir_f = null;
        if (backupdir != null) {
            backupdir_f = new File(backupdir);
            if (!backupdir_f.isAbsolute()) {
                throw new CommandValidationException(
                    strings.get("InvalidBackupDirPath", backupdir));
            }
        }
        boolean configonlybackup = false;
        if ((configonly != null) && ( Boolean.valueOf(configonly))) {
View Full Code Here

Examples of org.glassfish.api.admin.CommandValidationException

        if (domainDir == null) {
            domainDir = getSystemProperty(
                    SystemPropertyConstants.DOMAINS_ROOT_PROPERTY);
        }
        if (domainDir == null) {
            throw new CommandValidationException(
                    strings.get("InvalidDomainPath", domainDir));
        }

        /*
         * The only required value is the domain_name operand, which might have
         * been prompted for before we get here.
         *
         * If --user wasn't specified as a program option, we treat it as a
         * required option and prompt for it if possible, unless --nopassword
         * was specified in which case we default the user name.
         *
         * The next prompted-for value will be the admin password, if required.
         */
        if (programOpts.getUser() == null && !noPassword) {
            // prompt for it (if interactive)
            Console cons = System.console();
            if (cons != null && programOpts.isInteractive()) {
                cons.printf("%s", strings.get("AdminUserRequiredPrompt",
                        SystemPropertyConstants.DEFAULT_ADMIN_USER));
                String val = cons.readLine();
                if (ok(val)) {
                    programOpts.setUser(val);
                    if (adminPassword == null) {
                        adminPassword = getAdminPassword();
                    }
                }
            }
            else {
                //logger.info(strings.get("AdminUserRequired"));
                throw new CommandValidationException(
                        strings.get("AdminUserRequired"));
            }
        }
        if (programOpts.getUser() != null) {
            try {
                FileRealmHelper.validateUserName(programOpts.getUser());
            }
            catch (IllegalArgumentException ise) {
                throw new CommandValidationException(
                        strings.get("InvalidUserName", programOpts.getUser()));
            }
        }
    }
View Full Code Here

Examples of org.glassfish.api.admin.CommandValidationException

            throws CommandValidationException {
        try {
            return Integer.parseInt(port);
        }
        catch (Exception e) {
            throw new CommandValidationException(
                    strings.get("InvalidPortNumber", port));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.