Class MetadataRepositoryFactory
org.eclipse.equinox.p2.metadata.repository.metadataRepositories extension point.- Since:
- 2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract IMetadataRepositoryCreates and returns a new empty metadata repository of the given type at the given location.protected IProvisioningAgentgetAgent()Returns the provisioning agent associated with this factory, ornullif this factory is not associated with an agent.abstract IMetadataRepositoryload(URI location, int flags, IProgressMonitor monitor) Loads a repository corresponding to the given URL.voidsetAgent(IProvisioningAgent agent) Sets the provisioning agent associated with this repository factory.
-
Constructor Details
-
MetadataRepositoryFactory
public MetadataRepositoryFactory()
-
-
Method Details
-
create
public abstract IMetadataRepository create(URI location, String name, String type, Map<String, String> properties) throws ProvisionExceptionCreates and returns a new empty metadata repository of the given type at the given location.- Parameters:
location- the 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 not supported by this factory.
- There was an error writing to the given repository location.
-
getAgent
Returns the provisioning agent associated with this factory, ornullif this factory is not associated with an agent.- Returns:
- The provisioning agent, or
null
-
load
public abstract IMetadataRepository load(URI location, int flags, IProgressMonitor monitor) throws ProvisionException Loads a repository corresponding to the given URL.The error code returned in the case of failure is significant. In particular an error code of
ProvisionException.REPOSITORY_FAILED_READindicates that the location definitely identifies a repository of this type, but an error occurred while loading the repository. The repository manager will not attempt to load a repository from that location using any other factory. An error code ofProvisionException.REPOSITORY_NOT_FOUNDindicates there is no repository of this type at the given location, and the repository manager is free to try again with a different repository factory.The flags passed in should be taken as a hint for the type of repository to load. If the factory knows it will not load a repository that satisfies these hints, it can fail fast and return null.
SeeIRepositoryManager.REPOSITORY_HINT_MODIFIABLE- Parameters:
location- The location of the repository to loadflags- to consider while loading the repositorymonitor- a progress monitor, ornullif progress reporting is not desired- Returns:
- The loaded metadata repository
- Throws:
ProvisionException- 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.
-
setAgent
Sets the provisioning agent associated with this repository factory.- Parameters:
agent- The provisioning agent
-