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

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


    return true;
  }
 
  public InstallOrUpgradeStatus installOrUpgradeAddOn(PluginVersion pluginVersion, boolean install) {
    synchronized (mutex) {
    BundleVersion bundleVersion = ((RooAddOnVersion)pluginVersion).getBundleVersion();
    Bundle bundle = ((RooAddOnVersion)pluginVersion).getBundle();
    if (!verifyRepository(bundleVersion.getObrUrl())) {
      return InstallOrUpgradeStatus.INVALID_REPOSITORY_URL;
    }
    boolean success = true
    int count = countBundles();
    boolean requiresWrappedCoreDep = bundleVersion.getDescription().contains("#wrappedCoreDependency");
    if (requiresWrappedCoreDep && !shell.executeCommand("osgi obr url add --url http://spring-roo-repository.springsource.org/repository.xml")) {
      success = false;
    }
    if (!shell.executeCommand("osgi obr url add --url " + bundleVersion.getObrUrl())) {
      success = false;
    }
    if (!shell.executeCommand("osgi obr start --bundleSymbolicName " + bundle.getSymbolicName())) {
      success = false;
    }
    if (!shell.executeCommand("osgi obr url remove --url " + bundleVersion.getObrUrl())) {
      success = false;
    }
    if (requiresWrappedCoreDep && !shell.executeCommand("osgi obr url remove --url http://spring-roo-repository.springsource.org/repository.xml")) {
      success = false;
    }
View Full Code Here


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

    List<PGPPublicKeyRing> keys = null;
    if (trustedOnly) {
      keys = pgpService.getTrustedKeys();
    }
    bundle_loop: for (Bundle bundle: bundles) {
      BundleVersion latest = bundle.getLatestVersion();
      if (onlyRelevantBundles && !(bundle.getSearchRelevance() > 0)) {
        continue bundle_loop;
      }
      if (trustedOnly && !isTrustedKey(keys, latest.getPgpKey())) {
        continue bundle_loop;
      }
      if (compatibleOnly && !isCompatible(latest.getRooVersion())) {
        continue bundle_loop;
      }
      if (requiresCommand != null && requiresCommand.length() > 0) {
        boolean matchingCommand = false;
        for (String cmd : latest.getCommands().keySet()) {
          if (cmd.startsWith(requiresCommand) || requiresCommand.startsWith(cmd)) {
            matchingCommand = true;
            break;
          }
        }
View Full Code Here

                  //only interested in major.minor
                  rooVersion = split[0] + "." + split[1];
                }
              }
             
              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

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.