Examples of DownloadResults


Examples of org.apache.geronimo.system.plugin.DownloadResults

        if (artifact != null) {
            pluginList.getPlugin().add(toPluginType(Artifact.create(artifact)));
        } else {
            addDependencies(pluginList);
        }
        DownloadResults downloadPoller = new DownloadResults();
        String targetServerPath = targetServerDirectory.getAbsolutePath();

        Kernel kernel = new BasicKernel("Assembly");
        try {
            PluginInstallerGBean installer = new PluginInstallerGBean(targetRepositoryPath, targetServerPath, servers, kernel, getClass().getClassLoader());
            installer.install(pluginList, sourceRepo, true, null, null, downloadPoller);
            if (overrides != null) {
                for (Override override: this.overrides) {
                    AttributesType attributes = override.getOverrides(overridesDir);
                    installer.mergeOverrides(override.getServer(), attributes);
                }
            }
        } finally {
            kernel.shutdown();
        }
        log.info("Installed plugins: ");
        for (Artifact artifact: downloadPoller.getInstalledConfigIDs()) {
            log.info("    " + artifact);
        }
        log.info("Installed dependencies: ");
        for (Artifact artifact: downloadPoller.getDependenciesInstalled()) {
            log.info("    " + artifact);
        }
        if (downloadPoller.isFailed()) {
            throw downloadPoller.getFailure();
        }
    }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.DownloadResults

        PluginListType list = getServerPluginList(request, pluginInstaller);
        PluginListType installList = getPluginsFromIds(configIds, list);
       

        try {
            DownloadResults downloadResults = pluginInstaller.installPluginList("repository", relativeServerPath, installList);
            archiver.archive(relativeServerPath, "var/temp", new Artifact(groupId, artifactId, version, format));
        } catch (Exception e) {
            throw new PortletException("Could not assemble server", e);
        }
        return ASSEMBLY_CONFIRM_MODE+BEFORE_ACTION;
View Full Code Here

