Search in sources :

Example 1 with ServerSettings

use of com.centurylink.mdw.plugin.project.model.ServerSettings in project mdw-designer by CenturyLinkCloud.

the class WorkflowElementActionHandler method stop.

public void stop(Object element) {
    if (element instanceof WorkflowProject || element instanceof ServerSettings) {
        ServerSettings serverSettings;
        if (element instanceof WorkflowProject) {
            WorkflowProject workflowProject = (WorkflowProject) element;
            serverSettings = workflowProject.getServerSettings();
        } else {
            serverSettings = (ServerSettings) element;
        }
        ServerRunner runner = new ServerRunner(serverSettings, getShell().getDisplay());
        runner.stop();
    }
}
Also used : ServerRunner(com.centurylink.mdw.plugin.server.ServerRunner) ServerSettings(com.centurylink.mdw.plugin.project.model.ServerSettings) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject)

Example 2 with ServerSettings

use of com.centurylink.mdw.plugin.project.model.ServerSettings in project mdw-designer by CenturyLinkCloud.

the class WorkflowElementActionHandler method deploy.

public void deploy(Object element) {
    if (element instanceof WorkflowProject || element instanceof ServerSettings) {
        ServerSettings serverSettings;
        if (element instanceof WorkflowProject) {
            WorkflowProject workflowProject = (WorkflowProject) element;
            serverSettings = workflowProject.getServerSettings();
            MdwPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.PREFS_SERVER_WF_PROJECT, workflowProject.getName());
        } else {
            serverSettings = (ServerSettings) element;
            MdwPlugin.getDefault().getPreferenceStore().setValue(PreferenceConstants.PREFS_RUNNING_SERVER, serverSettings.getServerName());
        }
        ServerConfigurator configurator = ServerConfigurator.Factory.create(serverSettings);
        configurator.doDeploy(getShell());
    }
}
Also used : ServerSettings(com.centurylink.mdw.plugin.project.model.ServerSettings) WorkflowProject(com.centurylink.mdw.plugin.project.model.WorkflowProject) ServerConfigurator(com.centurylink.mdw.plugin.server.ServerConfigurator)

Example 3 with ServerSettings

use of com.centurylink.mdw.plugin.project.model.ServerSettings in project mdw-designer by CenturyLinkCloud.

the class ProjectUpdater method getPropertiesMap.

