Class CompositeArtifactProviderBaseImpl

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      protected abstract void getArtifactDescriptorsOfAllSources​(org.eclipse.equinox.p2.metadata.IArtifactKey key, java.util.Set<org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor> result)  
      protected abstract void getArtifactFromAnySource​(IArtifactSink sink, java.util.List<org.eclipse.core.runtime.IStatus> statusCollector, org.eclipse.core.runtime.IProgressMonitor monitor)  
      protected abstract org.eclipse.core.runtime.IStatus getArtifactNotFoundError​(java.lang.String artifact)  
      private org.eclipse.core.runtime.IStatus getOverallStatus​(java.util.List<org.eclipse.core.runtime.IStatus> statusOfAllAttempts, java.lang.String artifact)  
      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 abstract void getRawArtifactFromAnySource​(IRawArtifactSink sink, org.eclipse.core.runtime.IProgressMonitor monitor, java.util.List<org.eclipse.core.runtime.IStatus> statusCollector)  
      protected static boolean isFatal​(org.eclipse.core.runtime.IStatus status)  
      protected static org.eclipse.core.runtime.IProgressMonitor nonNull​(org.eclipse.core.runtime.IProgressMonitor monitor)  
      private static org.eclipse.core.runtime.IStatus[] toArray​(java.util.List<org.eclipse.core.runtime.IStatus> statusList)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.eclipse.equinox.p2.query.IQueryable

        query
    • Constructor Detail

      • CompositeArtifactProviderBaseImpl

        public CompositeArtifactProviderBaseImpl()
    • Method Detail

      • getArtifactDescriptors

        public final 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 IRawArtifactProvider
        Parameters:
        key - An artifact key
        Returns:
        The descriptors associated with the given key
      • getArtifactDescriptorsOfAllSources

        protected abstract void getArtifactDescriptorsOfAllSources​(org.eclipse.equinox.p2.metadata.IArtifactKey key,
                                                                   java.util.Set<org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor> result)
      • getArtifact

        public final 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()
      • getArtifactFromAnySource

        protected abstract void getArtifactFromAnySource​(IArtifactSink sink,
                                                         java.util.List<org.eclipse.core.runtime.IStatus> statusCollector,
                                                         org.eclipse.core.runtime.IProgressMonitor monitor)
                                                  throws ArtifactSinkException
        Throws:
        ArtifactSinkException
      • getOverallStatus

        private org.eclipse.core.runtime.IStatus getOverallStatus​(java.util.List<org.eclipse.core.runtime.IStatus> statusOfAllAttempts,
                                                                  java.lang.String artifact)
      • getArtifactNotFoundError

        protected abstract org.eclipse.core.runtime.IStatus getArtifactNotFoundError​(java.lang.String artifact)
      • nonNull

        protected static org.eclipse.core.runtime.IProgressMonitor nonNull​(org.eclipse.core.runtime.IProgressMonitor monitor)
      • isFatal

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

        private static org.eclipse.core.runtime.IStatus[] toArray​(java.util.List<org.eclipse.core.runtime.IStatus> statusList)