Examples of org.apache.geronimo.system.plugin.DownloadResults

        moduleIdName = moduleIdName.replaceAll("SERVER", getServerType());
        URL repo = getFirstPluginRepository(kernel);
        PluginMetadata target = new PluginMetadata("Sample Application", null, "Samples", "A sample application",
                                                   null, null, null, false, true);
        target.setDependencies(new String[]{moduleIdName});
        DownloadResults results = installer.install(new PluginList(new URL[]{repo, new URL("http://www.ibiblio.org/maven2/")},
                                                    new PluginMetadata[]{target}), null, null);
        if(results.isFailed()) {
            throw new ServletException("Unable to install sample application", results.getFailure());
        }
        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
        for (int i = 0; i < results.getInstalledConfigIDs().length; i++) {
            Artifact artifact = results.getInstalledConfigIDs()[i];
            if(mgr.isConfiguration(artifact)) {
                try {
                    if(!mgr.isLoaded(artifact)) {
                        mgr.loadConfiguration(artifact);
                    }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.DownloadResults

    }

    public void installPlugins(GeronimoDeploymentManager mgr, PluginListType list, String defaultRepository, ConsoleReader consoleReader, ServerConnection connection) throws IOException, DeploymentException {
        long start = System.currentTimeMillis();
        Object key = mgr.startInstall(list, defaultRepository, false, null, null);
        DownloadResults results = CommandInstallCAR.showProgress(consoleReader, mgr, key);
        int time = (int) (System.currentTimeMillis() - start) / 1000;
        CommandInstallCAR.printResults(consoleReader, results, time);
    }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.DownloadResults

    }


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

Examples of org.apache.geronimo.system.plugin.DownloadResults

        String targetBasePath = targetPath + groupId +"/";
        String targetAssemblyPath = targetBasePath + artifactId+"-"+version;
        String targetArchivePath = targetBasePath;
       
        try {
            DownloadResults downloadResults = pluginInstaller.installPluginList("repository", targetAssemblyPath, installList);
            archiver.archive(targetAssemblyPath, targetArchivePath, new Artifact(groupId, artifactId, version, format));
        } catch (Exception e) {
            throw new PortletException("Could not assemble server", e);
        }
       
View Full Code Here

Examples of org.apache.geronimo.system.plugin.DownloadResults

        PluginListType list = getRepoPluginList(request, pluginInstaller, repo);
        PluginListType installList = getPluginsFromIds(configIds, list);

        Object downloadKey = pluginInstaller.startInstall(installList, repo, false, user, pass);
        DownloadResults results = pluginInstaller.checkOnInstall(downloadKey);
        request.getPortletSession(true).setAttribute(DOWNLOAD_RESULTS_SESSION_KEY, results);
       
        response.setRenderParameter("configIds", configIds);
        response.setRenderParameter("repository", repo);
        response.setRenderParameter("downloadKey", downloadKey.toString());
View Full Code Here

Examples of org.apache.geronimo.system.plugin.DownloadResults

        if (artifact != null) {
            pluginList.getPlugin().add(toPluginType(Artifact.create(artifact)));
        } else {
            addDependencies(pluginList);
        }
        DownloadResults downloadPoller = new DownloadResults();
        String targetServerPath = targetServerDirectory.getAbsolutePath();

        Kernel kernel = new BasicKernel("Assembly");
        PluginRepositoryList pluginRepoList = new PluginRepositoryDownloader(Collections.singletonMap(localRepo, (String[]) null), true);
        try {
            PluginInstallerGBean installer = new PluginInstallerGBean(targetRepositoryPath, targetServerPath, installedPluginsList, servers, pluginRepoList, kernel, getClass().getClassLoader());
            installer.install(pluginList, sourceRepo, true, null, null, downloadPoller);
            if (overrides != null) {
                for (Override override: this.overrides) {
                    AttributesType attributes = override.getOverrides(overridesDir);
                    installer.mergeOverrides(override.getServer(), attributes);
                }
            }
        } catch (Exception e) {
            throw new MojoExecutionException("Could not use plugin installer bean", e);
        } finally {
            kernel.shutdown();
        }
        getLog().info("Installed plugins: ");
        for (Artifact artifact: downloadPoller.getInstalledConfigIDs()) {
            getLog().info("    " + artifact);
        }
        getLog().info("Installed dependencies: ");
        for (Artifact artifact: downloadPoller.getDependenciesInstalled()) {
            getLog().info("    " + artifact);
        }
        if (downloadPoller.isFailed()) {
            throw new MojoExecutionException("Could not download all dependencies", downloadPoller.getFailure());
        }
    }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.DownloadResults

                    throw new DeploymentException("CAR file cannot be read: "+carFile.getAbsolutePath());
                }
                //TODO figure out if there is a plausible default repo
                Object key = mgr.startInstall(carFile, null, false, null, null);
                long start = System.currentTimeMillis();
                DownloadResults results = showProgress(consoleReader, mgr, key);
                int time = (int)(System.currentTimeMillis() - start) / 1000;
                printResults(consoleReader, results, time);           
            } catch (IOException e) {
                throw new DeploymentException("Cannot install plugin", e);
            }
View Full Code Here

Examples of org.apache.geronimo.system.plugin.DownloadResults

    static DownloadResults showProgress(ConsoleReader consoleReader, GeronimoDeploymentManager mgr, Object key) throws IOException {
        DeployUtils.println("Checking for status every 1000ms:", 0, consoleReader);
        String last = null, status;
        while(true) {
            DownloadResults results = mgr.checkOnInstall(key);
            if(results.getCurrentFile() != null) {
                if(results.getCurrentFilePercent() > -1) {
                    status = results.getCurrentMessage()+" ("+results.getCurrentFilePercent()+"%)";
                } else {
                    status = results.getCurrentMessage();
                }
                if(last == null || !last.equals(status)) {
                    last = status;
                    DeployUtils.println(status, 0, consoleReader);
                    consoleReader.flushConsole();
                }
            }
            if(results.isFinished()) {
                if(results.isFailed()) {
                    DeployUtils.println("Installation FAILED: "+results.getFailure().getMessage(), 0, consoleReader);
                }
                return results;
            }
            try {
                Thread.sleep(1000);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.