public abstract class AbstractArtifactRepository extends AbstractRepository<IArtifactKey> implements IArtifactRepository
This base class provides default implementations of all methods that modify the repository.
These default methods throw an exception if AbstractRepository.isModifiable()
returns false
.
Therefore a client can implement a read-only repository by overriding only the abstract methods.
CODE_RETRY, PROP_RUNNABLE
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
Modifier | Constructor and Description |
---|---|
protected |
AbstractArtifactRepository(IProvisioningAgent agent,
String name,
String type,
String version,
URI location,
String description,
String provider,
Map<String,String> properties) |
Modifier and Type | Method and Description |
---|---|
void |
addDescriptor(IArtifactDescriptor descriptor)
Deprecated.
Use
addDescriptor(IArtifactDescriptor, IProgressMonitor) instead. |
void |
addDescriptor(IArtifactDescriptor descriptor,
IProgressMonitor monitor)
Add the given descriptor to the set of descriptors in this repository.
|
void |
addDescriptors(IArtifactDescriptor[] descriptors)
Deprecated.
|
void |
addDescriptors(IArtifactDescriptor[] descriptors,
IProgressMonitor monitor)
Add the given artifact descriptors to this repository
|
abstract boolean |
contains(IArtifactDescriptor descriptor)
Returns true if this repository contains the given descriptor.
|
abstract boolean |
contains(IArtifactKey key)
Returns true if this repository contains the given artifact key.
|
IArtifactDescriptor |
createArtifactDescriptor(IArtifactKey key)
Create an instance of
IArtifactDescriptor based on the given key |
IArtifactKey |
createArtifactKey(String classifier,
String id,
Version version)
Create an instance of
IArtifactKey |
boolean |
equals(Object o) |
IStatus |
executeBatch(IRunnableWithProgress runnable,
IProgressMonitor monitor)
Executes a runnable against this repository.
|
abstract IStatus |
getArtifact(IArtifactDescriptor descriptor,
OutputStream destination,
IProgressMonitor monitor)
Writes to the given output stream the bytes represented by the artifact descriptor.
|
abstract IArtifactDescriptor[] |
getArtifactDescriptors(IArtifactKey key)
Return the set of artifact descriptors describing the ways that this repository
can supply the artifact associated with the given artifact key
|
abstract IStatus |
getArtifacts(IArtifactRequest[] requests,
IProgressMonitor monitor)
Executes the given artifact requests on this byte server.
|
abstract OutputStream |
getOutputStream(IArtifactDescriptor descriptor)
Open an output stream to which a client can write the data for the given
artifact descriptor.
|
int |
hashCode() |
void |
removeAll()
Deprecated.
Use
removeAll(IProgressMonitor) instead. |
void |
removeAll(IProgressMonitor monitor)
Remove the all keys, descriptors, and contents from this repository.
|
void |
removeDescriptor(IArtifactDescriptor descriptor)
Deprecated.
|
void |
removeDescriptor(IArtifactDescriptor descriptor,
IProgressMonitor monitor)
Remove the given descriptor and its corresponding content in this repository.
|
void |
removeDescriptor(IArtifactKey key)
Deprecated.
Use
removeDescriptor(IArtifactKey, IProgressMonitor) instead. |
void |
removeDescriptor(IArtifactKey key,
IProgressMonitor monitor)
Remove the given key and all related content and descriptors from this repository.
|
void |
removeDescriptors(IArtifactDescriptor[] descriptors)
Deprecated.
|
void |
removeDescriptors(IArtifactDescriptor[] descriptors,
IProgressMonitor monitor)
Remove the given list of artifact descriptors and their corresponding content
in this repository.
|
void |
removeDescriptors(IArtifactKey[] keys)
Deprecated.
Use
removeDescriptors(IArtifactKey[], IProgressMonitor) instead. |
void |
removeDescriptors(IArtifactKey[] keys,
IProgressMonitor monitor)
Remove the given list of keys and all related content and descriptors from this
repository.
|
assertModifiable, getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, setDescription, setLocation, setName, setProperties, setProperty, setProperty, setProvider, setType, setVersion
getAdapter
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
descriptorQueryable, getRawArtifact
getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, setProperty, setProperty
getAdapter
query
public abstract boolean contains(IArtifactDescriptor descriptor)
IArtifactRepository
contains
in interface IArtifactRepository
descriptor
- the descriptor to querypublic abstract boolean contains(IArtifactKey key)
IArtifactRepository
contains
in interface IArtifactRepository
key
- the key to querypublic abstract IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor)
IArtifactRepository
getArtifact
in interface IArtifactRepository
descriptor
- the descriptor to transferdestination
- the stream to write the final artifact output tomonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desiredpublic abstract IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key)
IArtifactRepository
getArtifactDescriptors
in interface IArtifactRepository
key
- the artifact key to lookuppublic abstract IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor)
IArtifactRepository
getArtifacts
in interface IArtifactRepository
requests
- The artifact requestsOK
if requests were
processed successfully. Otherwise, a status indicating information,
warnings, or errors that occurred while executing the artifact requestspublic abstract OutputStream getOutputStream(IArtifactDescriptor descriptor) throws ProvisionException
IArtifactRepository
getOutputStream
in interface IArtifactRepository
descriptor
- the descriptor describing the artifact data to be written to the
resultant streamIStateful
.ProvisionException
- if the output stream could not be created. Reasons include:
ProvisionException.REPOSITORY_FAILED_WRITE
) .ProvisionException.ARTIFACT_EXISTS
).public void addDescriptor(IArtifactDescriptor descriptor, IProgressMonitor monitor)
IArtifactRepository
addDescriptor
in interface IArtifactRepository
descriptor
- the descriptor to add.monitor
- A progress monitor use to track progress and cancel the operation. This may
be a long running operation if another process holds the lock on this locationpublic void addDescriptor(IArtifactDescriptor descriptor)
addDescriptor(IArtifactDescriptor, IProgressMonitor)
instead.IArtifactRepository
addDescriptor
in interface IArtifactRepository
descriptor
- the descriptor to add.public void addDescriptors(IArtifactDescriptor[] descriptors, IProgressMonitor monitor)
addDescriptors
in interface IArtifactRepository
descriptors
- the artifact descriptors to addmonitor
- A progress monitor use to track progress and cancel the operation. This may
be a long running operation if another process holds the lock on this locationpublic void addDescriptors(IArtifactDescriptor[] descriptors)
addDescriptors(IArtifactDescriptor[], IProgressMonitor)
instead.IArtifactRepository
addDescriptors
in interface IArtifactRepository
descriptors
- the artifact descriptors to addpublic void removeDescriptor(IArtifactDescriptor descriptor, IProgressMonitor monitor)
removeDescriptor
in interface IArtifactRepository
descriptor
- the descriptor to remove.monitor
- A progress monitor use to track progress and cancel the operation. This may
be a long running operation if another process holds the lock on this locationpublic void removeDescriptor(IArtifactDescriptor descriptor)
removeDescriptor(IArtifactDescriptor, IProgressMonitor)
instead.IArtifactRepository
removeDescriptor
in interface IArtifactRepository
descriptor
- the descriptor to remove.public void removeDescriptors(IArtifactDescriptor[] descriptors, IProgressMonitor monitor)
removeDescriptors
in interface IArtifactRepository
descriptors
- the list of descriptors to removemonitor
- A progress monitor use to track progress and cancel the operation. This may
be a long running operation if another process holds the lock on this locationpublic void removeDescriptors(IArtifactDescriptor[] descriptors)
removeDescriptors(IArtifactDescriptor[], IProgressMonitor)
instead.removeDescriptors
in interface IArtifactRepository
descriptors
- the list of descriptors to removepublic void removeDescriptor(IArtifactKey key, IProgressMonitor monitor)
removeDescriptor
in interface IArtifactRepository
key
- the key to remove.monitor
- A progress monitor use to track progress and cancel the operation. This may
be a long running operation if another process holds the lock on this locationpublic void removeDescriptor(IArtifactKey key)
removeDescriptor(IArtifactKey, IProgressMonitor)
instead.IArtifactRepository
removeDescriptor
in interface IArtifactRepository
key
- the key to remove.public void removeDescriptors(IArtifactKey[] keys, IProgressMonitor monitor)
removeDescriptors
in interface IArtifactRepository
monitor
- A progress monitor use to track progress and cancel the operation. This may
be a long running operation if another process holds the lock on this locationpublic void removeDescriptors(IArtifactKey[] keys)
removeDescriptors(IArtifactKey[], IProgressMonitor)
instead.removeDescriptors
in interface IArtifactRepository
public void removeAll(IProgressMonitor monitor)
IArtifactRepository
removeAll
in interface IArtifactRepository
monitor
- A progress monitor use to track progress and cancel the operation. This may
be a long running operation if another process holds the lock on this locationpublic void removeAll()
removeAll(IProgressMonitor)
instead.IArtifactRepository
removeAll
in interface IArtifactRepository
public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key)
IArtifactRepository
IArtifactDescriptor
based on the given keycreateArtifactDescriptor
in interface IArtifactRepository
key
- IArtifactKey
public IArtifactKey createArtifactKey(String classifier, String id, Version version)
IArtifactRepository
IArtifactKey
createArtifactKey
in interface IArtifactRepository
public IStatus executeBatch(IRunnableWithProgress runnable, IProgressMonitor monitor)
IArtifactRepository
executeBatch
in interface IArtifactRepository
runnable
- The runnable to executemonitor
- A progress monitor that will be passed to the runnable
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.