Class AbstractMetadataRepository
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.equinox.p2.repository.spi.AbstractRepository<IInstallableUnit>
org.eclipse.equinox.p2.repository.metadata.spi.AbstractMetadataRepository
- All Implemented Interfaces:
IAdaptable,IQueryable<IInstallableUnit>,IRepository<IInstallableUnit>,IMetadataRepository
public abstract class AbstractMetadataRepository
extends AbstractRepository<IInstallableUnit>
implements IMetadataRepository
The common base class for all metadata repositories.
Clients may subclass this class.
- Since:
- 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA class that encapsulates the persisted state of a repository. -
Field Summary
Fields inherited from interface org.eclipse.equinox.p2.repository.IRepository
ENABLED, NONE, PREFERENCE_NODE, PROP_COMPRESSED, PROP_DESCRIPTION, PROP_MIRRORS_BASE_URL, PROP_MIRRORS_URL, PROP_NAME, PROP_NICKNAME, PROP_PASSWORD, PROP_SYSTEM, PROP_TIMESTAMP, PROP_USERNAME, TYPE_ARTIFACT, TYPE_METADATA -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a new metadata repository that uses the provided agent.protectedAbstractMetadataRepository(IProvisioningAgent agent, String name, String type, String version, URI location, String description, String provider, Map<String, String> properties) Creates a new metadata repository with the provided repository information -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInstallableUnits(Collection<IInstallableUnit> installableUnits) Add the given installable units to this repository.voidaddReferences(Collection<? extends IRepositoryReference> references) Adds references to another repository to this repository.voidcompress(IPool<IInstallableUnit> iuPool) Cause semantically equivalent IInstallableUnits in the receiver to be replaced with a shared object from the providedIPool.executeBatch(IRunnableWithProgress runnable, IProgressMonitor monitor) Executes a runnable against this repository.abstract voidInitializes this class based on the provided previously persisted statevoidRemove all installable units from this repository.booleanremoveInstallableUnits(Collection<IInstallableUnit> installableUnits) Removes all installable units in the given collection from this repository.booleanremoveReferences(Collection<? extends IRepositoryReference> references) Removes from this repository the given references to other repositories.Methods inherited from class org.eclipse.equinox.p2.repository.spi.AbstractRepository
assertModifiable, getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, setDescription, setLocation, setName, setProperties, setProperty, setProperty, setProvider, setType, setVersion, toStringMethods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapterMethods inherited from interface org.eclipse.equinox.p2.repository.metadata.IMetadataRepository
getReferencesMethods inherited from interface org.eclipse.equinox.p2.query.IQueryable
queryMethods inherited from interface org.eclipse.equinox.p2.repository.IRepository
contains, getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, setProperty, setProperty
-
Constructor Details
-
AbstractMetadataRepository
Creates a new metadata repository that uses the provided agent.- Parameters:
agent- the provisioning agent to be used by this repository
-
AbstractMetadataRepository
protected AbstractMetadataRepository(IProvisioningAgent agent, String name, String type, String version, URI location, String description, String provider, Map<String, String> properties) Creates a new metadata repository with the provided repository information- Parameters:
agent- the provisioning agent to be used by this repositoryname- the repository nametype- the repository typeversion- the repository versionlocation- the repository locationdescription- the repository descriptionprovider- the repository providerproperties- the repository properties
-
-
Method Details
-
initialize
Initializes this class based on the provided previously persisted state- Parameters:
state- the persisted repository state
-
addInstallableUnits
Description copied from interface:IMetadataRepositoryAdd the given installable units to this repository.- Specified by:
addInstallableUnitsin interfaceIMetadataRepository- Parameters:
installableUnits- the installable units to add
-
addReferences
Description copied from interface:IMetadataRepositoryAdds references to another repository to this repository. When a repository is loaded by
IMetadataRepositoryManager, its references are automatically added to the repository manager's set of known repositories.Note that this method does not add the contents of the given repositories to this repository, but merely adds the location of other repositories to the metadata of this repository.
- Specified by:
addReferencesin interfaceIMetadataRepository- Parameters:
references- The references to add
-
removeReferences
Description copied from interface:IMetadataRepositoryRemoves from this repository the given references to other repositories.- Specified by:
removeReferencesin interfaceIMetadataRepository
-
removeAll
public void removeAll()Description copied from interface:IMetadataRepositoryRemove all installable units from this repository.- Specified by:
removeAllin interfaceIMetadataRepository
-
removeInstallableUnits
Description copied from interface:IMetadataRepositoryRemoves all installable units in the given collection from this repository.- Specified by:
removeInstallableUnitsin interfaceIMetadataRepository- Parameters:
installableUnits- the installable units to remove- Returns:
trueif any units were actually removed, andfalseotherwise
-
executeBatch
Description copied from interface:IMetadataRepositoryExecutes a runnable against this repository. It is up to the repository implementor to determine what "batch process" means, for example, it may mean that the repository index is not stored until after the runnable completes. The runnable should not execute anything in a separate thread.- Specified by:
executeBatchin interfaceIMetadataRepository- Parameters:
runnable- The runnable to executemonitor- A progress monitor that will be passed to the runnable- Returns:
- The result of running the runnable. Any exceptions thrown during the execution will be returned in the status.
-
compress
Description copied from interface:IMetadataRepositoryCause semantically equivalent IInstallableUnits in the receiver to be replaced with a shared object from the providedIPool. New objects are added to theIPoolas required.While the
IPoolshould be retained to increase the scope of sharing when callingIMetadataRepository.compress(IPool)on subsequent repositories, theIPoolcan be discarded without adversely effecting the receiver.- Specified by:
compressin interfaceIMetadataRepository- Since:
- 2.1
-