Package org.apache.geronimo.deployment.cli

Examples of org.apache.geronimo.deployment.cli.CommandListConfigurations


     *
     * @return The return value from the command.
     * @exception Exception
     */
    protected Object doExecute(ServerConnection connection) throws Exception {
        CommandListConfigurations command = new CommandListConfigurations();

        if (mode == null) {
            println("Available custom assembly modes:");
            println(" 1:    Function Centric");
            println(" 2:    Application Centric");
            println(" 3:    Expert Users");

            mode = readLine("Please select a custom assembly mode [1,2,3]").trim();
            if (mode == null || (mode.compareTo("1") != 0 && mode.compareTo("2") != 0 && mode.compareTo("3") != 0)) {
                throw new IllegalArgumentException("Please enter a valid Assembly server mode");
            }
        }

        if (group == null) {
            group = readLine("Assembly server group name: ").trim();
            if (group.equals("")) {
                throw new IllegalArgumentException("Assembly server group name is required");
            }
        }

        if (artifact == null) {
            artifact = readLine("Assembly server artifact name: ").trim();
            if (artifact.equals("")) {
                throw new IllegalArgumentException("Assembly server artifact name is required");
            }
        }

        PluginListType plugins = (PluginListType)session.get("LocalPlugins");

        if (refreshList || plugins == null) {
            plugins = command.getLocalPluginCategories((GeronimoDeploymentManager)connection.getDeploymentManager(), this);
            session.put("LocalPlugins", plugins);
        }

        if (pluginArtifacts != null) {
            command.assembleServer((GeronimoDeploymentManager)connection.getDeploymentManager(), pluginArtifacts, plugins, "repository", relativeServerPath, this);
            ((GeronimoDeploymentManager)connection.getDeploymentManager()).archive(relativeServerPath, "var/temp", new Artifact(group, artifact, version, format));
        } else {
            PluginListType pluginsToInstall;

            if (mode.compareTo("1") == 0) {
                println("Listing plugin groups and application plugins from the local Geronimo server");
                PluginListType pluginGroups = (PluginListType)session.get("LocalPluginGroups");
                PluginListType appPlugins = (PluginListType)session.get("LocalAppPlugins");

                if (refreshList || pluginGroups == null) {
                    pluginGroups = command.getLocalPluginGroups((GeronimoDeploymentManager)connection.getDeploymentManager(), this);
                    session.put("LocalPluginGroups", pluginGroups);
                }

                if (refreshList || appPlugins == null) {
                    appPlugins = command.getLocalApplicationPlugins((GeronimoDeploymentManager)connection.getDeploymentManager(), this);
                    session.put("LocalAppPlugins", appPlugins);
                }
                pluginsToInstall = command.getInstallList(pluginGroups, appPlugins, this, null);

            } else if (mode.compareTo("2") == 0) {
                println("Listing application plugins and required framework plugin group from the local Geronimo server");
                PluginListType appPlugins = (PluginListType)session.get("LocalAppPlugins");

                if (refreshList || appPlugins == null) {
                    appPlugins = command.getLocalApplicationPlugins((GeronimoDeploymentManager)connection.getDeploymentManager(), this);
                    session.put("LocalAppPlugins", appPlugins);
                }
                pluginsToInstall = command.getInstallList(appPlugins, this, null);
            } else {
                println("Listing plugins from the local Geronimo server");
                pluginsToInstall = command.getInstallList(plugins, this, null);
            }

            if (pluginsToInstall != null) {
                command.assembleServer((GeronimoDeploymentManager) connection.getDeploymentManager(), pluginsToInstall, "repository", relativeServerPath, this);
                ((GeronimoDeploymentManager) connection.getDeploymentManager()).archive(relativeServerPath, "var/temp", new Artifact(group, artifact, version, format));
            }
        }
        return null;
    }
