use of org.netxms.ui.eclipse.agentmanager.views.helpers.DeploymentStatus in project netxms by netxms.
the class PackageDeploymentMonitor method redeployPackages.
private void redeployPackages() {
final Set<Long> objects = new HashSet<Long>();
Collection<DeploymentStatus> array = statusList.values();
for (DeploymentStatus obj : array) {
if (// status failed
obj.getStatus() == 4) {
objects.add(obj.getNodeObject().getObjectId());
}
}
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
ConsoleJob job = new ConsoleJob(Messages.get().PackageManager_DeployAgentPackage, null, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
session.deployPackage(packageId, objects.toArray(new Long[objects.size()]), new PackageDeploymentListener() {
@Override
public void statusUpdate(long nodeId, int status, String message) {
viewStatusUpdate(nodeId, status, message);
}
@Override
public void deploymentStarted() {
}
@Override
public void deploymentComplete() {
runInUIThread(new Runnable() {
@Override
public void run() {
MessageDialogHelper.openInformation(getSite().getShell(), Messages.get().PackageManager_Information, Messages.get().PackageManager_PkgDepCompleted);
}
});
}
});
}
@Override
protected String getErrorMessage() {
return Messages.get().PackageManager_DepStartError;
}
};
job.setUser(false);
job.start();
}
Aggregations