Interface IMetadataRepositoryManager
- All Superinterfaces:
IQueryable<IInstallableUnit>
,IRepositoryManager<IInstallableUnit>
IMetadataRepository
instances. See IRepositoryManager
for a
general description of the characteristics of repository managers.- Since:
- 2.0
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name used for obtaining a reference to the metadata repository manager servicestatic final String
Repository type for a composite repository based on a URL or local file system location.static final String
Repository type for a simple repository based on a URL or local file system location.Fields inherited from interface org.eclipse.equinox.p2.repository.IRepositoryManager
REPOSITORIES_ALL, REPOSITORIES_DISABLED, REPOSITORIES_LOCAL, REPOSITORIES_NON_LOCAL, REPOSITORIES_NON_SYSTEM, REPOSITORIES_SYSTEM, REPOSITORY_HINT_MODIFIABLE
-
Method Summary
Modifier and TypeMethodDescriptionCreates and returns a new empty metadata repository of the given type at the given location.loadRepository
(URI location, int flags, IProgressMonitor monitor) Loads the repository at the given location.loadRepository
(URI location, IProgressMonitor monitor) Loads the repository at the given location.refreshRepository
(URI location, IProgressMonitor monitor) Refreshes the repository corresponding to the given URL.Methods inherited from interface org.eclipse.equinox.p2.query.IQueryable
contains, query
Methods inherited from interface org.eclipse.equinox.p2.repository.IRepositoryManager
addRepository, contains, getAgent, getKnownRepositories, getRepositoryProperty, isEnabled, removeRepository, setEnabled, setRepositoryProperty
-
Field Details
-
SERVICE_NAME
The name used for obtaining a reference to the metadata repository manager service -
TYPE_SIMPLE_REPOSITORY
Repository type for a simple repository based on a URL or local file system location.- See Also:
-
TYPE_COMPOSITE_REPOSITORY
Repository type for a composite repository based on a URL or local file system location.- See Also:
-
-
Method Details
-
createRepository
IMetadataRepository createRepository(URI location, String name, String type, Map<String, String> properties) throws ProvisionException, OperationCanceledExceptionCreates and returns a new empty metadata repository of the given type at the given location.The resulting repository is added to the list of repositories tracked by the repository manager. Clients must make a subsequent call to
IRepositoryManager.removeRepository(URI)
if they do not want the repository manager to remember the repository for subsequent load attempts.- Specified by:
createRepository
in interfaceIRepositoryManager<IInstallableUnit>
- Parameters:
location
- the absolute location for the new repositoryname
- the name of the new repositorytype
- the kind of repository to createproperties
- the properties to set on the repository- Returns:
- the newly created repository
- Throws:
ProvisionException
- if the repository could not be created. Reasons include:- The repository type is unknown.
- There was an error writing to the given repository location.
- A repository already exists at that location.
OperationCanceledException
- if this operation has been canceled
-
loadRepository
IMetadataRepository loadRepository(URI location, IProgressMonitor monitor) throws ProvisionException, OperationCanceledException Loads the repository at the given location. If a repository has previously been loaded at that location, the same cached repository may be returned.The resulting repository is added to the list of repositories tracked by the repository manager. Clients must make a subsequent call to
IRepositoryManager.removeRepository(URI)
if they do not want the repository manager to remember the repository for subsequent load attempts.- Specified by:
loadRepository
in interfaceIRepositoryManager<IInstallableUnit>
- Parameters:
location
- the absolute location of the repository to loadmonitor
- a progress monitor, ornull
if progress reporting is not desired- Returns:
- the loaded metadata repository
- Throws:
OperationCanceledException
- if this operation has been canceledProvisionException
- if the repository could not be created. Reasons include:- There is no existing repository at that location.
- The repository at that location could not be read.
-
loadRepository
IMetadataRepository loadRepository(URI location, int flags, IProgressMonitor monitor) throws ProvisionException, OperationCanceledException Loads the repository at the given location. If a repository has previously been loaded at that location, the same cached repository may be returned.The resulting repository is added to the list of repositories tracked by the repository manager. Clients must make a subsequent call to
IRepositoryManager.removeRepository(URI)
if they do not want the repository manager to remember the repository for subsequent load attempts.The flags passed in should be taken as a hint for the type of repository to load. If the manager cannot load a repository that satisfies these hints, it can fail fast.
- Specified by:
loadRepository
in interfaceIRepositoryManager<IInstallableUnit>
- Parameters:
location
- the absolute location of the repository to loadflags
- bit-wise or of flags to consider when loading the repository (currently onlyIRepositoryManager.REPOSITORY_HINT_MODIFIABLE
is supported)monitor
- a progress monitor, ornull
if progress reporting is not desired- Returns:
- the loaded metadata repository
- Throws:
OperationCanceledException
- if this operation has been canceledProvisionException
- if the repository could not be created. Reasons include:- There is no existing repository at that location.
- The repository at that location could not be read.
- See Also:
-
refreshRepository
IMetadataRepository refreshRepository(URI location, IProgressMonitor monitor) throws ProvisionException, OperationCanceledException Refreshes the repository corresponding to the given URL. This method discards any cached state held by the repository manager and reloads the repository contents. The provided repository location must already be known to the repository manager.- Specified by:
refreshRepository
in interfaceIRepositoryManager<IInstallableUnit>
- Parameters:
location
- The absolute location of the repository to refreshmonitor
- a progress monitor, ornull
if progress reporting is not desired- Returns:
- The refreshed metadata repository
- Throws:
OperationCanceledException
- if this operation has been canceledProvisionException
- if the repository could not be refreshed. Reasons include:- The location is not known to the repository manager.
- There is no existing repository at that location.
- The repository at that location could not be read.
-