Search in sources :

Example 1 with Server

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);
}
Also used : Server(com.centurylink.mdw.designer.utils.Server) RestfulServer(com.centurylink.mdw.designer.utils.RestfulServer) RemoteAccess(com.centurylink.mdw.dataaccess.RemoteAccess) DataAccessException(com.centurylink.mdw.common.exception.DataAccessException)

Example 2 with Server

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);
    }
}
Also used : ServletException(javax.servlet.ServletException) Server(com.centurylink.mdw.designer.utils.Server) DesignerDataAccess(com.centurylink.mdw.designer.DesignerDataAccess) ProcessInstanceVO(com.centurylink.mdw.model.value.process.ProcessInstanceVO) ServletException(javax.servlet.ServletException)

Example 3 with Server

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);
    }
}
Also used : ServletException(javax.servlet.ServletException) Server(com.centurylink.mdw.designer.utils.Server) DesignerDataAccess(com.centurylink.mdw.designer.DesignerDataAccess) ProcessInstanceVO(com.centurylink.mdw.model.value.process.ProcessInstanceVO) ServletException(javax.servlet.ServletException)

Example 4 with Server

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;
}
Also used : Server(com.centurylink.mdw.designer.utils.Server)

Example 5 with Server

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);
    }
}
Also used : ServletException(javax.servlet.ServletException) Server(com.centurylink.mdw.designer.utils.Server) DesignerDataAccess(com.centurylink.mdw.designer.DesignerDataAccess) ProcessInstanceVO(com.centurylink.mdw.model.value.process.ProcessInstanceVO) ServletException(javax.servlet.ServletException)

Aggregations

Server (com.centurylink.mdw.designer.utils.Server)9 DesignerDataAccess (com.centurylink.mdw.designer.DesignerDataAccess)5 RestfulServer (com.centurylink.mdw.designer.utils.RestfulServer)4 IOException (java.io.IOException)4 DataAccessException (com.centurylink.mdw.common.exception.DataAccessException)3 ProcessInstanceVO (com.centurylink.mdw.model.value.process.ProcessInstanceVO)3 ServletException (javax.servlet.ServletException)3 JSONException (org.json.JSONException)3 ProcessVO (com.centurylink.mdw.model.value.process.ProcessVO)2 VariableVO (com.centurylink.mdw.model.value.variable.VariableVO)2 File (java.io.File)2 ParseException (java.text.ParseException)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 XmlException (org.apache.xmlbeans.XmlException)2 MdwSecurityException (com.centurylink.mdw.auth.MdwSecurityException)1 RemoteAccess (com.centurylink.mdw.dataaccess.RemoteAccess)1 AssetFile (com.centurylink.mdw.dataaccess.file.AssetFile)1 AppSummary (com.centurylink.mdw.designer.model.AppSummary)1 ValidationException (com.centurylink.mdw.designer.utils.ValidationException)1