private Collection<IVersionedId> listElements(List<IVersionedId> elements, String suffix) { if (suffix == null || suffix.length() == 0) return elements; ArrayList<IVersionedId> result = new ArrayList<IVersionedId>(elements.size()); for (IVersionedId elementName : elements) { result.add(new VersionedId(elementName.getId() + suffix, elementName.getVersion())); } return result; }
private IVersionedId[] createVersionedIdList(String parameter) { String[] list = AbstractPublisherAction.getArrayFromString(parameter, ","); //$NON-NLS-1$ IVersionedId[] result = new IVersionedId[list.length]; for (int i = 0; i < result.length; i++) result[i] = VersionedId.parse(list[i]); return result; }
private Collection<IVersionedId> listElements(List<IVersionedId> elements, String suffix) { if (suffix == null || suffix.length() == 0) return elements; ArrayList<IVersionedId> result = new ArrayList<IVersionedId>(elements.size()); for (IVersionedId elementName : elements) { result.add(new VersionedId(elementName.getId() + suffix, elementName.getVersion())); } return result; }
private IVersionedId[] createVersionedIdList(String parameter) { String[] list = AbstractPublisherAction.getArrayFromString(parameter, ","); //$NON-NLS-1$ IVersionedId[] result = new IVersionedId[list.length]; for (int i = 0; i < result.length; i++) result[i] = VersionedId.parse(list[i]); return result; }
/** * Creates and returns a new {@link VersionedId} from the given string specification. * The specification must be of the form "id/version", or just "id" if the version is absent * <p> * This factory method can be used to reconstruct a {@link VersionedId} * instance from the string representation produced by a previous invocation of * {@link #toString()}. * * @param spec the specification for the versioned id to create * @return the parsed versioned id * @throws IllegalArgumentException If <code>spec</code> is improperly * formatted. */ public static IVersionedId parse(String spec) { String[] segments = StringHelper.getArrayFromString(spec, '/'); return new VersionedId(segments[0], segments.length == 1 ? null : segments[1]); }
private IVersionedId[] createVersionedIdList(String parameter) { String[] list = AbstractPublisherAction.getArrayFromString(parameter, ","); //$NON-NLS-1$ IVersionedId[] result = new IVersionedId[list.length]; for (int i = 0; i < result.length; i++) result[i] = VersionedId.parse(list[i]); return result; }
private Collection<IVersionedId> listElements(List<IVersionedId> elements, String suffix) { if (suffix == null || suffix.length() == 0) return elements; ArrayList<IVersionedId> result = new ArrayList<>(elements.size()); for (IVersionedId elementName : elements) { result.add(new VersionedId(elementName.getId() + suffix, elementName.getVersion())); } return result; }
protected Set<IVersionedId> getDescriptorIds(IMetadataRepository repository) { Set<IVersionedId> ids = new HashSet<IVersionedId>(); for(CatalogItem item : installableConnectors) { if(repository.getLocation().equals(URI.create(item.getSiteUrl()))) { for(String id : item.getInstallableUnits()) { ids.add(VersionedId.parse(id)); } } } return ids; }
/** * Returns a list<VersionedName> of fragments that constitute this product. */ public List<IVersionedId> getFragments() { List<IVersionedId> result = new LinkedList<IVersionedId>(); for (FeatureEntry fragment : fragments) { result.add(new VersionedId(fragment.getId(), fragment.getVersion())); } return result; }
/** * Returns a list<VersionedName> of fragments that constitute this product. */ public List<IVersionedId> getFragments() { List<IVersionedId> result = new LinkedList<IVersionedId>(); for (FeatureEntry fragment : fragments) { result.add(new VersionedId(fragment.getId(), fragment.getVersion())); } return result; }
/** * Returns a List<VersionedName> of features that constitute this product. */ public List<IVersionedId> getFeatures() { List<IVersionedId> result = new LinkedList<IVersionedId>(); for (FeatureEntry feature : features) { result.add(new VersionedId(feature.getId(), feature.getVersion())); } return result; }
/** * Returns a list<VersionedName> of fragments that constitute this product. */ @Override public List<IVersionedId> getFragments() { List<IVersionedId> result = new LinkedList<>(); for (FeatureEntry fragment : fragments) { result.add(new VersionedId(fragment.getId(), fragment.getVersion())); } return result; }
public List<IVersionedId> getFeatures(int options) { List<IVersionedId> result = new LinkedList<IVersionedId>(); if ((options & INCLUDED_FEATURES) != 0) { for (FeatureEntry feature : features) { result.add(new VersionedId(feature.getId(), feature.getVersion())); } } if ((options & ROOT_FEATURES) != 0) { for (FeatureEntry feature : rootFeatures) { result.add(new VersionedId(feature.getId(), feature.getVersion())); } } return result; }
@Override public List<IVersionedId> getFeatures(int options) { List<IVersionedId> result = new LinkedList<>(); if ((options & INCLUDED_FEATURES) != 0) { for (FeatureEntry feature : features) { result.add(new VersionedId(feature.getId(), feature.getVersion())); } } if ((options & ROOT_FEATURES) != 0) { for (FeatureEntry feature : rootFeatures) { result.add(new VersionedId(feature.getId(), feature.getVersion())); } } return result; }
private static void put(Map<VersionedId, IInstallableUnit> units, IInstallableUnit unit) { units.put(new VersionedId(unit.getId(), unit.getVersion()), unit); }
/** * Returns a List<VersionedName> for each bundle that makes up this product. * @param includeFragments Indicates whether or not fragments should * be included in the list */ public List<IVersionedId> getBundles(boolean includeFragments) { List<IVersionedId> result = new LinkedList<IVersionedId>(); for (FeatureEntry plugin : plugins) { result.add(new VersionedId(plugin.getId(), plugin.getVersion())); } if (includeFragments) { for (FeatureEntry fragment : fragments) { result.add(new VersionedId(fragment.getId(), fragment.getVersion())); } } return result; }
/** * Returns a List<VersionedName> for each bundle that makes up this product. * @param includeFragments Indicates whether or not fragments should * be included in the list */ public List<IVersionedId> getBundles(boolean includeFragments) { List<IVersionedId> result = new LinkedList<IVersionedId>(); for (FeatureEntry plugin : plugins) { result.add(new VersionedId(plugin.getId(), plugin.getVersion())); } if (includeFragments) { for (FeatureEntry fragment : fragments) { result.add(new VersionedId(fragment.getId(), fragment.getVersion())); } } return result; }
/** * Returns a List<VersionedName> for each bundle that makes up this product. * @param includeFragments Indicates whether or not fragments should * be included in the list */ @Override public List<IVersionedId> getBundles(boolean includeFragments) { List<IVersionedId> result = new LinkedList<>(); for (FeatureEntry plugin : plugins) { result.add(new VersionedId(plugin.getId(), plugin.getVersion())); } if (includeFragments) { for (FeatureEntry fragment : fragments) { result.add(new VersionedId(fragment.getId(), fragment.getVersion())); } } return result; }
private Collection<IVersionedId> versionElements(Collection<IVersionedId> elements, String namespace) { Collection<IVersionAdvice> versionAdvice = info.getAdvice(null, true, null, null, IVersionAdvice.class); List<IVersionedId> result = new ArrayList<IVersionedId>(); for (IVersionedId element : elements) { Version elementVersion = element.getVersion(); if (elementVersion == null || Version.emptyVersion.equals(elementVersion)) { Iterator<IVersionAdvice> advice = versionAdvice.iterator(); while (advice.hasNext()) { elementVersion = advice.next().getVersion(namespace, element.getId()); break; } } // if advisedVersion is null, we get the highest version IInstallableUnit unit = queryForIU(publisherResults, element.getId(), elementVersion); if (unit != null) { result.add(unit); } else if (elementVersion != null) { //best effort result.add(new VersionedId(element.getId(), elementVersion)); } //TODO we could still add a requirement on version 0.0.0 to get any version, but if the //bundle is platform specific we will have broken metadata due to a missing filter } return result; }
public InstallableUnitDAG toInstallableUnitDAG( Iterator<IInstallableUnit> iter ) { Map<IVersionedId, InstallableUnitInfo> nodes = new LinkedHashMap<IVersionedId, InstallableUnitInfo>(); while ( iter.hasNext() ) { IInstallableUnit iu = iter.next(); nodes.put( new VersionedId( iu.getId(), iu.getVersion() ), new InstallableUnitInfo( iu ) ); } for ( InstallableUnitInfo node : nodes.values() ) { for ( InstallableUnitInfo otherNode : getIncludedInstallableUnit( nodes, node.getInstallableUnit() ) ) { node.addChild( otherNode ); } } Map<IInstallableUnit, InstallableUnitInfo> units = new LinkedHashMap<IInstallableUnit, InstallableUnitInfo>(); for ( InstallableUnitInfo info : nodes.values() ) { units.put( info.getInstallableUnit(), info ); } // break cycles for ( InstallableUnitInfo unit : units.values() ) { breakCycles( unit, new LinkedList<InstallableUnitInfo>() ); } return new InstallableUnitDAG( units ); }