View Full Code Here


    @Override
    protected Object doExecute() throws Exception {
        ServerConnection connection = connect();

        CommandListConfigurations command = new CommandListConfigurations();

        String repo = null;
        PluginListType plugins = null;

        if (mavenRepoURL != null) {
            plugins = command.getPluginCategories(mavenRepoURL, (GeronimoDeploymentManager) connection
                    .getDeploymentManager(), this);
            repo = mavenRepoURL;
        } else {
            println("Listing configurations from Geronimo server");

            repo = (String) session.get("PluginRepository");
            if (refreshRepo || repo == null) {
                session.put("AvailablePlugins", null);
                repo = command.getRepository(this, (GeronimoDeploymentManager) connection
                        .getDeploymentManager());
                session.put("PluginRepository", repo);
            }

            plugins = (PluginListType) session.get("AvailablePlugins");
            if (refreshList || plugins == null) {
                plugins = command.getPluginCategories(repo, (GeronimoDeploymentManager) connection
                        .getDeploymentManager(), this);
                session.put("AvailablePlugins", plugins);
            }
        }

        if (plugins != null) {
            if (pluginArtifacts != null) {
                command.installPlugins((GeronimoDeploymentManager) connection.getDeploymentManager(), pluginArtifacts,
                        plugins, repo, this, connection);
            } else {
                PluginListType pluginsToInstall = command.getInstallList(plugins, this, repo);

                if (pluginsToInstall != null) {
                    command.installPlugins((GeronimoDeploymentManager) connection.getDeploymentManager(),
                            pluginsToInstall, repo, this, connection);
                }
            }
        }
View Full Code Here

     *
     * @return The return value from the command.
     * @exception Exception
     */
    protected Object doExecute(ServerConnection connection) throws Exception {
        CommandListConfigurations command = new CommandListConfigurations();

        if (mode == null) {
            println("Available custom assembly modes:");
            println(" 1:    Function Centric");
            println(" 2:    Application Centric");
            println(" 3:    Expert Users");

            mode = readLine("Please select a custom assembly mode [1,2,3]").trim();
            if (mode == null || (mode.compareTo("1") != 0 && mode.compareTo("2") != 0 && mode.compareTo("3") != 0)) {
                throw new IllegalArgumentException("Please enter a valid Assembly server mode");
            }
        }

        if (group == null) {
            group = readLine("Assembly server group name: ").trim();
            if (group.equals("")) {
                throw new IllegalArgumentException("Assembly server group name is required");
            }
        }

        if (artifact == null) {
            artifact = readLine("Assembly server artifact name: ").trim();
            if (artifact.equals("")) {
                throw new IllegalArgumentException("Assembly server artifact name is required");
            }
        }

        PluginListType plugins = (PluginListType)session.get("LocalPlugins");

        if (refreshList || plugins == null) {
            plugins = command.getLocalPluginCategories((GeronimoDeploymentManager)connection.getDeploymentManager(), this);
            session.put("LocalPlugins", plugins);
        }

        if (pluginArtifacts != null) {
            command.assembleServer((GeronimoDeploymentManager)connection.getDeploymentManager(), pluginArtifacts, plugins, "repository", relativeServerPath, this);
            ((GeronimoDeploymentManager)connection.getDeploymentManager()).archive(relativeServerPath, "var/temp", new Artifact(group, artifact, (String)version, format));
        } else {
            PluginListType pluginsToInstall;

            if (mode.compareTo("1") == 0) {
                println("Listing plugin groups and application plugins from the local Geronimo server");
                PluginListType pluginGroups = (PluginListType)session.get("LocalPluginGroups");
                PluginListType appPlugins = (PluginListType)session.get("LocalAppPlugins");

                if (refreshList || pluginGroups == null) {
                    pluginGroups = command.getLocalPluginGroups((GeronimoDeploymentManager)connection.getDeploymentManager(), this);
                    session.put("LocalPluginGroups", pluginGroups);
                }

                if (refreshList || appPlugins == null) {
                    appPlugins = command.getLocalApplicationPlugins((GeronimoDeploymentManager)connection.getDeploymentManager(), this);
                    session.put("LocalAppPlugins", appPlugins);
                }
                pluginsToInstall = command.getInstallList(pluginGroups, appPlugins, this, null);

            } else if (mode.compareTo("2") == 0) {
                println("Listing application plugins and required framework plugin group from the local Geronimo server");
                PluginListType appPlugins = (PluginListType)session.get("LocalAppPlugins");

                if (refreshList || appPlugins == null) {
                    appPlugins = command.getLocalApplicationPlugins((GeronimoDeploymentManager)connection.getDeploymentManager(), this);
                    session.put("LocalAppPlugins", appPlugins);
                }
                pluginsToInstall = command.getInstallList(appPlugins, this, null);
            } else {
                println("Listing plugins from the local Geronimo server");
                pluginsToInstall = command.getInstallList(plugins, this, null);
            }

            if (pluginsToInstall == null) {
                command.assembleServer((GeronimoDeploymentManager)connection.getDeploymentManager(), pluginsToInstall, "repository", relativeServerPath, this);
                ((GeronimoDeploymentManager)connection.getDeploymentManager()).archive(relativeServerPath, "var/temp", new Artifact(group, artifact, (String)version, format));
            }
        }
        return null;
    }
View Full Code Here

    @Override
    protected Object doExecute() throws Exception {
        ServerConnection connection = connect();

        CommandListConfigurations command = new CommandListConfigurations();

        String repo = null;
        PluginListType plugins = null;

        if (mavenRepoURL != null) {
            plugins = command.getPluginCategories(mavenRepoURL, (GeronimoDeploymentManager) connection
                    .getDeploymentManager(), this);
            repo = mavenRepoURL;
        } else {
            println("Listing configurations from Geronimo server");

            repo = (String) session.get("PluginRepository");
            if (refreshRepo || repo == null) {
                repo = command.getRepository(this, (GeronimoDeploymentManager) connection
                        .getDeploymentManager());
                session.put("PluginRepository", repo);
            }

            plugins = (PluginListType) session.get("AvailablePlugins");
            if (refreshList || plugins == null) {
                plugins = command.getPluginCategories(repo, (GeronimoDeploymentManager) connection
                        .getDeploymentManager(), this);
                session.put("AvailablePlugins", plugins);
            }
        }

        if (plugins != null) {
            if (pluginArtifacts != null) {
                command.installPlugins((GeronimoDeploymentManager) connection.getDeploymentManager(), pluginArtifacts,
                        plugins, repo, this, connection);
            } else {
                PluginListType pluginsToInstall = command.getInstallList(plugins, this, repo);

                if (pluginsToInstall != null) {
                    command.installPlugins((GeronimoDeploymentManager) connection.getDeploymentManager(),
                            pluginsToInstall, repo, this, connection);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.deployment.cli.CommandListConfigurations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.