Class CompositeArtifactProviderBaseImpl
- java.lang.Object
-
- org.eclipse.tycho.repository.p2base.artifact.provider.CompositeArtifactProviderBaseImpl
-
- All Implemented Interfaces:
org.eclipse.equinox.p2.query.IQueryable<org.eclipse.equinox.p2.metadata.IArtifactKey>
,IArtifactProvider
,IRawArtifactProvider
- Direct Known Subclasses:
CompositeArtifactProvider
,RepositoryArtifactProvider
public abstract class CompositeArtifactProviderBaseImpl extends Object implements IRawArtifactProvider
-
-
Constructor Summary
Constructors Constructor Description 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 givenIArtifactSink
.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, Set<org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor> result)
protected abstract void
getArtifactFromAnySource(IArtifactSink sink, List<org.eclipse.core.runtime.IStatus> statusCollector, org.eclipse.core.runtime.IProgressMonitor monitor)
protected abstract org.eclipse.core.runtime.IStatus
getArtifactNotFoundError(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 givenIRawArtifactSink
.protected abstract void
getRawArtifactFromAnySource(IRawArtifactSink sink, org.eclipse.core.runtime.IProgressMonitor monitor, 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)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.tycho.repository.p2base.artifact.provider.IArtifactProvider
contains
-
Methods inherited from interface org.eclipse.tycho.repository.p2base.artifact.provider.IRawArtifactProvider
contains
-
-
-
-
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 interfaceIRawArtifactProvider
- 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, 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 givenIArtifactSink
.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 interfaceIArtifactProvider
- Parameters:
sink
- A sink for a specific artifact. When this method returns, the sink will either be closed (withIArtifactSink.commitWrite()
orIArtifactSink.abortWrite()
, depending on the status), or not have received any content.monitor
- A progress monitor, ornull
- Returns:
- A non-fatal status (warning or better) if the read operation was successful.
- Throws:
ArtifactSinkException
- if that exception is thrown by the givenIArtifactSink
- See Also:
IArtifactSink.getArtifactToBeWritten()
-
getArtifactFromAnySource
protected abstract void getArtifactFromAnySource(IArtifactSink sink, List<org.eclipse.core.runtime.IStatus> statusCollector, org.eclipse.core.runtime.IProgressMonitor monitor) throws ArtifactSinkException
- Throws:
ArtifactSinkException
-
getRawArtifact
public final org.eclipse.core.runtime.IStatus getRawArtifact(IRawArtifactSink sink, org.eclipse.core.runtime.IProgressMonitor monitor) throws ArtifactSinkException
Description copied from interface:IRawArtifactProvider
Writes the requested artifact in the specified raw format to the givenIRawArtifactSink
.If an error is detected while streaming the artifact (e.g. an MD5 checksum error) and there are other sources available (e.g. in a composite provider), the implementation may re-attempt the read from these other sources. In case there were multiple read attempts, a multi-status with the results of all attempts is returned.
- Specified by:
getRawArtifact
in interfaceIRawArtifactProvider
- Parameters:
sink
- A sink for a specific artifact in a specific format. When this method returns, the sink will either be closed (withIArtifactSink.commitWrite()
orIArtifactSink.abortWrite()
, depending on the status), or not have received any content.monitor
- A progress monitor, ornull
- Returns:
- A non-fatal status (warning or better) if the read operation was successful.
- Throws:
ArtifactSinkException
- if that exception is thrown by the givenIArtifactSink
- See Also:
IArtifactSink.getArtifactToBeWritten()
,IRawArtifactSink.getArtifactFormatToBeWritten()
-
getRawArtifactFromAnySource
protected abstract void getRawArtifactFromAnySource(IRawArtifactSink sink, org.eclipse.core.runtime.IProgressMonitor monitor, List<org.eclipse.core.runtime.IStatus> statusCollector) throws ArtifactSinkException
- Throws:
ArtifactSinkException
-
getArtifactNotFoundError
protected abstract org.eclipse.core.runtime.IStatus getArtifactNotFoundError(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)
-
-