Package org.osgi.service.indexer

Examples of org.osgi.service.indexer.Builder.addAttribute()


  private void doContent(Resource resource, List<? super Capability> capabilities) throws Exception {
    Builder builder = new Builder()
      .setNamespace(Namespaces.NS_CONTENT);
   
    String sha = calculateSHA(resource);
    builder.addAttribute(Namespaces.NS_CONTENT, sha);
   
    String location = calculateLocation(resource);
    builder.addAttribute(Namespaces.ATTR_CONTENT_URL, location);

    long size = resource.getSize();
View Full Code Here


   
    String sha = calculateSHA(resource);
    builder.addAttribute(Namespaces.NS_CONTENT, sha);
   
    String location = calculateLocation(resource);
    builder.addAttribute(Namespaces.ATTR_CONTENT_URL, location);

    long size = resource.getSize();
    if (size > 0L) builder.addAttribute(Namespaces.ATTR_CONTENT_SIZE, size);
   
    builder.addAttribute(Namespaces.ATTR_CONTENT_MIME, MIME_TYPE_OSGI_BUNDLE);
View Full Code Here

   
    String location = calculateLocation(resource);
    builder.addAttribute(Namespaces.ATTR_CONTENT_URL, location);

    long size = resource.getSize();
    if (size > 0L) builder.addAttribute(Namespaces.ATTR_CONTENT_SIZE, size);
   
    builder.addAttribute(Namespaces.ATTR_CONTENT_MIME, MIME_TYPE_OSGI_BUNDLE);
   
    capabilities.add(builder.buildCapability());
  }
View Full Code Here

    builder.addAttribute(Namespaces.ATTR_CONTENT_URL, location);

    long size = resource.getSize();
    if (size > 0L) builder.addAttribute(Namespaces.ATTR_CONTENT_SIZE, size);
   
    builder.addAttribute(Namespaces.ATTR_CONTENT_MIME, MIME_TYPE_OSGI_BUNDLE);
   
    capabilities.add(builder.buildCapability());
  }
 
  private String calculateSHA(Resource resource) throws IOException, NoSuchAlgorithmException {
View Full Code Here

    SymbolicName bsn = Util.getSymbolicName(resource);
    Version version = Util.getVersion(resource);
   
    bundleBuilder.addAttribute(Namespaces.NS_WIRING_BUNDLE, bsn.getName())
      .addAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version);
    hostBuilder.addAttribute(Namespaces.NS_WIRING_HOST, bsn.getName())
      .addAttribute(Constants.BUNDLE_VERSION_ATTRIBUTE, version);
   
    for (Entry<String, String> attribEntry : bsn.getAttributes().entrySet()) {
      String key = attribEntry.getKey();
      if (key.endsWith(":")) {
View Full Code Here

    Map<String, Map<String, String>> exports = OSGiHeader.parseHeader(exportsStr);
    for (Entry<String, Map<String, String>> entry : exports.entrySet()) {
      Builder builder = new Builder().setNamespace(Namespaces.NS_WIRING_PACKAGE);
     
      String pkgName = OSGiHeader.removeDuplicateMarker(entry.getKey());
      builder.addAttribute(Namespaces.NS_WIRING_PACKAGE, pkgName);
     
      String versionStr = entry.getValue().get(Constants.VERSION_ATTRIBUTE);
      Version version = (versionStr != null) ? new Version(versionStr) : new Version(0, 0, 0);
      builder.addAttribute(Namespaces.ATTR_VERSION, version);
View Full Code Here

      String pkgName = OSGiHeader.removeDuplicateMarker(entry.getKey());
      builder.addAttribute(Namespaces.NS_WIRING_PACKAGE, pkgName);
     
      String versionStr = entry.getValue().get(Constants.VERSION_ATTRIBUTE);
      Version version = (versionStr != null) ? new Version(versionStr) : new Version(0, 0, 0);
      builder.addAttribute(Namespaces.ATTR_VERSION, version);

      for (Entry<String, String> attribEntry : entry.getValue().entrySet()) {
        String key = attribEntry.getKey();
        if (!"specification-version".equalsIgnoreCase(key) && !Constants.VERSION_ATTRIBUTE.equalsIgnoreCase(key)) {
          if (key.endsWith(":"))
View Full Code Here

        String key = attribEntry.getKey();
        if (!"specification-version".equalsIgnoreCase(key) && !Constants.VERSION_ATTRIBUTE.equalsIgnoreCase(key)) {
          if (key.endsWith(":"))
            builder.addDirective(key.substring(0, key.length() - 1), attribEntry.getValue());
          else
            builder.addAttribute(key, attribEntry.getValue());
        }
      }
     
      SymbolicName bsn = Util.getSymbolicName(resource);
      builder.addAttribute(Namespaces.ATTR_BUNDLE_SYMBOLIC_NAME, bsn.getName());
View Full Code Here

            builder.addAttribute(key, attribEntry.getValue());
        }
      }
     
      SymbolicName bsn = Util.getSymbolicName(resource);
      builder.addAttribute(Namespaces.ATTR_BUNDLE_SYMBOLIC_NAME, bsn.getName());
      Version bundleVersion = Util.getVersion(resource);
      builder.addAttribute(Namespaces.ATTR_BUNDLE_VERSION, bundleVersion);
     
      caps.add(builder.buildCapability());
    }
View Full Code Here

      }
     
      SymbolicName bsn = Util.getSymbolicName(resource);
      builder.addAttribute(Namespaces.ATTR_BUNDLE_SYMBOLIC_NAME, bsn.getName());
      Version bundleVersion = Util.getVersion(resource);
      builder.addAttribute(Namespaces.ATTR_BUNDLE_VERSION, bundleVersion);
     
      caps.add(builder.buildCapability());
    }
  }
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.