Search in sources :

Example 1 with Status

use of org.glassfish.deployment.client.DFDeploymentStatus.Status in project Payara by payara.

the class ProgressObjectSink method reviseStatusAndMessage.

private void reviseStatusAndMessage(DeploymentStatus ds, DFDeploymentStatus newStageStatus) {
    String msgKey = null;
    Status stageStatus;
    if (ds.isCompleted()) {
        /*
             *The deployment status for this source was successful. 
             */
        msgKey = "enterprise.deployment.client.action_completed";
        stageStatus = Status.SUCCESS;
    } else {
        /*
             *The deployment status for this source failed.
             */
        msgKey = "enterprise.deployment.client.action_failed";
        stageStatus = Status.FAILURE;
    }
    String i18msg = localStrings.getLocalString(msgKey, ds.getMessage());
    newStageStatus.setStageStatus(stageStatus);
    newStageStatus.setStageStatusMessage(i18msg);
}
Also used : DFDeploymentStatus(org.glassfish.deployment.client.DFDeploymentStatus) DeploymentStatus(javax.enterprise.deploy.spi.status.DeploymentStatus) Status(org.glassfish.deployment.client.DFDeploymentStatus.Status)

Example 2 with Status

use of org.glassfish.deployment.client.DFDeploymentStatus.Status in project Payara by payara.

the class ProgressObjectSink method prepareCompletedStatus.

private void prepareCompletedStatus() {
    /*
         *The substages may have status values of success when in fact a warning is present
         *in a substage.  Traverse all the substages, composing the true aggregate state and
         *message based on the most severe state that is present in the entire stage tree.
         */
    Status worstStatus = Status.NOTINITIALIZED;
    StringBuffer msgs = new StringBuffer();
    Status newWorstStatus = aggregateStages(worstStatus, msgs, completedStatus);
    completedStatus.setStageStatus(newWorstStatus);
    completedStatus.setStageStatusMessage(msgs.toString());
    completedStatusReady = true;
}
Also used : DFDeploymentStatus(org.glassfish.deployment.client.DFDeploymentStatus) DeploymentStatus(javax.enterprise.deploy.spi.status.DeploymentStatus) Status(org.glassfish.deployment.client.DFDeploymentStatus.Status)

Example 3 with Status

use of org.glassfish.deployment.client.DFDeploymentStatus.Status in project Payara by payara.

the class ProgressObjectSink method aggregateStages.

private Status aggregateStages(Status worstStatusSoFar, StringBuffer msgs, DFDeploymentStatus stage) {
    /*
         *Starting with the stage passed in, see if its severity is more urgent than that seen so far.
         *If so, then discard the messages accumulated so far for the less urgent severity and save
         *this stage's message and severity as the worst seen so far.
         */
    Status stageStatus = stage.getStageStatus();
    if (stageStatus.isWorseThan(worstStatusSoFar)) {
        worstStatusSoFar = stageStatus;
        msgs.delete(0, msgs.length());
    }
    /*
         *If the stage's severity is the same as the currently worst seen, then add this stage's message
         *to the aggregate message.
         */
    if (stageStatus == worstStatusSoFar) {
        msgs.append(stage.getStageStatusMessage()).append(LINE_SEPARATOR);
    }
    /*
         *Now, do the same for each substage.
         */
    for (Iterator it = stage.getSubStages(); it.hasNext(); ) {
        DFDeploymentStatus substage = (DFDeploymentStatus) it.next();
        worstStatusSoFar = aggregateStages(worstStatusSoFar, msgs, substage);
    }
    return worstStatusSoFar;
}
Also used : DFDeploymentStatus(org.glassfish.deployment.client.DFDeploymentStatus) DeploymentStatus(javax.enterprise.deploy.spi.status.DeploymentStatus) Status(org.glassfish.deployment.client.DFDeploymentStatus.Status) DFDeploymentStatus(org.glassfish.deployment.client.DFDeploymentStatus) Iterator(java.util.Iterator)

Aggregations

DeploymentStatus (javax.enterprise.deploy.spi.status.DeploymentStatus)3 DFDeploymentStatus (org.glassfish.deployment.client.DFDeploymentStatus)3 Status (org.glassfish.deployment.client.DFDeploymentStatus.Status)3 Iterator (java.util.Iterator)1