public abstract class CompositeArtifactProviderBaseImpl extends Object implements IRawArtifactProvider
Constructor and Description |
---|
CompositeArtifactProviderBaseImpl() |
Modifier and Type | Method and 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,
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 given
IRawArtifactSink . |
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contains
contains
public final org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor[] getArtifactDescriptors(org.eclipse.equinox.p2.metadata.IArtifactKey key)
IRawArtifactProvider
getArtifactDescriptors
in interface IRawArtifactProvider
key
- An artifact keyprotected abstract void getArtifactDescriptorsOfAllSources(org.eclipse.equinox.p2.metadata.IArtifactKey key, Set<org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor> result)
public final org.eclipse.core.runtime.IStatus getArtifact(IArtifactSink sink, org.eclipse.core.runtime.IProgressMonitor monitor) throws ArtifactSinkException
IArtifactProvider
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.
getArtifact
in interface IArtifactProvider
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
ArtifactSinkException
- if that exception is thrown by the given IArtifactSink
IArtifactSink.getArtifactToBeWritten()
protected abstract void getArtifactFromAnySource(IArtifactSink sink, List<org.eclipse.core.runtime.IStatus> statusCollector, org.eclipse.core.runtime.IProgressMonitor monitor) throws ArtifactSinkException
ArtifactSinkException
public final org.eclipse.core.runtime.IStatus getRawArtifact(IRawArtifactSink sink, org.eclipse.core.runtime.IProgressMonitor monitor) throws ArtifactSinkException
IRawArtifactProvider
IRawArtifactSink
.
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.
getRawArtifact
in interface IRawArtifactProvider
sink
- A sink for a specific artifact in a specific format. 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
ArtifactSinkException
- if that exception is thrown by the given IArtifactSink
IArtifactSink.getArtifactToBeWritten()
,
IRawArtifactSink.getArtifactFormatToBeWritten()
protected abstract void getRawArtifactFromAnySource(IRawArtifactSink sink, org.eclipse.core.runtime.IProgressMonitor monitor, List<org.eclipse.core.runtime.IStatus> statusCollector) throws ArtifactSinkException
ArtifactSinkException
protected abstract org.eclipse.core.runtime.IStatus getArtifactNotFoundError(String artifact)
protected static org.eclipse.core.runtime.IProgressMonitor nonNull(org.eclipse.core.runtime.IProgressMonitor monitor)
protected static boolean isFatal(org.eclipse.core.runtime.IStatus status)
Copyright © 2008–2022 Eclipse Foundation. All rights reserved.