Package org.glassfish.api.admin

Examples of org.glassfish.api.admin.ParameterMap


        }

        ClusterCommandHelper clusterHelper = new ClusterCommandHelper(domain,
                runner);

        ParameterMap map = null;
        if (kill) {
            map = new ParameterMap();
            map.add("kill", "true");
        }
        try {
            // Run start-instance against each instance in the cluster
            String commandName = "stop-instance";
            clusterHelper.runCommand(commandName, map, clusterName, context,
View Full Code Here


            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(msg);
            return;
        }

        ParameterMap info = new ParameterMap();

        if (uninstall) {
            //store needed info for uninstall
            SshConnector sshC = node.getSshConnector();
            SshAuth sshAuth = sshC.getSshAuth();

            if (sshAuth.getPassword() != null)
                info.add(NodeUtils.PARAM_REMOTEPASSWORD, sshAuth.getPassword());

            if (sshAuth.getKeyPassphrase() != null)
                info.add(NodeUtils.PARAM_SSHKEYPASSPHRASE, sshAuth.getKeyPassphrase());

            if (sshAuth.getKeyfile() != null)
                info.add(NodeUtils.PARAM_SSHKEYFILE, sshAuth.getKeyfile());

            info.add(NodeUtils.PARAM_INSTALLDIR, node.getInstallDir());
            info.add(NodeUtils.PARAM_REMOTEPORT, sshC.getSshPort());
            info.add(NodeUtils.PARAM_REMOTEUSER, sshAuth.getUserName());
            info.add(NodeUtils.PARAM_NODEHOST, node.getNodeHost());
            info.add(NodeUtils.PARAM_WINDOWS_DOMAIN, node.getWindowsDomain());
        }

        CommandInvocation ci = cr.getCommandInvocation("_delete-node", report);
        ParameterMap map = new ParameterMap();
        map.add("DEFAULT", name);
        ci.parameters(map);
        ci.execute();

        //uninstall GlassFish after deleting the node
        if (uninstall) {
View Full Code Here

            //then undeploy the application first.

            // Use ParameterMap till we have a better way
            // to invoke a command on both DAS and instance with the
            // replication framework
            final ParameterMap parameters = new ParameterMap();
            parameters.add("DEFAULT", name);
            parameters.add(DeploymentProperties.TARGET, target);
            parameters.add(DeploymentProperties.KEEP_REPOSITORY_DIRECTORY, keepreposdir.toString());
            parameters.add(DeploymentProperties.IS_REDEPLOY, isredeploy.toString());
            if (dropandcreatetables != null) {
                parameters.add(DeploymentProperties.DROP_TABLES, dropandcreatetables.toString());
            }
            parameters.add(DeploymentProperties.IGNORE_CASCADE, force.toString());
            if (keepstate != null) {
                parameters.add(DeploymentProperties.KEEP_STATE, keepstate.toString());
            }

            ActionReport subReport = report.addSubActionsReport();
            subReport.setExtraProperties(new Properties());
View Full Code Here

    // TODO what about security????
    private Future<InstanceCommandResult> pingInstance() {
        try {
            ActionReport aReport = report.addSubActionsReport();
            InstanceCommandResult aResult = new InstanceCommandResult();
            ParameterMap map = new ParameterMap();
            map.set("type", "terse");
            InstanceCommandExecutor ice =
                    new InstanceCommandExecutor(habitat, "__locations", FailurePolicy.Error, FailurePolicy.Error,
                    svr, host, port, logger, map, aReport, aResult);
            return stateService.submitJob(svr, ice, aResult);
            /*
 
View Full Code Here

        /*
         * Replicate the hidden validateRemoteDirDeployment command on the
         * targets, passing the URI for the directory and the checksum.
         */
        final ParameterMap paramMap = new ParameterMap();
        paramMap.add("checksum", Long.toString(checksum));
        paramMap.add("DEFAULT", path.toURI().getSchemeSpecificPart());

        ActionReport.ExitCode replicateResult = ClusterOperationUtil.replicateCommand(
                "_instanceValidateRemoteDirDeployment",
                FailurePolicy.Error,
                FailurePolicy.Ignore,
View Full Code Here

            if (env.isDas() && !DeploymentUtils.isDASTarget(target)) {
                CommandRunner.CommandInvocation inv = commandRunner.getCommandInvocation("disable", report);

                try {
                    final ParameterMapExtractor extractor = new ParameterMapExtractor(this);
                    final ParameterMap parameters = extractor.extract(Collections.EMPTY_LIST);
                    parameters.set("DEFAULT", appName);
                    parameters.add(DeploymentProperties.IS_UNDEPLOY, Boolean.TRUE.toString());
                    inv.parameters(parameters).execute();

                    if (report.getActionExitCode().equals(
                    ActionReport.ExitCode.FAILURE)) {
                    // if disable application failed
                    // we should just return
                        report.setMessage(localStrings.getLocalString("disable.command.failed","{0} disabled failed", appName));
                    return;
                    }

                    if (DeploymentUtils.isDomainTarget(target)) {
                        List<String> targets = domain.getAllReferencedTargetsForApplication(appName);
                        // replicate command to all referenced targets
                        parameters.remove("isUndeploy");
                        ClusterOperationUtil.replicateCommand("undeploy", FailurePolicy.Error, FailurePolicy.Warn, targets, context, parameters, habitat);
                    }
                } catch (Exception e) {
                    report.failure(logger, e.getMessage());
                    return;
View Full Code Here

            //then undeploy the application first.

            // Use ParameterMap till we have a better way
            // to invoke a command on both DAS and instance with the
            // replication framework
            final ParameterMap parameters = new ParameterMap();
            parameters.add("DEFAULT", name);
            parameters.add(DeploymentProperties.TARGET, target);
            parameters.add(DeploymentProperties.KEEP_REPOSITORY_DIRECTORY, keepreposdir.toString());
            parameters.add(DeploymentProperties.IS_REDEPLOY, isredeploy.toString());
            if (dropandcreatetables != null) {
                parameters.add(DeploymentProperties.DROP_TABLES, dropandcreatetables.toString());
            }
            parameters.add(DeploymentProperties.IGNORE_CASCADE, force.toString());
            if (keepstate != null) {
                parameters.add(DeploymentProperties.KEEP_STATE, keepstate.toString());
            }

            ActionReport subReport = report.addSubActionsReport();
            subReport.setExtraProperties(new Properties());
View Full Code Here

        if (DeploymentUtils.isDASTarget(params.target)) {
            return;
        }

        try {
            final ParameterMap paramMap = deployment.prepareInstanceDeployParamMap(dc);

            List<String> targets = new ArrayList<String>();
            if (!DeploymentUtils.isDomainTarget(params.target)) {
                targets.add(params.target);
            } else {
View Full Code Here

        if (env.isDas() && DeploymentUtils.isDomainTarget(target)) {
            List<String> targets = domain.getAllReferencedTargetsForApplication(name);
            // replicate command to all referenced targets
            try {
                ParameterMapExtractor extractor = new ParameterMapExtractor(this);
                ParameterMap paramMap = extractor.extract(Collections.EMPTY_LIST);
                paramMap.set("DEFAULT", name);

                ClusterOperationUtil.replicateCommand("delete-lifecycle-module", FailurePolicy.Error, FailurePolicy.Warn, targets, context, paramMap, habitat);
            } catch (Exception e) {
                report.failure(logger, e.getMessage());
                return;
View Full Code Here

            }
        }
        if (application != null) {
            ActionReport subReport = report.addSubActionsReport();
            CommandRunner.CommandInvocation inv = commandRunner.getCommandInvocation("_list-resources", subReport);
            final ParameterMap parameters = new ParameterMap();
            parameters.add("appname", application.getName());
            inv.parameters(parameters).execute();

            ActionReport.MessagePart subPart = subReport.getTopMessagePart();
            for (ActionReport.MessagePart cp: subPart.getChildren()) {
                ActionReport.MessagePart resourcesChildPart = part.addChild();
View Full Code Here

TOP

Related Classes of org.glassfish.api.admin.ParameterMap

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.