Examples of DownloadResults


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);           
                if(results.isFinished() && !results.isFailed() && results.getInstalledConfigIDs().size() == 1) {
                    Artifact target = results.getInstalledConfigIDs().get(0);
                    consoleReader.printString(DeployUtils.reformat("Now starting "+target+"...", 4, 72));
                    consoleReader.flushConsole();
                    new CommandStart().execute(consoleReader, connection, new BaseCommandArgs(new String[]{target.toString()}));
                }
            } catch (IOException 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

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

        PluginListType list = new PluginListType();
        list.getPlugin().add(target);
//        list.getDefaultRepository().add(repo.toString());
        //todo this is surely wrong
        list.getDefaultRepository().add("http://www.ibiblio.org/maven2/");
        DownloadResults results = installer.install(list, repo.toString(), false, null, null);
        if (results.isFailed()) {
            throw new ServletException("Unable to install sample application", results.getFailure());
        }
        ConfigurationManager mgr = ConfigurationUtil.getConfigurationManager(kernel);
        for (Artifact artifact: results.getInstalledConfigIDs()) {
            if (mgr.isConfiguration(artifact)) {
                try {
                    if (!mgr.isLoaded(artifact)) {
                        mgr.loadConfiguration(artifact);
                    }
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 INDEX_MODE;
View Full Code Here

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

        PluginListType list = getRepoPluginList(request, pluginInstaller, repo, user, pass);
        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

        String[] configId = request.getParameterValues("configId");
        String repo = request.getParameter("repository");
        String user = request.getParameter("repo-user");
        String pass = request.getParameter("repo-pass");
        int downloadKey = Integer.parseInt(request.getParameter("download-key"));
        DownloadResults results = pluginInstaller.checkOnInstall(downloadKey, true);

        List<InstallResults> dependencies = new ArrayList<InstallResults>();
        if (results != null) {
            if(results.isFailed()) {
                //TODO is this an appropriate way to explain failure?
                throw new PortletException("Unable to install configuration", results.getFailure());
            }
            for (Artifact uri: results.getDependenciesInstalled()) {
                dependencies.add(new InstallResults(uri.toString(), "installed"));
            }
            for (Artifact uri: results.getDependenciesPresent()) {
                dependencies.add(new InstallResults(uri.toString(), "already present"));
            }
        }
        request.getPortletSession(true).setAttribute("car.install.results", dependencies);
        response.setRenderParameter("configId", configId);
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

                    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);           
                if(results.isFinished() && !results.isFailed() && results.getInstalledConfigIDs().size() == 1) {
                    Artifact target = results.getInstalledConfigIDs().get(0);
                    consoleReader.printString(DeployUtils.reformat("Now starting "+target+"...", 4, 72));
                    consoleReader.flushConsole();
                    new CommandStart().execute(consoleReader, connection, new BaseCommandArgs(new String[]{target.toString()}));
                }
            } catch (IOException 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.