private Map<String, String> getPropertiesMap() {
    Map<String, String> propsMap = new HashMap<String, String>();
    ServerSettings serverSettings = workflowProject.getServerSettings();
    JdbcDataSource mdwDataSource = workflowProject.getMdwDataSource();
    propsMap.put("USER_NAME", System.getProperty("user.name"));
    propsMap.put("CONTAINER", serverSettings.getContainerName());
    propsMap.put("CONTAINER_VERSION", serverSettings.getContainerVersion());
    propsMap.put("CONTAINER_HOME", serverSettings.getHomeWithFwdSlashes());
    propsMap.put("NAMING_PROVIDER", serverSettings.getNamingProvider());
    propsMap.put("DATASOURCE_PROVIDER", serverSettings.getDataSourceProvider());
    propsMap.put("JMS_PROVIDER", serverSettings.getJmsProvider());
    propsMap.put("THREADPOOL_PROVIDER", serverSettings.getThreadPoolProvider());
    propsMap.put("MESSENGER", serverSettings.getMessenger());
    propsMap.put("SERVER_ROOT", serverSettings.getServerLocWithFwdSlashes());
    propsMap.put("SERVER_HOST", serverSettings.getHost());
    propsMap.put("SERVER_PORT", String.valueOf(serverSettings.getPort()));
    propsMap.put("SERVER_USER", serverSettings.getUser());
    propsMap.put("SERVER_PASSWORD", serverSettings.getPassword());
    propsMap.put("JAVA_HOME", serverSettings.getJdkHomeWithFwdSlashes());
    propsMap.put("APP_DIR", mdwSettings.getWorkspaceDirectory());
    propsMap.put("APP_NAME", workflowProject.getSourceProjectName());
    propsMap.put("SERVER_APP_SUBDIR", "mdw");
    propsMap.put("MDW_JDBC_URL", mdwDataSource.getJdbcUrl());
    propsMap.put("MDW_DB_USER", mdwDataSource.getDbUser());
    propsMap.put("MDW_DB_PASSWORD", mdwDataSource.getDbPassword());
    propsMap.put("MDW_DB_POOLSIZE", "5");
    propsMap.put("MDW_DB_POOLMAXIDLE", "3");
    propsMap.put("GENERIC_MDW_BUS_TOPIC", "Q.*.ORDEH.MDW.@USER_NAME@");
    propsMap.put("DQNAME_GENERIC_MDW_BUS_TOPIC", "LOCAL_ORDEH_MDW_@USER_NAME@");
    propsMap.put("GENERIC_MDW_LISTENER_COUNT", "1");
    propsMap.put("GENERIC_MDW_BUS_URI", "rvd://239.75.2.3:7523/denvzd.qwest.net:7523");
    propsMap.put("DEFAULT_BUS_URI", "rvd://239.75.2.3:7523/denvzd.qwest.net:7523");
    propsMap.put("LDAP_HOST", "ldapt.dev.qintra.com");
    propsMap.put("MDW_HUB_URL", serverSettings.getUrlBase() + "/MDWHub");
    propsMap.put("SERVICES_URL", serverSettings.getUrlBase() + "/" + workflowProject.getMdwWebProjectName());
    propsMap.put("REPORTS_URL", serverSettings.getUrlBase() + "/MDWReports");
    propsMap.put("HELPERS_URL", serverSettings.getUrlBase() + "/" + workflowProject.getMdwWebProjectName());
    propsMap.put("TASK_MANAGER_URL", serverSettings.getUrlBase() + "/" + workflowProject.getTaskManagerWebProjectName());
    propsMap.put("WORKFLOW_SNAPSHOT_IMAGE_URL", serverSettings.getUrlBase() + "/" + workflowProject.getDesignerWebProjectName() + "/servlet/imageServlet");
    propsMap.put("ATTACHMENTS_STORAGE_LOCATION", "C:/temp/");
    propsMap.put("MANAGED_SERVER_LIST", "localhost:8181");
    return propsMap;
}
Also used : HashMap(java.util.HashMap) ServerSettings(com.centurylink.mdw.plugin.project.model.ServerSettings) JdbcDataSource(com.centurylink.mdw.plugin.project.model.JdbcDataSource)

Example 4 with ServerSettings

use of com.centurylink.mdw.plugin.project.model.ServerSettings in project mdw-designer by CenturyLinkCloud.

the class ProjectPersist method toXml.

