public abstract class AbstractMetadataRepository extends AbstractRepository<IInstallableUnit> implements IMetadataRepository
Clients may subclass this class.
Modifier and Type | Class and Description |
---|---|
static class |
AbstractMetadataRepository.RepositoryState
A class that encapsulates the persisted state of a repository.
|
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
Modifier | Constructor and Description |
---|---|
|
AbstractMetadataRepository(IProvisioningAgent agent)
Creates a new metadata repository that uses the provided agent.
|
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
|
Modifier and Type | Method and Description |
---|---|
void |
addInstallableUnits(Collection<IInstallableUnit> installableUnits)
Add the given installable units to this repository.
|
void |
addReferences(Collection<? extends IRepositoryReference> references)
Adds references to another repository to this repository.
|
void |
compress(IPool<IInstallableUnit> iuPool)
Cause semantically equivalent IInstallableUnits in the receiver to be
replaced with a shared object from the provided
IPool . |
IStatus |
executeBatch(IRunnableWithProgress runnable,
IProgressMonitor monitor)
Executes a runnable against this repository.
|
abstract void |
initialize(AbstractMetadataRepository.RepositoryState state)
Initializes this class based on the provided previously persisted state
|
void |
removeAll()
Remove all installable units from this repository.
|
boolean |
removeInstallableUnits(Collection<IInstallableUnit> installableUnits)
Removes all installable units in the given collection from this repository.
|
assertModifiable, getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, setDescription, setLocation, setName, setProperties, setProperty, setProperty, setProvider, setType, setVersion
getAdapter
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getReferences
getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, setProperty, setProperty
getAdapter
query
public AbstractMetadataRepository(IProvisioningAgent agent)
agent
- the provisioning agent to be used by this repositoryprotected AbstractMetadataRepository(IProvisioningAgent agent, String name, String type, String version, URI location, String description, String provider, Map<String,String> properties)
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 propertiespublic abstract void initialize(AbstractMetadataRepository.RepositoryState state)
state
- the persisted repository statepublic void addInstallableUnits(Collection<IInstallableUnit> installableUnits)
addInstallableUnits
in interface IMetadataRepository
installableUnits
- the installable units to addpublic void addReferences(Collection<? extends IRepositoryReference> references)
Adds 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.
addReferences
in interface IMetadataRepository
references
- The references to addpublic void removeAll()
removeAll
in interface IMetadataRepository
public boolean removeInstallableUnits(Collection<IInstallableUnit> installableUnits)
removeInstallableUnits
in interface IMetadataRepository
installableUnits
- the installable units to removetrue
if any units were actually removed, and
false
otherwisepublic IStatus executeBatch(IRunnableWithProgress runnable, IProgressMonitor monitor)
executeBatch
in interface IMetadataRepository
runnable
- The runnable to executemonitor
- A progress monitor that will be passed to the runnablepublic void compress(IPool<IInstallableUnit> iuPool)
IMetadataRepository
IPool
. New objects are
added to the IPool
as required.
While the IPool
should be retained to increase the scope of sharing when
calling IMetadataRepository.compress(IPool)
on subsequent repositories, the IPool
can
be discarded without adversely effecting the receiver.
compress
in interface IMetadataRepository
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.