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);
}
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;
}
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;
}
Aggregations