Class AbstractArtifactRepository2

  • 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.IRepository<org.eclipse.equinox.p2.metadata.IArtifactKey>, IArtifactProvider, IRawArtifactProvider
    Direct Known Subclasses:
    ArtifactRepositoryBaseImpl, ProviderOnlyArtifactRepository

    public abstract class AbstractArtifactRepository2
    extends org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
    implements IRawArtifactProvider
    Base class for IArtifactRepository implementations that fixes some problems in the p2 API and p2's base class AbstractArtifactRepository.
    • Field Summary

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

      Constructors 
      Modifier Constructor Description
      protected AbstractArtifactRepository2​(org.eclipse.equinox.p2.core.IProvisioningAgent agent, java.lang.String name, java.lang.String type, java.lang.String version, java.net.URI location, java.lang.String description, java.lang.String provider, java.util.Map<java.lang.String,​java.lang.String> properties)  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
      Deprecated.
      This method requires assumptions about the internal artifact layout and may bring the repository into an inconsistent state.
      void addDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor, org.eclipse.core.runtime.IProgressMonitor monitor)
      Deprecated.
      This method requires assumptions about the internal artifact layout and may bring the repository into an inconsistent state.
      void addDescriptors​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors)
      Deprecated.
      This method requires assumptions about the internal artifact layout and may bring the repository into an inconsistent state.
      void addDescriptors​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors, org.eclipse.core.runtime.IProgressMonitor monitor)
      Deprecated.
      This method requires assumptions about the internal artifact layout and may bring the repository into an inconsistent state.
      org.eclipse.core.runtime.IStatus getArtifact​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor, java.io.OutputStream destination, org.eclipse.core.runtime.IProgressMonitor monitor)
      Deprecated.
      Obsolete.
      org.eclipse.core.runtime.IStatus getArtifacts​(org.eclipse.equinox.p2.repository.artifact.IArtifactRequest[] requests, org.eclipse.core.runtime.IProgressMonitor monitor)  
      java.io.OutputStream getOutputStream​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
      Deprecated.
      The commit logic of this method is undocumented and brittle (bug 400442).
      org.eclipse.core.runtime.IStatus getRawArtifact​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor, java.io.OutputStream destination, org.eclipse.core.runtime.IProgressMonitor monitor)
      Deprecated.
      Obsolete.
      protected abstract void internalAddDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)  
      protected abstract void internalRemoveAllDescriptors()  
      protected abstract void internalRemoveDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)  
      protected abstract void internalRemoveDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey key)  
      protected abstract void internalRemoveDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey[] keys)  
      protected abstract void internalRemoveDescriptors​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors)  
      protected abstract void internalStore​(org.eclipse.core.runtime.IProgressMonitor monitor)  
      protected static boolean isFatal​(org.eclipse.core.runtime.IStatus status)  
      abstract 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().
      abstract 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().
      void removeAll()  
      void removeAll​(org.eclipse.core.runtime.IProgressMonitor monitor)  
      void removeDescriptor​(org.eclipse.equinox.p2.metadata.IArtifactKey key)  
      void removeDescriptor​(org.eclipse.equinox.p2.metadata.IArtifactKey key, org.eclipse.core.runtime.IProgressMonitor monitor)  
      void removeDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)  
      void removeDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor, org.eclipse.core.runtime.IProgressMonitor monitor)  
      void removeDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey[] keys)  
      void removeDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey[] keys, org.eclipse.core.runtime.IProgressMonitor monitor)  
      void removeDescriptors​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors)  
      void removeDescriptors​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors, org.eclipse.core.runtime.IProgressMonitor monitor)  
      protected static void setStatusOnStreamIfPossible​(java.io.OutputStream destination, org.eclipse.core.runtime.IStatus status)  
      • Methods inherited from class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository

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

        assertModifiable, getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, 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

        descriptorQueryable
      • Methods inherited from interface org.eclipse.equinox.p2.query.IQueryable

        query
      • Methods inherited from interface org.eclipse.equinox.p2.repository.IRepository

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

      • AbstractArtifactRepository2

        protected AbstractArtifactRepository2​(org.eclipse.equinox.p2.core.IProvisioningAgent agent,
                                              java.lang.String name,
                                              java.lang.String type,
                                              java.lang.String version,
                                              java.net.URI location,
                                              java.lang.String description,
                                              java.lang.String provider,
                                              java.util.Map<java.lang.String,​java.lang.String> properties)
    • Method Detail

      • internalAddDescriptor

        protected abstract void internalAddDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
      • internalStore

        protected abstract void internalStore​(org.eclipse.core.runtime.IProgressMonitor monitor)
      • addDescriptor

        @Deprecated
        public final void addDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
        Deprecated.
        This method requires assumptions about the internal artifact layout and may bring the repository into an inconsistent state. Use newAddingArtifactSink(IArtifactKey) or newAddingRawArtifactSink(IArtifactDescriptor) instead.
        Specified by:
        addDescriptor in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        addDescriptor in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • addDescriptor

        @Deprecated
        public final void addDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor,
                                        org.eclipse.core.runtime.IProgressMonitor monitor)
        Deprecated.
        This method requires assumptions about the internal artifact layout and may bring the repository into an inconsistent state. Use newAddingArtifactSink(IArtifactKey) or newAddingRawArtifactSink(IArtifactDescriptor) instead.
        Specified by:
        addDescriptor in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        addDescriptor in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • addDescriptors

        @Deprecated
        public final void addDescriptors​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors)
        Deprecated.
        This method requires assumptions about the internal artifact layout and may bring the repository into an inconsistent state. Use newAddingArtifactSink(IArtifactKey) or newAddingRawArtifactSink(IArtifactDescriptor) instead.
        Specified by:
        addDescriptors in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        addDescriptors in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • addDescriptors

        @Deprecated
        public final void addDescriptors​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors,
                                         org.eclipse.core.runtime.IProgressMonitor monitor)
        Deprecated.
        This method requires assumptions about the internal artifact layout and may bring the repository into an inconsistent state. Use newAddingArtifactSink(IArtifactKey) or newAddingRawArtifactSink(IArtifactDescriptor) instead.
        Specified by:
        addDescriptors in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        addDescriptors in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • internalRemoveDescriptor

        protected abstract void internalRemoveDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
      • internalRemoveDescriptors

        protected abstract void internalRemoveDescriptors​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors)
      • internalRemoveDescriptors

        protected abstract void internalRemoveDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey key)
      • internalRemoveDescriptors

        protected abstract void internalRemoveDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey[] keys)
      • internalRemoveAllDescriptors

        protected abstract void internalRemoveAllDescriptors()
      • removeDescriptor

        public final void removeDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
        Specified by:
        removeDescriptor in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        removeDescriptor in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • removeDescriptor

        public final void removeDescriptor​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor,
                                           org.eclipse.core.runtime.IProgressMonitor monitor)
        Specified by:
        removeDescriptor in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        removeDescriptor in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • removeDescriptors

        public final void removeDescriptors​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors)
        Specified by:
        removeDescriptors in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        removeDescriptors in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • removeDescriptors

        public final void removeDescriptors​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] descriptors,
                                            org.eclipse.core.runtime.IProgressMonitor monitor)
        Specified by:
        removeDescriptors in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        removeDescriptors in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • removeDescriptor

        public final void removeDescriptor​(org.eclipse.equinox.p2.metadata.IArtifactKey key)
        Specified by:
        removeDescriptor in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        removeDescriptor in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • removeDescriptor

        public final void removeDescriptor​(org.eclipse.equinox.p2.metadata.IArtifactKey key,
                                           org.eclipse.core.runtime.IProgressMonitor monitor)
        Specified by:
        removeDescriptor in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        removeDescriptor in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • removeDescriptors

        public final void removeDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey[] keys)
        Specified by:
        removeDescriptors in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        removeDescriptors in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • removeDescriptors

        public final void removeDescriptors​(org.eclipse.equinox.p2.metadata.IArtifactKey[] keys,
                                            org.eclipse.core.runtime.IProgressMonitor monitor)
        Specified by:
        removeDescriptors in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        removeDescriptors in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • removeAll

        public final void removeAll()
        Specified by:
        removeAll in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        removeAll in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • removeAll

        public final void removeAll​(org.eclipse.core.runtime.IProgressMonitor monitor)
        Specified by:
        removeAll in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Overrides:
        removeAll in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • newAddingArtifactSink

        public abstract IArtifactSink newAddingArtifactSink​(org.eclipse.equinox.p2.metadata.IArtifactKey key)
                                                     throws org.eclipse.equinox.p2.core.ProvisionException
        Returns a new IArtifactSink instance that adds the received artifact to this repository on IArtifactSink.commitWrite().
        Parameters:
        key - The artifact key to be added to this repository
        Throws:
        org.eclipse.equinox.p2.core.ProvisionException - if the artifact is already stored in the repository (in canonical format)
      • newAddingRawArtifactSink

        public abstract IRawArtifactSink newAddingRawArtifactSink​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
                                                           throws org.eclipse.equinox.p2.core.ProvisionException
        Returns a new IRawArtifactSink instance that adds the received artifact to this repository on IArtifactSink.commitWrite().
        Parameters:
        descriptor - The artifact descriptor to the added to this repository
        Throws:
        org.eclipse.equinox.p2.core.ProvisionException - if the artifact is already stored in the repository in the given format.
      • getOutputStream

        @Deprecated
        public final java.io.OutputStream getOutputStream​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor)
                                                   throws org.eclipse.equinox.p2.core.ProvisionException
        Deprecated.
        The commit logic of this method is undocumented and brittle (bug 400442). Use newAddingArtifactSink(IArtifactKey) or newAddingRawArtifactSink(IArtifactDescriptor) instead.
        Specified by:
        getOutputStream in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Specified by:
        getOutputStream in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
        Throws:
        org.eclipse.equinox.p2.core.ProvisionException
      • getArtifact

        @Deprecated
        public org.eclipse.core.runtime.IStatus getArtifact​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor,
                                                            java.io.OutputStream destination,
                                                            org.eclipse.core.runtime.IProgressMonitor monitor)
        Specified by:
        getArtifact in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Specified by:
        getArtifact in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • getRawArtifact

        @Deprecated
        public org.eclipse.core.runtime.IStatus getRawArtifact​(org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor descriptor,
                                                               java.io.OutputStream destination,
                                                               org.eclipse.core.runtime.IProgressMonitor monitor)
        Specified by:
        getRawArtifact in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
      • getArtifacts

        public org.eclipse.core.runtime.IStatus getArtifacts​(org.eclipse.equinox.p2.repository.artifact.IArtifactRequest[] requests,
                                                             org.eclipse.core.runtime.IProgressMonitor monitor)
        Specified by:
        getArtifacts in interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository
        Specified by:
        getArtifacts in class org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
      • isFatal

        protected static boolean isFatal​(org.eclipse.core.runtime.IStatus status)
      • setStatusOnStreamIfPossible

        protected static void setStatusOnStreamIfPossible​(java.io.OutputStream destination,
                                                          org.eclipse.core.runtime.IStatus status)