Package org.rhq.core.domain.content.transfer

Examples of org.rhq.core.domain.content.transfer.DeployPackageStep


    }

    private void populateResponseSteps() {
        stepResults = new ArrayList<DeployPackageStep>(3);

        DeployPackageStep step1 = new DeployPackageStep("Step1", "First step");
        step1.setStepResult(ContentResponseResult.SUCCESS);

        DeployPackageStep step2 = new DeployPackageStep("Step2", "Second step");
        step2.setStepResult(ContentResponseResult.NOT_PERFORMED);

        DeployPackageStep step3 = new DeployPackageStep("Step3", "Third step");
        step3.setStepResult(ContentResponseResult.FAILURE);
        step3.setStepErrorMessage("Error executing the third step");

        stepResults.add(step1);
        stepResults.add(step2);
        stepResults.add(step3);
    }
View Full Code Here


                    configProps);
                handler.setPropertyDefaults();

                String description = handler.getDescription();

                DeployPackageStep step = new DeployPackageStep(node.getName(), description);
                step.setStepResult(ContentResponseResult.NOT_PERFORMED);
                steps.add(step);
            }
        }

        return steps;
View Full Code Here

        ContentResponseResult overallResult = ContentResponseResult.SUCCESS;

        for (Object uncastedLog : logs) {
            if (uncastedLog instanceof ActionHandlerMessageLog) {
                ActionHandlerMessageLog messageLog = (ActionHandlerMessageLog) uncastedLog;
                DeployPackageStep executedStep = messageLog.getStep();
                steps.add(executedStep);

                // The executed and unexecuted steps are link by their step key and the fact that the equals method
                // uses this key (as such, their descriptions may be different). This is currently simply a counter.
                // That counter is handled in different ways for translate v. logging an actual step. They should
                // still map up, however this log message should output enough of a description for the reader
                // to ensure that the unexecuted step being removed does correspond to the step found in the logs.
                if (log.isDebugEnabled()) {

                    String executedStepKey = executedStep.getStepKey();

                    DeployPackageStep unexecutedStep = null;
                    for (DeployPackageStep s : unexecutedSteps) {
                        if (s.getStepKey().equals(executedStepKey)) {
                            unexecutedStep = s;
                            break;
                        }
                    }

                    if (unexecutedStep != null && log.isDebugEnabled()) {
                        log.debug("Mapped up steps:");
                        log.debug("Executed Step: " + executedStep);
                        log.debug("Unexecuted Step: " + unexecutedStep);
                    }
                }

                boolean unexecutedStepDeleted = unexecutedSteps.remove(executedStep);
                if (!unexecutedStepDeleted) {
                    log.warn("Could not remove the following step from the unexecuted step list: " + executedStep);
                }

                // If any steps fail, mark the entire response as failed
                if (executedStep.getStepResult() == ContentResponseResult.FAILURE) {
                    overallResult = ContentResponseResult.FAILURE;
                }
            }
        }

        // For every step that was supposed to run but didn't (those remaining in the unexecuted step list), tack
        // them on to the end as not executed.
        for (DeployPackageStep unexecutedStep : unexecutedSteps) {
            unexecutedStep.setStepResult(ContentResponseResult.NOT_PERFORMED);
            steps.add(unexecutedStep);
        }

        DeployIndividualPackageResponse response = new DeployIndividualPackageResponse(packageDetailsKey, overallResult);
        response.setDeploymentSteps(steps);
View Full Code Here

        // lkrejci, 2009-05-25 - added additional check for nullity of the throwable's message because the description mustn't be null
        String description = (throwable == null || throwable.getMessage() == null) ? additionalMessage : throwable
            .getMessage();

        DeployPackageStep step = new DeployPackageStep(Integer.toString(stepCounter), description);
        step.setStepResult(result);

        if (throwable != null) {
            String errorMessage = new ExceptionPackage(throwable).getStackTraceString();            
            step.setStepErrorMessage(errorMessage);
        }

        log.setStep(step);

        executionContext.getProcessInstance().getLoggingInstance().addLog(log);
View Full Code Here

        for (Iterator iterator = logs.iterator(); iterator.hasNext();) {
            Object uncastedLog = iterator.next();
            if (uncastedLog instanceof ActionHandlerMessageLog) {
                ActionHandlerMessageLog log = (ActionHandlerMessageLog) uncastedLog;
                DeployPackageStep deployPackageStep = log.getStep();

                assert deployPackageStep != null : "Step was not found in the action message log entry: " + log;
                assert deployPackageStep.getStepResult() == ContentResponseResult.SUCCESS : "Step result was not successful. Found: "
                    + deployPackageStep.getStepResult();
                assert deployPackageStep.getStepErrorMessage() == null : "Non-null error message found for successful step: "
                    + deployPackageStep;
            }
        }
    }
