Interface IRepository<T>
- Type Parameters:
T
- The type of contents contained in this repository
- All Superinterfaces:
IAdaptable
,IQueryable<T>
- All Known Subinterfaces:
IArtifactRepository
,ICompositeRepository<T>
,IFileArtifactRepository
,IMetadataRepository
- All Known Implementing Classes:
AbstractArtifactRepository
,AbstractMetadataRepository
,AbstractRepository
A p2 repository contains either metadata or artifacts related to software
provisioning. This base interface defines properties common to all types
of repositories.
- Since:
- 2.0
- Restriction:
- This interface is not intended to be implemented by clients. Instead the abstract classes implementing this interface should be used.
- Restriction:
- This interface is not intended to be extended by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
An option flag constant (value 1) indicating an enabled repository.static final int
General purpose zero-valued bit mask constant.static final String
The node identifier for repository secure preference store.static final String
The key for a boolean property indicating that repository metadata is stored in compressed form.static final String
The key for a string property providing a human-readable description for the repository.static final String
The key for a string property providing the common base URL that should be replaced with the mirror URL.static final String
The key for a string property providing a URL that can return mirrors of this repository.static final String
The key for a string property providing a human-readable name for the repository.static final String
The key for a string property providing a user-defined name for the repository.static final String
The key for a string property providing the password to an authenticated URL.static final String
The key for a boolean property indicating that the repository is a system repository.static final String
The key for a string property containing the time when the repository was last modified.static final String
The key for a string property providing the user name to an authenticated URL.static final int
A repository type constant (value 1) representing an artifact repository.static final int
A repository type constant (value 0) representing a metadata repository. -
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Returns true if this repository contains the given element.Returns a brief description of the repository.Returns the location of this repository.getName()
Returns the name of the repository.Returns a read-only collection of the properties of the repository.getProperty
(String key) Returns the repository property with the given key, ornull
if no such property is definedReturns the name of the provider of the repository.Returns the provisioning agent that manages this repositorygetType()
Returns a string representing the type of the repository.Returns a string representing the version for the repository type.boolean
Returnstrue
if this repository can be modified, andfalse
otherwise.setProperty
(String key, String value) Sets the value of the property with the given key.setProperty
(String key, String value, IProgressMonitor monitor) Sets the value of the property with the given key.Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
Methods inherited from interface org.eclipse.equinox.p2.query.IQueryable
query
-
Field Details
-
PROP_SYSTEM
The key for a boolean property indicating that the repository is a system repository. System repositories are implementation details that are not subject to general access, hidden from the typical user, etc. This property is never stored in the repository itself, but is instead tracked and managed by anIRepositoryManager
. -
PROP_COMPRESSED
The key for a boolean property indicating that repository metadata is stored in compressed form. A compressed repository will have lower bandwidth cost to read when remote, but higher processing cost to uncompress when reading.- See Also:
-
PROP_NAME
The key for a string property providing a human-readable name for the repository. -
PROP_NICKNAME
The key for a string property providing a user-defined name for the repository. This property is never stored in the repository itself, but is instead tracked and managed by anIRepositoryManager
. -
PROP_DESCRIPTION
The key for a string property providing a human-readable description for the repository. -
PROP_MIRRORS_BASE_URL
The key for a string property providing the common base URL that should be replaced with the mirror URL.- See Also:
-
PROP_MIRRORS_URL
The key for a string property providing a URL that can return mirrors of this repository.- See Also:
-
PROP_TIMESTAMP
The key for a string property containing the time when the repository was last modified.- See Also:
-
PROP_USERNAME
The key for a string property providing the user name to an authenticated URL. This key is used in the secure preference store for repository data.- See Also:
-
PROP_PASSWORD
The key for a string property providing the password to an authenticated URL. This key is used in the secure preference store for repository data.- See Also:
-
PREFERENCE_NODE
The node identifier for repository secure preference store.- See Also:
-
TYPE_METADATA
static final int TYPE_METADATAA repository type constant (value 0) representing a metadata repository.- See Also:
-
TYPE_ARTIFACT
static final int TYPE_ARTIFACTA repository type constant (value 1) representing an artifact repository.- See Also:
-
NONE
static final int NONEGeneral purpose zero-valued bit mask constant. Useful whenever you need to supply a bit mask with no bits set.- See Also:
-
ENABLED
static final int ENABLEDAn option flag constant (value 1) indicating an enabled repository.- See Also:
-
-
Method Details
-
getLocation
URI getLocation()Returns the location of this repository.- Returns:
- the URI representing the repository location.
-
getName
String getName()Returns the name of the repository.- Returns:
- the name of the repository.
-
getType
String getType()Returns a string representing the type of the repository. Note this method does not indicate the type of repository contents (metadata or artifacts), but instead the unique fully qualified id representing the repository implementation.- Returns:
- the type of the repository.
-
getVersion
String getVersion()Returns a string representing the version for the repository type.- Returns:
- the version of the type of the repository.
-
getDescription
String getDescription()Returns a brief description of the repository.- Returns:
- the description of the repository.
-
getProvider
String getProvider()Returns the name of the provider of the repository.- Returns:
- the provider of this repository.
-
getProperties
Returns a read-only collection of the properties of the repository.- Returns:
- the properties of this repository.
-
getProperty
Returns the repository property with the given key, ornull
if no such property is defined- Parameters:
key
- the property key- Returns:
- the property value, or
null
-
getProvisioningAgent
IProvisioningAgent getProvisioningAgent()Returns the provisioning agent that manages this repository- Returns:
- A provisioning agent.
-
isModifiable
boolean isModifiable()Returnstrue
if this repository can be modified, andfalse
otherwise. Attempts to change the contents of an unmodifiable repository will fail.- Returns:
- whether or not this repository can be modified
-
setProperty
Sets the value of the property with the given key. Returns the old property associated with that key, if any. Setting a value ofnull
will remove the corresponding key from the properties of this repository.- Parameters:
key
- The property keyvalue
- The new property value, ornull
to remove the key- Returns:
- The old property value, or
null
if there was no old value
-
setProperty
Sets the value of the property with the given key. Returns the old property associated with that key, if any. Setting a value ofnull
will remove the corresponding key from the properties of this repository.- Parameters:
key
- The property keyvalue
- The new property value, ornull
to remove the keymonitor
- A progress monitor use to track progress and cancel the operation. This may be a long running operation if another process holds the lock on this location- Returns:
- The old property value, or
null
if there was no old value - Since:
- 2.1
-
contains
Returns true if this repository contains the given element.- Specified by:
contains
in interfaceIQueryable<T>
- Parameters:
element
- the element to query- Returns:
- true if the given element is already in this repository
- Since:
- 2.8
-