use of org.talend.mdm.repository.core.service.DeployService.DeployStatus in project tmdm-studio-se by Talend.
the class DeployStatusDialog method getType.
private ERepositoryObjectType getType(IStatus status) {
IStatus queryStatus = status;
if (status.isMultiStatus()) {
IStatus[] childrenStatus = status.getChildren();
if (childrenStatus != null && childrenStatus.length > 0) {
queryStatus = childrenStatus[0];
}
}
if (queryStatus != null && queryStatus instanceof DeployStatus) {
ICommand command = ((DeployStatus) queryStatus).getCommand();
IRepositoryViewObject viewObject = null;
if (command != null) {
if (command instanceof BatchDeployJobCommand) {
return ERepositoryObjectType.PROCESS;
} else {
viewObject = command.getViewObject();
}
}
if (viewObject == null) {
return null;
}
return viewObject.getRepositoryObjectType();
}
return null;
}
use of org.talend.mdm.repository.core.service.DeployService.DeployStatus in project tmdm-studio-se by Talend.
the class UpdateLastServerService method updateLastServerDefInfo.
public void updateLastServerDefInfo(Object serverDef, IRepositoryViewObject ViewObject) {
if (serverDef == null || ViewObject == null || !(serverDef instanceof MDMServerDef)) {
return;
}
CommandManager cmdManager = CommandManager.getInstance();
DeployService deployService = DeployService.getInstance();
ICommand deployCmd = cmdManager.getNewCommand(ICommand.CMD_MODIFY);
deployCmd.init(ViewObject);
// $NON-NLS-1$ //$NON-NLS-2$
MultiStatus mStatus = new MultiStatus("PLUGIN_ID", Status.OK, "", null);
// $NON-NLS-1$
DeployStatus deployStatus = DeployStatus.getOKStatus(deployCmd, "");
mStatus.add(deployStatus);
cmdManager.removeCommandStack(deployCmd, ICommand.PHASE_DEPLOY);
deployService.pushRestoreCommand(cmdManager, deployCmd, (MDMServerDef) serverDef);
deployService.updateLastServer(mStatus, new NullProgressMonitor());
}
use of org.talend.mdm.repository.core.service.DeployService.DeployStatus in project tmdm-studio-se by Talend.
the class AbstractDeployCommand method buildErrorStatus.
private IStatus buildErrorStatus(String bindMsg, String typeLabel, String objectName, Exception e) {
String msg = e.getMessage();
String[] exceptionMsgs = UserExceptionStackFilter.filterExceptionMsg(msg);
IStatus status = null;
if (exceptionMsgs.length == 0) {
String errorMsg = msg != null && !msg.trim().isEmpty() ? msg : Messages.bind(Messages.Deploy_fail_text, typeLabel, objectName);
status = DeployStatus.getErrorStatus(this, errorMsg, null);
} else if (exceptionMsgs.length == 1) {
status = DeployStatus.getErrorStatus(this, Messages.bind(bindMsg, typeLabel, objectName, exceptionMsgs[0]), e);
} else {
status = new MultiStatus(RepositoryPlugin.PLUGIN_ID, Status.ERROR, exceptionMsgs[0], null);
for (int i = 1; i < exceptionMsgs.length; i++) {
DeployStatus errorStatus = DeployStatus.getErrorStatus(this, exceptionMsgs[i]);
((MultiStatus) status).add(errorStatus);
}
}
return status;
}
Aggregations