public ContentImpl (String bundleSymbolicName, VersionRange version) { this.contentName = bundleSymbolicName; this.nameValueMap = new HashMap<String, String>(); nameValueMap.put("version", version.toString()); setup(); } /**
public ContentImpl (String bundleSymbolicName, VersionRange version) { this.contentName = bundleSymbolicName; this.nameValueMap = new HashMap<String, String>(); nameValueMap.put("version", version.toString()); setup(); } /**
private Collection<ImportedBundle> toImportedBundle(Collection<Content> content) throws ResolverException { log.debug(LOG_ENTRY, "toImportedBundle", content); List<ImportedBundle> result = new ArrayList<ImportedBundle>(); for (Content c : content) { try { result.add(modellingManager.getImportedBundle(c.getContentName(), c.getVersion().toString())); } catch (InvalidAttributeException iae) { throw new ResolverException(iae); } } log.debug(LOG_EXIT, "toImportedBundle", result); return result; }
private Collection<ImportedBundle> toImportedBundle(Collection<Content> content) throws ResolverException { log.debug(LOG_ENTRY, "toImportedBundle", content); List<ImportedBundle> result = new ArrayList<ImportedBundle>(); for (Content c : content) { try { result.add(modellingManager.getImportedBundle(c.getContentName(), c.getVersion().toString())); } catch (InvalidAttributeException iae) { throw new ResolverException(iae); } } log.debug(LOG_EXIT, "toImportedBundle", result); return result; }
/** * Covert a collection of contents to a collection of ImportedBundle objects * @param content a collection of content * @return a collection of ImportedBundle objects * @throws ResolverException */ private Set<ImportedBundle> toImportedBundle(Collection<Content> content) throws ResolverException { _logger.debug(LOG_ENTRY, "toImportedBundle", new Object[]{content}); Set<ImportedBundle> result = new HashSet<ImportedBundle>(); for (Content c : content) { try { result.add(modellingManager.getImportedBundle(c.getContentName(), c.getVersion().toString())); } catch (InvalidAttributeException iax) { ResolverException rx = new ResolverException (iax); _logger.debug(LOG_EXIT, "toImportedBundle", new Object[]{rx}); throw rx; } } _logger.debug(LOG_EXIT, "toImportedBundle", new Object[]{result}); return result; }
@Override public BundleInfo getBundleInfo(String bundleSymbolicName, Version bundleVersion) { Map<String, String> attribs = new HashMap<String, String>(); // bundleVersion is an exact version - so ensure right version filter is generated VersionRange range = ManifestHeaderProcessor.parseVersionRange(bundleVersion.toString(), true); attribs.put(Resource.VERSION, range.toString()); String filterString = ManifestHeaderProcessor.generateFilter(Resource.SYMBOLIC_NAME, bundleSymbolicName, attribs); Resource[] resources; try { resources = repositoryAdmin.discoverResources(filterString); if (resources != null && resources.length > 0) { return toBundleInfo(resources[0], false); } else { return null; } } catch (InvalidSyntaxException e) { log.error("Invalid filter", e); return null; } }
/** * Covert a collection of contents to a collection of ImportedBundle objects * @param content a collection of content * @return a collection of ImportedBundle objects * @throws ResolverException */ private Set<ImportedBundle> toImportedBundle(Collection<Content> content) throws ResolverException { _logger.debug(LOG_ENTRY, "toImportedBundle", new Object[]{content}); Set<ImportedBundle> result = new HashSet<ImportedBundle>(); for (Content c : content) { try { result.add(modellingManager.getImportedBundle(c.getContentName(), c.getVersion().toString())); } catch (InvalidAttributeException iax) { ResolverException rx = new ResolverException (iax); _logger.debug(LOG_EXIT, "toImportedBundle", new Object[]{rx}); throw rx; } } _logger.debug(LOG_EXIT, "toImportedBundle", new Object[]{result}); return result; }
@Override public BundleInfo getBundleInfo(String bundleSymbolicName, Version bundleVersion) { Map<String, String> attribs = new HashMap<String, String>(); // bundleVersion is an exact version - so ensure right version filter is generated VersionRange range = ManifestHeaderProcessor.parseVersionRange(bundleVersion.toString(), true); attribs.put(Resource.VERSION, range.toString()); String filterString = ManifestHeaderProcessor.generateFilter(Resource.SYMBOLIC_NAME, bundleSymbolicName, attribs); Resource[] resources; try { resources = repositoryAdmin.discoverResources(filterString); if (resources != null && resources.length > 0) { return toBundleInfo(resources[0], false); } else { return null; } } catch (InvalidSyntaxException e) { log.error("Invalid filter", e); return null; } }
mergedAttribs.put(Constants.VERSION_ATTRIBUTE, intersectRange.toString());
mergedAttribs.put(Constants.VERSION_ATTRIBUTE, intersectRange.toString());
Content content = ContentFactory.parseContent(constraint.getBundleName(), constraint.getVersionRange().toString()); restrictedReqs.add(content);
Content content = ContentFactory.parseContent(constraint.getBundleName(), constraint.getVersionRange().toString()); restrictedReqs.add(content);
if ((constraints != null ) && (constraints.length > 0 )) { for (ResolveConstraint con: constraints) { contents.add(ContentFactory.parseContent(con.getBundleName(), con.getVersionRange().toString()));
if ((constraints != null ) && (constraints.length > 0 )) { for (ResolveConstraint con: constraints) { contents.add(ContentFactory.parseContent(con.getBundleName(), con.getVersionRange().toString()));