*If the status passed in is already a backend.DeploymentStatus then add it as a new stage to the
*completed status. Otherwise, create a new backend.DeploymentStatus, fill it in as much as
*possible, and add it as the next stage.
*/
DFDeploymentStatus newStageStatus = null;
if (ds instanceof DeploymentStatusImpl) {
DeploymentStatusImpl dsi = (DeploymentStatusImpl) ds;
newStageStatus = dsi.progressObject.getCompletedStatus();
} else {
/*
*Create a new status stage and add it to the completed status.
*/
newStageStatus = new DFDeploymentStatus(completedStatus);
/*
*The new state status depends on the DeploymentStatus outcome.
*/
int stageStatus = -1;
Throwable exc;