public abstract class ArtifactRepositoryBaseImpl<ArtifactDescriptorT extends org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor> extends AbstractArtifactRepository2 implements org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository, IArtifactFileProvider
getArtifactFile(IArtifactDescriptor)
, andgetInternalDescriptorForAdding(IArtifactDescriptor)
,
getComparableDescriptor(IArtifactDescriptor)
Modifier and Type | Field and Description |
---|---|
protected Set<ArtifactDescriptorT> |
descriptors |
protected Map<org.eclipse.equinox.p2.metadata.IArtifactKey,Set<ArtifactDescriptorT>> |
descriptorsMap |
Modifier | Constructor and Description |
---|---|
protected |
ArtifactRepositoryBaseImpl(org.eclipse.equinox.p2.core.IProvisioningAgent agent,
URI location,
ArtifactTransferPolicy transferPolicy) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor) |
boolean |
contains(org.eclipse.equinox.p2.metadata.IArtifactKey key)
Returns
true if this is a provider for the given artifact. |
org.eclipse.equinox.p2.query.IQueryable<org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor> |
descriptorQueryable() |
org.eclipse.core.runtime.IStatus |
getArtifact(org.eclipse.equinox.p2.metadata.IArtifactKey key,
OutputStream destination,
org.eclipse.core.runtime.IProgressMonitor monitor)
Writes the artifact to the given output stream.
|
org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] |
getArtifactDescriptors(org.eclipse.equinox.p2.metadata.IArtifactKey key) |
File |
getArtifactFile(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor) |
File |
getArtifactFile(org.eclipse.equinox.p2.metadata.IArtifactKey key)
Returns the local file system location of the given artifact.
|
protected abstract org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor |
getComparableDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Returns an
IArtifactDescriptor instance which is comparable to the artifact
descriptors stored in the index (i.e. |
protected abstract ArtifactDescriptorT |
getInternalDescriptorForAdding(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Returns an artifact descriptor of the internal descriptor type
ArtifactDescriptorT which may be added to the index. |
OutputStream |
getOutputStream(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor) |
org.eclipse.core.runtime.IStatus |
getRawArtifact(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor,
OutputStream destination,
org.eclipse.core.runtime.IProgressMonitor monitor) |
protected void |
internalAddDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor) |
protected void |
internalAddInternalDescriptor(ArtifactDescriptorT internalDescriptor) |
protected abstract File |
internalGetArtifactStorageLocation(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
Returns the file system location where the given artifact is or would be stored.
|
protected void |
internalRemoveAllDescriptors() |
protected void |
internalRemoveDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor) |
protected void |
internalRemoveDescriptors(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors) |
protected void |
internalRemoveDescriptors(org.eclipse.equinox.p2.metadata.IArtifactKey key) |
protected void |
internalRemoveDescriptors(org.eclipse.equinox.p2.metadata.IArtifactKey[] keys) |
protected void |
internalStore(org.eclipse.core.runtime.IProgressMonitor monitor)
Persists the index of this repository.
|
org.eclipse.equinox.p2.query.IQueryResult<org.eclipse.equinox.p2.metadata.IArtifactKey> |
query(org.eclipse.equinox.p2.query.IQuery<org.eclipse.equinox.p2.metadata.IArtifactKey> query,
org.eclipse.core.runtime.IProgressMonitor monitor) |
addDescriptor, addDescriptor, addDescriptors, addDescriptors, getArtifact, getArtifacts, removeAll, removeAll, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptors, removeDescriptors, removeDescriptors, removeDescriptors
createArtifactDescriptor, createArtifactKey, equals, executeBatch, hashCode
assertModifiable, getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, setDescription, setLocation, setName, setProperties, setProperty, setProperty, setProvider, setType, setVersion
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addDescriptor, addDescriptor, addDescriptors, addDescriptors, createArtifactDescriptor, createArtifactKey, executeBatch, getArtifact, getArtifacts, removeAll, removeAll, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptors, removeDescriptors, removeDescriptors, removeDescriptors
protected Set<ArtifactDescriptorT extends org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor> descriptors
protected Map<org.eclipse.equinox.p2.metadata.IArtifactKey,Set<ArtifactDescriptorT extends org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor>> descriptorsMap
protected ArtifactRepositoryBaseImpl(org.eclipse.equinox.p2.core.IProvisioningAgent agent, URI location, ArtifactTransferPolicy transferPolicy)
protected abstract org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor getComparableDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
IArtifactDescriptor
instance which is comparable to the artifact
descriptors stored in the index (i.e. the descriptors
member). A valid
implementation is to convert the argument to the internal descriptor type
ArtifactDescriptorT
, but this is not a requirement. This method should be
implemented in a way so that calling
descriptors.contains(getComparableDescriptor(foreignDescriptor))
with a
descriptor from a foreign artifact repository returns true
if and only if
copying that foreign artifact to this repository with
getOutputStream(IArtifactDescriptor)
would not add a new artifact to this
repository.
This method may be called by any API method with an IArtifactDescriptor
argument.
descriptor
- An IArtifactDescriptor
from any artifact repository.public final boolean contains(org.eclipse.equinox.p2.metadata.IArtifactKey key)
IArtifactProvider
true
if this is a provider for the given artifact.contains
in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
contains
in interface IArtifactProvider
contains
in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
key
- an artifact keytrue
if this instance can provide the artifact for the given keypublic final boolean contains(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
contains
in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
contains
in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
public final org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] getArtifactDescriptors(org.eclipse.equinox.p2.metadata.IArtifactKey key)
getArtifactDescriptors
in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
getArtifactDescriptors
in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
public final org.eclipse.equinox.p2.query.IQueryResult<org.eclipse.equinox.p2.metadata.IArtifactKey> query(org.eclipse.equinox.p2.query.IQuery<org.eclipse.equinox.p2.metadata.IArtifactKey> query, org.eclipse.core.runtime.IProgressMonitor monitor)
query
in interface org.eclipse.equinox.p2.query.IQueryable<org.eclipse.equinox.p2.metadata.IArtifactKey>
public final org.eclipse.equinox.p2.query.IQueryable<org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor> descriptorQueryable()
descriptorQueryable
in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
protected abstract ArtifactDescriptorT getInternalDescriptorForAdding(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor) throws IllegalArgumentException
ArtifactDescriptorT
which may be added to the index. Implementations may require
that the descriptor argument is a descriptor instance created by this repository – see
AbstractArtifactRepository.createArtifactDescriptor(IArtifactKey)
.
This method is called for adding entries to the index, i.e. from
getOutputStream(IArtifactDescriptor)
(and the deprecated addDescriptor
methods).
descriptor
- An IArtifactDescriptor
instanceIllegalArgumentException
- if the provided descriptor cannot be addedprotected final void internalAddDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
internalAddDescriptor
in class AbstractArtifactRepository2
protected final void internalAddInternalDescriptor(ArtifactDescriptorT internalDescriptor)
protected final void internalRemoveDescriptor(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
internalRemoveDescriptor
in class AbstractArtifactRepository2
protected final void internalRemoveDescriptors(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors)
internalRemoveDescriptors
in class AbstractArtifactRepository2
protected final void internalRemoveDescriptors(org.eclipse.equinox.p2.metadata.IArtifactKey key)
internalRemoveDescriptors
in class AbstractArtifactRepository2
protected final void internalRemoveDescriptors(org.eclipse.equinox.p2.metadata.IArtifactKey[] keys)
internalRemoveDescriptors
in class AbstractArtifactRepository2
protected final void internalRemoveAllDescriptors()
internalRemoveAllDescriptors
in class AbstractArtifactRepository2
protected void internalStore(org.eclipse.core.runtime.IProgressMonitor monitor)
This method is called after every (bulk) change to the index.
internalStore
in class AbstractArtifactRepository2
protected abstract File internalGetArtifactStorageLocation(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
getArtifactFile(IArtifactDescriptor)
, this method does not check if the given
artifact exists in the repository and never returns null
.
This method may be called by any API method for reading or writing artifacts.
public final File getArtifactFile(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
getArtifactFile
in interface org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository
public final File getArtifactFile(org.eclipse.equinox.p2.metadata.IArtifactKey key)
IArtifactFileProvider
getArtifactFile
in interface org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository
getArtifactFile
in interface IArtifactFileProvider
key
- an artifact keynull
the given artifact does
not exist.public final org.eclipse.core.runtime.IStatus getArtifact(org.eclipse.equinox.p2.metadata.IArtifactKey key, OutputStream destination, org.eclipse.core.runtime.IProgressMonitor monitor)
IArtifactProvider
getArtifact
in interface IArtifactProvider
key
- the key of the artifact to transferdestination
- the stream to write the artifact tomonitor
- a progress monitor, or null
public final org.eclipse.core.runtime.IStatus getRawArtifact(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor, OutputStream destination, org.eclipse.core.runtime.IProgressMonitor monitor)
getRawArtifact
in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
public final OutputStream getOutputStream(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor) throws org.eclipse.equinox.p2.core.ProvisionException
getOutputStream
in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
getOutputStream
in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
org.eclipse.equinox.p2.core.ProvisionException
Copyright © 2008–2014 Eclipse Foundation. All rights reserved.