public String toXml() {
    StringBuffer sb = new StringBuffer();
    sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
    sb.append("<mdw-workflow>\n");
    sb.append("  <sourceProject name=\"" + workflowProject.getSourceProjectName() + "\" author=\"" + workflowProject.getAuthor() + "\"");
    if (workflowProject.isProduction())
        sb.append(" production=\"true\"");
    sb.append("/>\n");
    for (ExtensionModule extension : workflowProject.getExtensionModules()) {
        String extensionElementText = extension.writeConfigElement(workflowProject);
        if (extensionElementText != null)
            sb.append(extensionElementText);
    }
    if (// remote projects get version
    !workflowProject.isRemote())
        // dynamically from server
        sb.append("  <mdwFramework version=\"" + workflowProject.getMdwVersion() + "\"/>\n");
    ServerSettings serverSettings = workflowProject.getServerSettings();
    sb.append("  <server host=\"" + serverSettings.getHost() + "\" port=\"" + serverSettings.getPort() + "\"");
    if (!StringHelper.isEmpty(workflowProject.getWebContextRoot()))
        sb.append(" contextRoot=\"" + workflowProject.getWebContextRoot() + "\"");
    else {
        sb.append(" contextRoot=\"mdw\"");
    }
    sb.append("/>\n");
    if (workflowProject.getPersistType() == PersistType.Git) {
        sb.append("  <repository");
        VcsRepository repo = workflowProject.getMdwVcsRepository();
        sb.append(" provider=\"" + repo.getProvider() + "\"");
        if (repo.getRepositoryUrl() != null && repo.getRepositoryUrl().trim().length() > 0)
            sb.append(" url=\"").append(repo.getRepositoryUrlWithEncryptedCredentials() + "\"");
        if (repo.getBranch() != null && repo.getBranch().trim().length() > 0)
            sb.append(" branch=\"").append(repo.getBranch() + "\"");
        if (repo.getLocalPath() != null && repo.getLocalPath().trim().length() > 0)
            sb.append(" localPath=\"").append(repo.getLocalPath().replace("\\", "/") + "\"");
        if (repo.getPkgPrefixes() != null && !repo.getPkgPrefixes().isEmpty()) {
            sb.append(" pkgPrefixes=\"");
            for (int i = 0; i < repo.getPkgPrefixes().size(); i++) {
                String prefix = repo.getPkgPrefixes().get(i).trim();
                sb.append(prefix);
                if (i < repo.getPkgPrefixes().size() - 1)
                    sb.append(",");
            }
            sb.append("\"");
        }
        sb.append("/>\n");
    }
    if (!workflowProject.checkRequiredVersion(6, 0)) {
        if (workflowProject.getPersistType() != PersistType.None) {
            sb.append("  <database jdbcUrl=\"" + workflowProject.getMdwDataSource().getJdbcUrlWithEncryptedCredentials() + "\"");
            if (workflowProject.getMdwDataSource().getSchemaOwner() != null)
                sb.append(" schemaOwner=\"" + workflowProject.getMdwDataSource().getSchemaOwner() + "\"");
            sb.append("/>\n");
        }
        if (workflowProject.getFilesToIgnore() != null)
            sb.append("  <filesToIgnore duringUpdate=\"" + workflowProject.getFilesToIgnoreDuringUpdate() + "\"/>\n");
    }
    sb.append("</mdw-workflow>\n");
    return sb.toString();
}
Also used : ServerSettings(com.centurylink.mdw.plugin.project.model.ServerSettings) ExtensionModule(com.centurylink.mdw.plugin.project.extensions.ExtensionModule) VcsRepository(com.centurylink.mdw.plugin.project.model.VcsRepository)

Example 5 with ServerSettings

use of com.centurylink.mdw.plugin.project.model.ServerSettings in project mdw-designer by CenturyLinkCloud.

the class ProjectPersist method retrieveProjectPrefs.

