use of com.centurylink.mdw.designer.utils.Server in project mdw-designer by CenturyLinkCloud.
the class DesignerDataAccess method createRemoteAccess.
private RemoteAccess createRemoteAccess(String logicalServerName) throws DataAccessException, RemoteException {
// and hence requires the remote server to be running
for (Server s : serverList) {
if (logicalServerName.equals(s.getApplicationName())) {
String curenv = currentServer.getEnvironment();
String senv = s.getEnvironment();
if (curenv == null)
curenv = "";
if (senv == null)
senv = "";
if (curenv.equals(senv)) {
String remoteDbInfo = s.getDatabaseUrl();
if (remoteDbInfo == null)
remoteDbInfo = getDatabaseCredentialFromServer(s.getServerUrl());
return new RemoteAccess(logicalServerName, remoteDbInfo);
}
}
}
if (currentServer.getServerUrl() != null) {
String remoteServerUrl = this.getStringProperty(PropertyNames.MDW_REMOTE_SERVER + "." + logicalServerName);
if (remoteServerUrl == null)
throw new DataAccessException("Cannot find translation for logical server name " + logicalServerName);
String remoteDbInfo = this.getDatabaseCredentialFromServer(remoteServerUrl);
return new RemoteAccess(logicalServerName, remoteDbInfo);
}
throw new DataAccessException("Cannot find translation for logical server name " + logicalServerName);
}
use of com.centurylink.mdw.designer.utils.Server in project mdw-designer by CenturyLinkCloud.
the class ImageServletHelper method generateImageForProcessInstance.
/**
* Generate a process image from the designer server.
*/
public BufferedImage generateImageForProcessInstance(Long pProcInstId) throws ServletException {
try {
DesignerDataAccess dao = new DesignerDataAccess(new Server(), null, onServer);
ProcessInstanceVO pi = dao.getProcessInstanceBase(pProcInstId, null);
if (pi == null) {
throw new ServletException("Failed to locate the ProcessInstance for ProcessInstanceId:" + pProcInstId);
}
return generateImage(pi, dao);
} catch (Exception ex) {
log(ex);
throw new ServletException(ex);
}
}
use of com.centurylink.mdw.designer.utils.Server in project mdw-designer by CenturyLinkCloud.
the class ImageServletHelper method generateImageForSecondaryOwner.
/**
* Generate a process image from the designer server.
*/
public BufferedImage generateImageForSecondaryOwner(String pSecOwner, Long pSecOwnerId) throws ServletException {
try {
DesignerDataAccess dao = new DesignerDataAccess(new Server(), null, onServer);
ProcessInstanceVO pi = dao.getProcessInstanceForSecondary(pSecOwner, pSecOwnerId);
if (pi == null) {
throw new ServletException("Failed to locate the ProcessInstance for Secondary Owner and OwnerId");
}
return generateImage(pi, dao);
} catch (Exception ex) {
log(ex);
throw new ServletException(ex);
}
}
use of com.centurylink.mdw.designer.utils.Server in project mdw-designer by CenturyLinkCloud.
the class DesignerPage method serverIsRunning.
public boolean serverIsRunning(boolean checkonly) {
boolean live;
Server currentServer = frame.dao.getCurrentServer();
if (currentServer.getServerUrl() != null) {
live = frame.dao.ping();
} else if (!checkonly) {
String serverUrl = frame.getOptionPane().getInput(this, "No server url is known.\nPlease specify an engine URL (iiop)\n" + "or MDW Web URL (http)");
if (serverUrl != null) {
currentServer.setServerUrl(serverUrl);
live = frame.dao.ping();
} else
live = false;
} else
live = false;
if (!live && !checkonly)
showError("This requires server running but it is not");
return live;
}
use of com.centurylink.mdw.designer.utils.Server in project mdw-designer by CenturyLinkCloud.
the class ImageServletHelper method generateImageForTaskInstance.
/**
* Generate a process image from the designer server.
*/
public BufferedImage generateImageForTaskInstance(Long pTaskInstId) throws ServletException {
try {
DesignerDataAccess dao = new DesignerDataAccess(new Server(), null, onServer);
ProcessInstanceVO pi = dao.getCauseForTaskInstance(pTaskInstId);
if (pi == null) {
throw new ServletException("Failed to locate the ProcessInstance for TaskInstanceId:" + pTaskInstId);
}
return generateImage(pi, dao);
} catch (Exception ex) {
log(ex);
throw new ServletException(ex);
}
}
Aggregations