private RegionFilter createFilter(final String... packageNames) throws InvalidSyntaxException { Collection<String> filters = new ArrayList<String>(packageNames.length); for (String pkg : packageNames) { filters.add('(' + RegionFilter.VISIBLE_PACKAGE_NAMESPACE + '=' + pkg + ')'); } RegionFilterBuilder builder = digraph.createRegionFilterBuilder(); for (String filter : filters) { builder.allow(RegionFilter.VISIBLE_PACKAGE_NAMESPACE, filter); } return builder.build(); }
private RegionFilter createBundleFilter(String bundleSymbolicName, Version bundleVersion) throws InvalidSyntaxException { String bundleFilter = "(&(" + RegionFilter.VISIBLE_BUNDLE_NAMESPACE + '=' + bundleSymbolicName + ')' + '(' + Constants.BUNDLE_VERSION_ATTRIBUTE + ">=" + (bundleVersion == null ? "0" : bundleVersion.toString()) + "))"; RegionFilterBuilder builder = digraph.createRegionFilterBuilder(); return builder.allow(RegionFilter.VISIBLE_BUNDLE_NAMESPACE, bundleFilter).build(); }