public void retrieveProjectPrefs(IProject project) throws CoreException {
    ServerSettings serverSettings = workflowProject.getServerSettings();
    String home = getPersistentProperty(project, MDW_SERVER_HOME);
    if (home != null)
        serverSettings.setHome(home);
    String jdkHome = getPersistentProperty(project, MDW_SERVER_JDK_HOME);
    if (jdkHome != null)
        serverSettings.setJdkHome(jdkHome);
    String location = getPersistentProperty(project, MDW_SERVER_LOCATION);
    if (location != null)
        serverSettings.setServerLoc(location);
    String cmdPort = getPersistentProperty(project, MDW_SERVER_CMD_PORT);
    if (cmdPort != null)
        serverSettings.setCommandPort(Integer.parseInt(cmdPort));
    String user = getPersistentProperty(project, MDW_SERVER_USER);
    if (user != null) {
        serverSettings.setUser(user);
        String encPass = getPersistentProperty(project, MDW_SERVER_PASSWORD);
        if (encPass != null) {
            try {
                serverSettings.setPassword(CryptUtil.decrypt(encPass));
            } catch (GeneralSecurityException ex) {
                PluginMessages.log(ex);
            }
        }
    }
    String serverJavaOpts = getPersistentProperty(project, MDW_SERVER_JAVA_OPTS);
    if (serverJavaOpts != null)
        serverSettings.setJavaOptions(serverJavaOpts);
    if (Boolean.parseBoolean(getPersistentProperty(project, MDW_SERVER_DEBUG))) {
        serverSettings.setDebug(true);
        String debugPort = getPersistentProperty(project, MDW_SERVER_DEBUG_PORT);
        if (debugPort != null)
            serverSettings.setDebugPort(Integer.parseInt(debugPort));
        if (serverSettings.getDebugPort() == 0)
            serverSettings.setDebugPort(8500);
        serverSettings.setSuspend(Boolean.parseBoolean(getPersistentProperty(project, MDW_SERVER_SUSPEND)));
    }
    // log watcher and stub host are hardwired to localhost
    try {
        String host = InetAddress.getLocalHost().getHostName();
        serverSettings.setLogWatcherHost(host);
        serverSettings.setStubServerHost(host);
    } catch (UnknownHostException ex) {
        PluginMessages.log(ex);
    }
    int logPort = DEFAULT_LOG_PORT;
    String logPortStr = getPersistentProperty(project, LOG_WATCHER_PORT);
    if (logPortStr != null && !logPortStr.equals("0"))
        logPort = Integer.parseInt(logPortStr);
    serverSettings.setLogWatcherPort(logPort);
    int logTimeout = DEFAULT_LOG_TIMEOUT;
    String logTimeoutStr = getPersistentProperty(project, LOG_WATCHER_TIMEOUT);
    if (logTimeoutStr != null)
        logTimeout = Integer.parseInt(logTimeoutStr);
    serverSettings.setLogWatcherTimeout(logTimeout);
    int stubPort = DEFAULT_STUB_PORT;
    String stubPortStr = getPersistentProperty(project, STUB_SERVER_PORT);
    if (stubPortStr != null && !stubPortStr.equals("0"))
        stubPort = Integer.parseInt(stubPortStr);
    serverSettings.setStubServerPort(stubPort);
    int stubTimeout = DEFAULT_STUB_TIMEOUT;
    String stubTimeoutStr = getPersistentProperty(project, STUB_SERVER_TIMEOUT);
    if (stubTimeoutStr != null)
        stubTimeout = Integer.parseInt(stubTimeoutStr);
    serverSettings.setStubServerTimeout(stubTimeout);
    if (workflowProject.getPersistType() == PersistType.Git) {
        String archiveSync = getPersistentProperty(workflowProject.getSourceProject(), MDW_VCS_SYNC_ARCHIVE);
        workflowProject.getMdwVcsRepository().setSyncAssetArchive("true".equalsIgnoreCase(archiveSync));
    }
    String refr = getPersistentProperty(workflowProject.getSourceProject(), MDW_UPDATE_SERVER_CACHE);
    workflowProject.setUpdateServerCache(!"false".equalsIgnoreCase(refr));
}
Also used : UnknownHostException(java.net.UnknownHostException) ServerSettings(com.centurylink.mdw.plugin.project.model.ServerSettings) GeneralSecurityException(java.security.GeneralSecurityException)

Aggregations

ServerSettings (com.centurylink.mdw.plugin.project.model.ServerSettings)19 WorkflowProject (com.centurylink.mdw.plugin.project.model.WorkflowProject)7 JdbcDataSource (com.centurylink.mdw.plugin.project.model.JdbcDataSource)3 Activity (com.centurylink.mdw.plugin.designer.model.Activity)2 AdapterActivity (com.centurylink.mdw.plugin.designer.model.Activity.AdapterActivity)2 EvaluatorActivity (com.centurylink.mdw.plugin.designer.model.Activity.EvaluatorActivity)2 StartActivity (com.centurylink.mdw.plugin.designer.model.Activity.StartActivity)2 ExternalEvent (com.centurylink.mdw.plugin.designer.model.ExternalEvent)2 WorkflowProcess (com.centurylink.mdw.plugin.designer.model.WorkflowProcess)2 ActivityLaunchShortcut (com.centurylink.mdw.plugin.launch.ActivityLaunchShortcut)2 ExternalEventLaunchShortcut (com.centurylink.mdw.plugin.launch.ExternalEventLaunchShortcut)2 ProcessLaunchShortcut (com.centurylink.mdw.plugin.launch.ProcessLaunchShortcut)2 VcsRepository (com.centurylink.mdw.plugin.project.model.VcsRepository)2 ServerConfigurator (com.centurylink.mdw.plugin.server.ServerConfigurator)2 ServerRunner (com.centurylink.mdw.plugin.server.ServerRunner)2 GeneralSecurityException (java.security.GeneralSecurityException)2 IStatus (org.eclipse.core.runtime.IStatus)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)2 Status (org.eclipse.core.runtime.Status)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2