View Full Code Here

        for (Iterator iterator = logs.iterator(); iterator.hasNext();) {
            Object uncastedLog = iterator.next();
            if (uncastedLog instanceof ActionHandlerMessageLog) {
                ActionHandlerMessageLog log = (ActionHandlerMessageLog) uncastedLog;
                DeployPackageStep deployPackageStep = log.getStep();

                assert deployPackageStep != null : "Step was not found in the action message log entry: " + log;
                assert deployPackageStep.getStepResult() == ContentResponseResult.SUCCESS : "Step result was not successful. Found: "
                    + deployPackageStep.getStepResult();
                assert deployPackageStep.getStepErrorMessage() == null : "Non-null error message found for successful step: "
                    + deployPackageStep;
            }
        }
    }
View Full Code Here

        for (Iterator iterator = logs.iterator(); iterator.hasNext();) {
            Object uncastedLog = iterator.next();
            if (uncastedLog instanceof ActionHandlerMessageLog) {
                ActionHandlerMessageLog log = (ActionHandlerMessageLog) uncastedLog;
                DeployPackageStep deployPackageStep = log.getStep();

                assert deployPackageStep != null : "Step was not found in the action message log entry: " + log;
                assert deployPackageStep.getStepResult() == ContentResponseResult.FAILURE : "Step result does not indicate failure. Found: "
                    + deployPackageStep.getStepResult();
                assert deployPackageStep.getStepErrorMessage() != null : "No error message found in failing step";
                assert deployPackageStep.getStepErrorMessage().indexOf("expectedDigest") != -1 : "Error message does not indicate the missing expected digest: "
                    + deployPackageStep.getStepErrorMessage();
            }
        }
    }
View Full Code Here

        for (Iterator iterator = logs.iterator(); iterator.hasNext();) {
            Object uncastedLog = iterator.next();
            if (uncastedLog instanceof ActionHandlerMessageLog) {
                ActionHandlerMessageLog log = (ActionHandlerMessageLog) uncastedLog;
                DeployPackageStep deployPackageStep = log.getStep();

                assert deployPackageStep != null : "Step was not found in the action message log entry: " + log;
                assert deployPackageStep.getStepResult() == ContentResponseResult.FAILURE : "Step result did not indicate failure. Found: "
                    + deployPackageStep.getStepResult();
                assert deployPackageStep.getStepErrorMessage() != null : "No error message found in failing step";
                assert deployPackageStep.getStepErrorMessage().indexOf("does not match expected") != -1 : "Error message does not indicate the incorrect digest";
            }
        }
    }
View Full Code Here

        for (Iterator iterator = logs.iterator(); iterator.hasNext();) {
            Object uncastedLog = iterator.next();
            if (uncastedLog instanceof ActionHandlerMessageLog) {
                ActionHandlerMessageLog log = (ActionHandlerMessageLog) uncastedLog;
                DeployPackageStep deployPackageStep = log.getStep();

                assert deployPackageStep != null : "Step was not found in the action message log entry: " + log;
                assert deployPackageStep.getStepResult() == ContentResponseResult.FAILURE : "Step result did not indicate failure. Found: "
                    + deployPackageStep.getStepResult();
                assert deployPackageStep.getStepErrorMessage() != null : "No error message found in failing step";
                assert deployPackageStep.getStepErrorMessage().indexOf("java.security.NoSuchAlgorithmException") != -1 : "Error message does not indicate the bad algorithm: "
                    + deployPackageStep.getStepErrorMessage();
            }
        }
    }
View Full Code Here

        for (Iterator iterator = logs.iterator(); iterator.hasNext();) {
            Object uncastedLog = iterator.next();
            if (uncastedLog instanceof ActionHandlerMessageLog) {
                ActionHandlerMessageLog log = (ActionHandlerMessageLog) uncastedLog;
                DeployPackageStep deployPackageStep = log.getStep();

                assert deployPackageStep != null : "Step was not found in the action message log entry: " + log;
                assert deployPackageStep.getStepResult() == ContentResponseResult.FAILURE : "Step result did not indicate failure. Found: "
                    + deployPackageStep.getStepResult();
                assert deployPackageStep.getStepErrorMessage() != null : "No error message found in failing step";
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.content.transfer.DeployPackageStep

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.