Class ProviderOnlyArtifactRepository

  • All Implemented Interfaces:
    org.eclipse.core.runtime.IAdaptable, org.eclipse.equinox.p2.query.IQueryable<org.eclipse.equinox.p2.metadata.IArtifactKey>, org.eclipse.equinox.p2.repository.artifact.IArtifactRepository, org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository, org.eclipse.equinox.p2.repository.IRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>, IArtifactFileProvider, IArtifactProvider, IRawArtifactFileProvider, IRawArtifactProvider

    public class ProviderOnlyArtifactRepository
    extends AbstractArtifactRepository2
    implements org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository, IRawArtifactFileProvider
    Read-only repository which delegates artifact read operations to a provider instance. Adapter from IRawArtifactFileProvider to IFileArtifactRepository.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private IRawArtifactFileProvider delegate  
      • Fields inherited from interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository

        CODE_RETRY, PROP_RUNNABLE
      • Fields inherited from interface org.eclipse.equinox.p2.repository.IRepository

        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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(org.eclipse.equinox.p2.metadata.IArtifactKey key)
      Returns true if this is a provider for the given artifact.
      boolean contains​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
      Returns true if this a provider for an artifact in the given format
      org.eclipse.equinox.p2.query.IQueryable<org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor> descriptorQueryable()  
      org.eclipse.core.runtime.IStatus getArtifact​(IArtifactSink sink, org.eclipse.core.runtime.IProgressMonitor monitor)
      Writes the requested artifact to the given IArtifactSink.
      org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] getArtifactDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey key)
      Return the raw artifact formats in which the given artifact can be provided.
      java.io.File getArtifactFile​(org.eclipse.equinox.p2.metadata.IArtifactKey key)
      Returns the file system location of the given artifact.
      java.io.File getArtifactFile​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
      Returns the file system location of the given artifact in the given format.
      org.eclipse.core.runtime.IStatus getRawArtifact​(IRawArtifactSink sink, org.eclipse.core.runtime.IProgressMonitor monitor)
      Writes the requested artifact in the specified raw format to the given IRawArtifactSink.
      protected void internalAddDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)  
      protected void internalRemoveAllDescriptors()  
      protected void internalRemoveDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)  
      protected void internalRemoveDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey key)  
      protected void internalRemoveDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey[] keys)  
      protected void internalRemoveDescriptors​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors)  
      protected void internalStore​(org.eclipse.core.runtime.IProgressMonitor monitor)  
      boolean isModifiable()  
      IArtifactSink newAddingArtifactSink​(org.eclipse.equinox.p2.metadata.IArtifactKey key)
      Returns a new IArtifactSink instance that adds the received artifact to this repository on IArtifactSink.commitWrite().
      IRawArtifactSink newAddingRawArtifactSink​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
      Returns a new IRawArtifactSink instance that adds the received artifact to this repository on IArtifactSink.commitWrite().
      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)  
      • Methods inherited from class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository

        createArtifactDescriptor, createArtifactKey, equals, executeBatch, hashCode
      • Methods inherited from class org.eclipse.equinox.p2.repository.spi.AbstractRepository

        assertModifiable, getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, setDescription, setLocation, setName, setProperties, setProperty, setProperty, setProvider, setType, setVersion
      • Methods inherited from class org.eclipse.core.runtime.PlatformObject

        getAdapter
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.eclipse.core.runtime.IAdaptable

        getAdapter
      • Methods inherited from interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository

        addDescriptor, addDescriptor, addDescriptors, addDescriptors, createArtifactDescriptor, createArtifactKey, executeBatch, getArtifact, getArtifacts, getOutputStream, getRawArtifact, removeAll, removeAll, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptor, removeDescriptors, removeDescriptors, removeDescriptors, removeDescriptors
      • Methods inherited from interface org.eclipse.equinox.p2.repository.IRepository

        getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, setProperty, setProperty
    • Constructor Detail

      • ProviderOnlyArtifactRepository

        public ProviderOnlyArtifactRepository​(IRawArtifactFileProvider delegate,
                                              org.eclipse.equinox.p2.core.IProvisioningAgent agent,
                                              java.net.URI location)
    • Method Detail

      • contains

        public boolean contains​(org.eclipse.equinox.p2.metadata.IArtifactKey key)
        Description copied from interface: IArtifactProvider
        Returns true if this is a provider for the given artifact.
        Specified by:
        contains in interface IArtifactProvider
        Specified by:
        contains in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Specified by:
        contains in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
        Parameters:
        key - An artifact key
        Returns:
        true if this instance can provide the artifact for the given key
      • query

        public 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)
        Specified by:
        query in interface org.eclipse.equinox.p2.query.IQueryable<org.eclipse.equinox.p2.metadata.IArtifactKey>
      • getArtifactFile

        public java.io.File getArtifactFile​(org.eclipse.equinox.p2.metadata.IArtifactKey key)
        Description copied from interface: IArtifactFileProvider
        Returns the file system location of the given artifact.
        Specified by:
        getArtifactFile in interface IArtifactFileProvider
        Specified by:
        getArtifactFile in interface org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository
        Parameters:
        key - An artifact key
        Returns:
        The location of the specified artifact, or null the given artifact does not exist.
      • getArtifact

        public org.eclipse.core.runtime.IStatus getArtifact​(IArtifactSink sink,
                                                            org.eclipse.core.runtime.IProgressMonitor monitor)
                                                     throws ArtifactSinkException
        Description copied from interface: IArtifactProvider
        Writes the requested artifact to the given IArtifactSink.

        The implementation is free to pick the most suitable internal storage format to serve the request, e.g. it may extract the artifact from a pack200-compressed format. If an error is detected while streaming the artifact (e.g. an MD5 checksum error), the implementation may re-attempt the read from all other available sources. In case there were multiple read attempts, a multi-status with the results of all attempts is returned.

        Specified by:
        getArtifact in interface IArtifactProvider
        Parameters:
        sink - A sink for a specific artifact. When this method returns, the sink will either be closed (with IArtifactSink.commitWrite() or IArtifactSink.abortWrite(), depending on the status), or not have received any content.
        monitor - A progress monitor, or null
        Returns:
        A non-fatal status (warning or better) if the read operation was successful.
        Throws:
        ArtifactSinkException - if that exception is thrown by the given IArtifactSink
        See Also:
        IArtifactSink.getArtifactToBeWritten()
      • getArtifactDescriptors

        public org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] getArtifactDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey key)
        Description copied from interface: IRawArtifactProvider
        Return the raw artifact formats in which the given artifact can be provided.
        Specified by:
        getArtifactDescriptors in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Specified by:
        getArtifactDescriptors in interface IRawArtifactProvider
        Specified by:
        getArtifactDescriptors in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
        Parameters:
        key - An artifact key
        Returns:
        The descriptors associated with the given key
      • contains

        public boolean contains​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
        Description copied from interface: IRawArtifactProvider
        Returns true if this a provider for an artifact in the given format
        Specified by:
        contains in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Specified by:
        contains in interface IRawArtifactProvider
        Specified by:
        contains in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
        Parameters:
        descriptor - An artifact descriptor
        Returns:
        true if this instance can provide the artifact as raw artifact in the described format
      • getArtifactFile

        public java.io.File getArtifactFile​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
        Description copied from interface: IRawArtifactFileProvider
        Returns the file system location of the given artifact in the given format.
        Specified by:
        getArtifactFile in interface org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository
        Specified by:
        getArtifactFile in interface IRawArtifactFileProvider
        Parameters:
        descriptor - The key and format of an artifact
        Returns:
        The location of the specified raw artifact, ornull the that artifact does not exist in the given format.
      • descriptorQueryable

        public org.eclipse.equinox.p2.query.IQueryable<org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor> descriptorQueryable()
        Specified by:
        descriptorQueryable in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
      • isModifiable

        public boolean isModifiable()
        Specified by:
        isModifiable in interface org.eclipse.equinox.p2.repository.IRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>
        Overrides:
        isModifiable in class org.eclipse.equinox.p2.repository.spi.AbstractRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>