|
Eclipse Platform Release 3.7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.runtime.PlatformObject
org.eclipse.equinox.p2.repository.spi.AbstractRepository<IArtifactKey>
org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
public abstract class AbstractArtifactRepository
The common base class for all artifact repository implementations. Clients must subclass this class to create their own repository implementations.
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.
Field Summary |
---|
Fields inherited from interface org.eclipse.equinox.p2.repository.artifact.IArtifactRepository |
---|
CODE_RETRY |
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 | |
---|---|
protected |
AbstractArtifactRepository(IProvisioningAgent agent,
String name,
String type,
String version,
URI location,
String description,
String provider,
Map<String,String> properties)
|
Method Summary | |
---|---|
void |
addDescriptor(IArtifactDescriptor descriptor)
Deprecated. |
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. |
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. |
void |
removeDescriptor(IArtifactKey key,
IProgressMonitor monitor)
Remove the given key and all related content and descriptors from this repository. |
void |
removeDescriptors(IArtifactDescriptor[] descriptors)
Deprecated. ?? Strange that we added an API and then deprecated it |
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. ?? Strange that we added an API and then deprecated it |
void |
removeDescriptors(IArtifactKey[] keys,
IProgressMonitor monitor)
Remove the given list of keys and all related content and descriptors from this repository. |
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.equinox.p2.repository.artifact.IArtifactRepository |
---|
descriptorQueryable, getRawArtifact |
Methods inherited from interface org.eclipse.equinox.p2.repository.IRepository |
---|
getDescription, getLocation, getName, getProperties, getProperty, getProvider, getProvisioningAgent, getType, getVersion, isModifiable, setProperty, setProperty |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
---|
getAdapter |
Methods inherited from interface org.eclipse.equinox.p2.query.IQueryable |
---|
query |
Constructor Detail |
---|
protected AbstractArtifactRepository(IProvisioningAgent agent, String name, String type, String version, URI location, String description, String provider, Map<String,String> properties)
Method Detail |
---|
public abstract boolean contains(IArtifactDescriptor descriptor)
IArtifactRepository
contains
in interface IArtifactRepository
descriptor
- the descriptor to query
public abstract boolean contains(IArtifactKey key)
IArtifactRepository
contains
in interface IArtifactRepository
key
- the key to query
public 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 desired
public abstract IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key)
IArtifactRepository
getArtifactDescriptors
in interface IArtifactRepository
key
- the artifact key to lookup
public abstract IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor)
IArtifactRepository
getArtifacts
in interface IArtifactRepository
requests
- The artifact requests
OK
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 stream
IStateful
.
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)
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)
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)
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
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)
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
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()
IArtifactRepository
removeAll
in interface IArtifactRepository
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key)
IArtifactRepository
IArtifactDescriptor
based on the given key
createArtifactDescriptor
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
|
Eclipse Platform Release 3.7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.