Package org.apache.geronimo.system.plugin.model

Examples of org.apache.geronimo.system.plugin.model.PluginListType


                if (commandArgs.getArgs().length == 1) {
                    repo = commandArgs.getArgs()[0];
                } else {
                    repo = getRepository(consoleReader, mgr);
                }
                PluginListType plugins = getPluginCategories(repo, mgr, consoleReader);
                if (plugins == null) {
                    return;
                }

                PluginListType list = getInstallList(plugins, consoleReader, repo);
                if (list == null) {
                    return;
                }

                installPlugins(mgr, list, repo, consoleReader, connection);
View Full Code Here


    public PluginListType getPluginCategories(String repo, GeronimoDeploymentManager mgr, ConsoleReader consoleReader) throws DeploymentException, IOException {
        if (repo == null) {
            return null;
        }
        PluginListType data;
        URL repository;
        try {
            repository = new URL(repo);
            data = mgr.listPlugins(repository);
        } catch (IOException e) {
            throw new DeploymentException("Unable to list configurations", e);
        } catch (FailedLoginException e) {
            throw new DeploymentException("Invalid login for Maven repository '" + repo + "'", e);
        }
        if (data == null || data.getPlugin().size() == 0) {
            return null;
        }
        return data;
    }
View Full Code Here

        }
        return data;
    }

    public PluginListType getLocalPluginCategories(GeronimoDeploymentManager mgr, ConsoleReader consoleReader) throws DeploymentException, IOException {
        PluginListType data;
        try {
            data = mgr.createPluginListForRepositories(null);
        } catch (NoSuchStoreException e) {
            throw new DeploymentException("Unable to list configurations", e);
        }
        if (data == null || data.getPlugin().size() == 0) {
            return null;
        }
        return data;
    }
View Full Code Here

        }
        return data;
    }

    public PluginListType getLocalApplicationPlugins(GeronimoDeploymentManager mgr, ConsoleReader consoleReader) throws DeploymentException, IOException {
        PluginListType data = getLocalPluginCategories(mgr, consoleReader);
        List<String> appList = getApplicationModuleLists(mgr);

        PluginListType appPlugin = getPluginsFromIds(appList, data);
       
        // let's add framework plugin group manually so that users can choose it
        for (PluginType metadata : data.getPlugin()) {
            for (PluginArtifactType testInstance : metadata.getPluginArtifact()) {
                if (PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().indexOf("plugingroups/framework") > 0) {
                    PluginType plugin = PluginInstallerGBean.copy(metadata, testInstance);
                    appPlugin.getPlugin().add(plugin);
                    break;
                }
            }
        }
       
View Full Code Here

       
        return appPlugin;
    }
   
    public PluginListType getLocalPluginGroups(GeronimoDeploymentManager mgr, ConsoleReader consoleReader) throws DeploymentException, IOException {
        PluginListType data = getLocalPluginCategories(mgr, consoleReader);
        PluginListType appData = new PluginListType();

        for (PluginType metadata: data.getPlugin()) {
            // ignore plugins which have no artifacts defined
            if (metadata.getPluginArtifact().isEmpty()) {
                continue;
            }

            if (metadata.getCategory() == null) {
                metadata.setCategory("Unspecified");
            }
      
            //determine if the plugin is a plugin group
            if (metadata.isPluginGroup() != null && metadata.isPluginGroup()) {
                appData.getPlugin().add(metadata);
            }
        }
       
        if (appData == null || appData.getPlugin().size() == 0) {
            return null;
        }
        return appData;
    }
View Full Code Here

        }
        return categories;
    }

    public PluginListType getInstallList(PluginListType plugins1, PluginListType plugins2, ConsoleReader consoleReader, String repo) throws IOException {
        PluginListType plugins = new PluginListType();
        for (PluginType metadata : plugins1.getPlugin()) {
            plugins.getPlugin().add(metadata);
        }
       
        for (PluginType metadata : plugins2.getPlugin()) {
            plugins.getPlugin().add(metadata);
        }       
       
        return getInstallList(plugins, consoleReader, repo);
    }
View Full Code Here

        consoleReader.flushConsole();
        String answer = consoleReader.readLine("Install Services [enter a comma separated list of numbers or 'q' to quit]: ").trim();
        if (answer.equalsIgnoreCase("q")) {
            return null;
        }
        PluginListType list = new PluginListType();
        for (String instance : answer.split(",")) {
            int selection = Integer.parseInt(instance.trim());
            PluginType target = available.get(selection - 1);
            list.getPlugin().add(target);
        }
       
        if (repo != null) {
            list.getDefaultRepository().add(repo);
        }
       
        //let's add the repo's default-repository to the list
        for (String defaultRepoLocation : defaultRepoLocations) {
            list.getDefaultRepository().add(defaultRepoLocation);
        }
        return list;
    }
View Full Code Here

        int time = (int) (System.currentTimeMillis() - start) / 1000;
        CommandInstallCAR.printResults(consoleReader, results, time);
    }

    public void installPlugins(GeronimoDeploymentManager mgr, List<String> list, PluginListType all, String defaultRepository, ConsoleReader consoleReader, ServerConnection connection) throws IOException, DeploymentException {
        PluginListType selected = getPluginsFromIds(list, all);
        installPlugins(mgr, selected, defaultRepository, consoleReader, connection);
    }
View Full Code Here

        PluginListType selected = getPluginsFromIds(list, all);
        installPlugins(mgr, selected, defaultRepository, consoleReader, connection);
    }

    private static PluginListType getPluginsFromIds(List<String> configIds, PluginListType list) throws IllegalStateException {
        PluginListType installList = new PluginListType();
        for (String configId : configIds) {
            PluginType plugin = null;
            for (PluginType metadata : list.getPlugin()) {
                for (PluginArtifactType testInstance : metadata.getPluginArtifact()) {
                    if (PluginInstallerGBean.toArtifact(testInstance.getModuleId()).toString().equals(configId)) {
                        plugin = PluginInstallerGBean.copy(metadata, testInstance);
                        installList.getPlugin().add(plugin);
                        break;
                    }
                }
            }
            // if plugin value is null here, means the configId is not a geronimo plugin - ignore
View Full Code Here

        DownloadResults results = mgr.installPluginList(repositoryPath, relativeServerPath, list);
        int time = (int) (System.currentTimeMillis() - start) / 1000;
        CommandInstallCAR.printResults(consoleReader, results, time);
    }
    public void assembleServer(GeronimoDeploymentManager mgr, List<String> list, PluginListType all, String repositoryPath, String relativeServerPath, ConsoleReader consoleReader) throws Exception {
        PluginListType selected = getPluginsFromIds(list, all);
        assembleServer(mgr, selected, repositoryPath, relativeServerPath, consoleReader);
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.system.plugin.model.PluginListType

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.