BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(tempFile));
config.save(out);
out.flush();
out.close();
Target[] targets = mgr.getTargets();
ProgressObject po = mgr.distribute(targets, rarFile, tempFile);
waitForProgress(po);
if(po.getDeploymentStatus().isCompleted()) {
TargetModuleID[] ids = po.getResultTargetModuleIDs();
po = mgr.start(ids);
waitForProgress(po);
if(po.getDeploymentStatus().isCompleted()) {
ids = po.getResultTargetModuleIDs();
if(status != null) {
status.getCurrentPool().setName(data.getName());
status.getCurrentPool().setConfigurationName(ids[0].getModuleID());
status.getCurrentPool().setFinished(true);
response.setRenderParameter(MODE_KEY, IMPORT_STATUS_MODE);
}
log.info("Deployment completed successfully!");
}
} else if(po.getDeploymentStatus().isFailed()) {
data.deployError = "Unable to deploy: " + data.name;
response.setRenderParameter(MODE_KEY, EDIT_MODE);
log.info("Deployment Failed!");
}
}