Package org.springframework.roo.addon.roobot.client.model

Examples of org.springframework.roo.addon.roobot.client.model.BundleVersion


        List<PGPPublicKeyRing> keys = null;
        if (trustedOnly) {
            keys = pgpService.getTrustedKeys();
        }
        bundle_loop: for (final Bundle bundle : bundles) {
            final BundleVersion latest = bundle.getLatestVersion();
            if (onlyRelevantBundles && !(bundle.getSearchRelevance() > 0)) {
                continue bundle_loop;
            }
            if (trustedOnly && !isTrustedKey(keys, latest.getPgpKey())) {
                continue bundle_loop;
            }
            if (communityOnly
                    && latest
                            .getObrUrl()
                            .equals("http://spring-roo-repository.springsource.org/repository.xml")) {
                continue bundle_loop;
            }
            if (compatibleOnly && !isCompatible(latest.getRooVersion())) {
                continue bundle_loop;
            }
            if (isBundleInstalled(bundle)) {
                continue bundle_loop;
            }
            if (requiresCommand != null && requiresCommand.length() > 0) {
                boolean matchingCommand = false;
                for (final String cmd : latest.getCommands().keySet()) {
                    if (cmd.startsWith(requiresCommand)
                            || requiresCommand.startsWith(cmd)) {
                        matchingCommand = true;
                        break;
                    }
View Full Code Here


                    final String[] terms = searchTerms.split(",");
                    for (final Bundle bundle : bundleCache.values()) {
                        // First set relevance of all bundles to zero
                        bundle.setSearchRelevance(0f);
                        int hits = 0;
                        final BundleVersion latest = bundle.getLatestVersion();
                        for (final String term : terms) {
                            if ((bundle.getSymbolicName() + ";" + latest
                                    .getSummary()).toLowerCase().contains(
                                    term.trim().toLowerCase())
                                    || term.equals("*")) {
                                hits++;
                            }
View Full Code Here

                .getBundles()) {
            final Bundle b = bundleCache.get(bundle.getSymbolicName());
            if (b == null) {
                continue;
            }
            final BundleVersion bundleVersion = b.getLatestVersion();
            final String rooBotBundleVersion = bundleVersion.getVersion();
            final Object ebv = bundle.getHeaders().get("Bundle-Version");
            if (ebv == null) {
                continue;
            }
            final String exisingBundleVersion = ebv.toString().trim();
View Full Code Here

                        if (split.length > 2) {
                            // Only interested in major.minor
                            rooVersion = split[0] + "." + split[1];
                        }
                    }
                    final BundleVersion version = new BundleVersion(
                            versionElement.getAttribute("url"),
                            versionElement.getAttribute("obr-url"),
                            versionBuilder.toString(),
                            versionElement.getAttribute("name"),
                            new Long(versionElement.getAttribute("size"))
                                    .longValue(),
                            versionElement.getAttribute("description"), pgpKey,
                            signedBy, rooVersion, commands);
                    // For security reasons we ONLY accept httppgp://
                    // add-on versions
                    if (!version.getUri().startsWith("httppgp://")) {
                        continue;
                    }
                    bundle.addVersion(version);
                }
                bundleCache.put(bsn, bundle);
View Full Code Here

        LOGGER.warning("ID T R DESCRIPTION -------------------------------------------------------------");
        for (final Bundle bundle : bundles) {
            if (maxResults-- == 0) {
                break;
            }
            final BundleVersion latest = bundle.getLatestVersion();
            final String bundleKey = String.format("%02d", bundleId++);
            searchResultCache.put(bundleKey, bundle);
            sb.append(bundleKey);
            sb.append(isTrustedKey(keys, latest.getPgpKey()) ? " Y " : " - ");
            sb.append(isCompatible(latest.getRooVersion()) ? "Y " : "- ");
            sb.append(latest.getVersion());
            sb.append(" ");
            final List<String> split = new ArrayList<String>(
                    Arrays.asList(latest.getDescription().split("\\s")));
            int lpr = linesPerResult;
            while (split.size() > 0 && --lpr >= 0) {
                while (!split.isEmpty()
                        && split.get(0).length() + sb.length() < (lpr == 0 ? 77
                                : 80)) {
View Full Code Here

            if (bundle == null) {
                LOGGER.warning("Could not find specified bundle with symbolic name: "
                        + bsn.getKey());
                return InstallOrUpgradeStatus.FAILED;
            }
            final BundleVersion bundleVersion = bundle.getBundleVersion(bsn
                    .getKey());
            final InstallOrUpgradeStatus status = installOrUpgradeAddOn(
                    bundleVersion, bsn.getKey(), false);
            if (status.equals(InstallOrUpgradeStatus.SUCCESS)) {
                LOGGER.info("Successfully upgraded: "
                        + bundle.getSymbolicName() + " [version: "
                        + bundleVersion.getVersion() + "]");
                LOGGER.warning("Please restart the Roo shell to complete the upgrade");
            }
            else if (status.equals(InstallOrUpgradeStatus.FAILED)) {
                LOGGER.warning("Unable to upgrade: " + bundle.getSymbolicName()
                        + " [version: " + bundleVersion.getVersion() + "]");
            }
            return status;
        }
    }
View Full Code Here

            }
            if (bundle == null) {
                LOGGER.warning("A valid bundle ID is required");
                return InstallOrUpgradeStatus.FAILED;
            }
            final BundleVersion bundleVersion = bundle
                    .getBundleVersion(bundleId);
            final InstallOrUpgradeStatus status = installOrUpgradeAddOn(
                    bundleVersion, bundle.getSymbolicName(), false);
            if (status.equals(InstallOrUpgradeStatus.SUCCESS)) {
                LOGGER.info("Successfully upgraded: "
                        + bundle.getSymbolicName() + " [version: "
                        + bundleVersion.getVersion() + "]");
                LOGGER.warning("Please restart the Roo shell to complete the upgrade");
            }
            else if (status.equals(InstallOrUpgradeStatus.FAILED)) {
                LOGGER.warning("Unable to upgrade: " + bundle.getSymbolicName()
                        + " [version: " + bundleVersion.getVersion() + "]");
            }
            return status;
        }
    }
View Full Code Here

        synchronized (mutex) {
            final AddOnStabilityLevel addonStabilityLevel = checkAddOnStabilityLevel(null);
            final Map<String, Bundle> bundles = getUpgradableBundles(addonStabilityLevel);
            boolean upgraded = false;
            for (final Bundle bundle : bundles.values()) {
                final BundleVersion bundleVersion = bundle.getLatestVersion();
                final InstallOrUpgradeStatus status = installOrUpgradeAddOn(
                        bundleVersion, bundle.getSymbolicName(), false);
                if (status.equals(InstallOrUpgradeStatus.SUCCESS)) {
                    LOGGER.info("Successfully upgraded: "
                            + bundle.getSymbolicName() + " [version: "
                            + bundleVersion.getVersion() + "]");
                    upgraded = true;
                }
                else if (status.equals(InstallOrUpgradeStatus.FAILED)) {
                    LOGGER.warning("Unable to upgrade: "
                            + bundle.getSymbolicName() + " [version: "
                            + bundleVersion.getVersion() + "]");
                }
            }
            if (upgraded) {
                LOGGER.warning("Please restart the Roo shell to complete the upgrade");
            }
View Full Code Here

            else {
                LOGGER.info("The following add-ons / components are available for upgrade for level: "
                        + addonStabilityLevel.name());
                printSeparator();
                for (final Entry<String, Bundle> entry : bundles.entrySet()) {
                    final BundleVersion latest = entry.getValue()
                            .getLatestVersion();
                    if (latest != null) {
                        LOGGER.info("[level: "
                                + AddOnStabilityLevel.fromLevel(
                                        AddOnStabilityLevel
                                                .getAddOnStabilityLevel(latest
                                                        .getVersion())).name()
                                + "] " + entry.getKey() + " > "
                                + latest.getVersion());
                    }
                }
                printSeparator();
            }
        }
View Full Code Here

      e.printStackTrace();
    }
  }

  public boolean trust(PluginVersion pluginVersion) {
    BundleVersion bundleVersion = ((RooAddOnVersion)pluginVersion).getBundleVersion();
    pgpService.trust(new PgpKeyId(bundleVersion.getPgpKey()));
    return true;
  }
View Full Code Here

TOP

Related Classes of org.springframework.roo.addon.roobot.client.model.BundleVersion

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.