public Iterator<IInstallableUnit> everything() { return units.iterator(); } }
public IInstallableUnit getIU(String id, Version version, String type) { if (type == null || type == ROOT) { IInstallableUnit result = rootIUs.get(id, version); if (result != null) return result; } if (type == null || type == NON_ROOT) { IInstallableUnit result = nonRootIUs.get(id, version); if (result != null) return result; } return null; }
private IQueryResult<IInstallableUnit> internalGet(String id, Version version) { if (id == null) { IQuery<IInstallableUnit> query = version == null ? QueryUtil.createIUAnyQuery() : QueryUtil.createIUQuery(null, version); return query.perform(iterator()); } Collection<IInstallableUnit> idUnits = getUnits(id); if (idUnits.isEmpty()) return Collector.emptyCollector(); return version == null ? new CollectionResult<IInstallableUnit>(idUnits) : QueryUtil.createIUQuery(id, version).perform(idUnits.iterator()); }
@Override public synchronized void addInstallableUnits(Collection<IInstallableUnit> installableUnits) { if (installableUnits == null || installableUnits.isEmpty()) return; if (snapshotNeeded) { units = units.clone(); idIndex = null; // Backed by units snapshotNeeded = false; } units.addAll(installableUnits); capabilityIndex = null; // Generated, not backed by units save(); }
@Override public synchronized boolean removeInstallableUnits(Collection<IInstallableUnit> installableUnits) { boolean changed = false; if (installableUnits != null && !installableUnits.isEmpty()) { changed = true; if (snapshotNeeded) { units = units.clone(); idIndex = null; // Backed by units snapshotNeeded = false; } units.removeAll(installableUnits); capabilityIndex = null; // Generated, not backed by units. } if (changed) save(); return changed; }
@Override public void initialize(RepositoryState state) { synchronized (this) { setName(state.Name); setType(state.Type); setVersion(state.Version.toString()); setProvider(state.Provider); setDescription(state.Description); setLocation(state.Location); setProperties(state.Properties); this.units.addAll(state.Units); this.repositories.addAll(Arrays.asList(state.Repositories)); } publishRepositoryReferences(); }
public void clearInstallableUnits() { ius.clear(); iuProperties.clear(); changed = true; }
@Override public IUMap clone() { return new IUMap(this); }
public void compress(IPool<IInstallableUnit> iuPool) { units.compress(iuPool); } }
public IInstallableUnit getIU(String id, Version version, String type) { if (type == null || type == ROOT) { IInstallableUnit result = rootIUs.get(id, version); if (result != null) return result; } if (type == null || type == NON_ROOT) { IInstallableUnit result = nonRootIUs.get(id, version); if (result != null) return result; } return null; }
@Override public synchronized void addInstallableUnits(Collection<IInstallableUnit> installableUnits) { if (installableUnits == null || installableUnits.isEmpty()) return; if (snapshotNeeded) { units = units.clone(); idIndex = null; // Backed by units snapshotNeeded = false; } units.addAll(installableUnits); capabilityIndex = null; // Generated, not backed by units save(); }
@Override public synchronized boolean removeInstallableUnits(Collection<IInstallableUnit> installableUnits) { boolean changed = false; if (installableUnits != null && !installableUnits.isEmpty()) { changed = true; if (snapshotNeeded) { units = units.clone(); idIndex = null; // Backed by units snapshotNeeded = false; } units.removeAll(installableUnits); capabilityIndex = null; // Generated, not backed by units. } if (changed) save(); return changed; }
@Override public void initialize(RepositoryState state) { synchronized (this) { setName(state.Name); setType(state.Type); setVersion(state.Version.toString()); setProvider(state.Provider); setDescription(state.Description); setLocation(state.Location); setProperties(state.Properties); this.units.addAll(state.Units); this.repositories.addAll(Arrays.asList(state.Repositories)); } publishRepositoryReferences(); }
public void clearInstallableUnits() { ius.clear(); iuProperties.clear(); changed = true; }
public void compress(IPool<IInstallableUnit> iuPool) { units.compress(iuPool); } }