Package org.rhq.enterprise.communications.command.impl.start

Examples of org.rhq.enterprise.communications.command.impl.start.StartCommand


    public StartCommandResponse execute(StartCommand command) {
        org.rhq.core.util.exec.ProcessExecutor exec = new org.rhq.core.util.exec.ProcessExecutor();
        StartCommandResponse response;

        try {
            StartCommand startCommand = new StartCommand(command);
            ProcessToStart process = new ProcessToStart();

            process.setArguments(command.getArguments());
            process.setBackupOutputFile(command.isBackupOutputFile());
            process.setCaptureOutput(command.isCaptureOutput());
View Full Code Here


        // execute the keytool utility to create our key store
        String keytool_dir = System.getProperty("java.home") + File.separator + "bin";
        String keytool_exe = System.getProperty("os.name").toLowerCase().startsWith("windows") ? "keytool.exe"
            : "keytool";
        StartCommand keytool_cmd = new StartCommand();
        keytool_cmd.setProgramDirectory(keytool_dir);
        keytool_cmd.setProgramExecutable(keytool_exe);
        keytool_cmd.setWaitForExit(Long.valueOf(30000L));
        keytool_cmd.setCaptureOutput(Boolean.FALSE);
        keytool_cmd.setCommandInResponse(true);

        keytool_cmd.setArguments(new String[] { "-genkey", "-alias", key_alias, "-dname", domain_name, "-keystore",
            keystore.getAbsolutePath(), "-storepass", keystore_password, "-keypass", key_password, "-keyalg",
            key_algorithm, "-validity", Integer.toString(validity) });

        StartCommandResponse keytool_results = new ProcessExec().execute(keytool_cmd);

        if (!keytool_results.isSuccessful() || !keystore.exists()) {
            throw new RuntimeException(LOG.getMsgString(CommI18NResourceKeys.KEYSTORE_CREATION_FAILURE,
                keytool_results, Arrays.asList(keytool_cmd.getArguments()).toString()), keytool_results.getException());
        }

        LOG.debug(CommI18NResourceKeys.KEYSTORE_CREATED, keystore.getAbsolutePath());

        return;
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.communications.command.impl.start.StartCommand

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.