|
Eclipse Platform Release 3.6 |
|||||||||
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)
Add the given descriptor to the set of descriptors in this repository. |
void |
addDescriptors(IArtifactDescriptor[] descriptors)
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()
Remove the all keys, descriptors, and contents from this repository. |
void |
removeDescriptor(IArtifactDescriptor descriptor)
Remove the given descriptor and its corresponding content in this repository. |
void |
removeDescriptor(IArtifactKey key)
Remove the given key 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, 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 |
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)
IArtifactRepository
addDescriptor
in interface IArtifactRepository
descriptor
- the descriptor to add.public void addDescriptors(IArtifactDescriptor[] descriptors)
IArtifactRepository
addDescriptors
in interface IArtifactRepository
descriptors
- the artifact descriptors to addpublic void removeDescriptor(IArtifactDescriptor descriptor)
IArtifactRepository
removeDescriptor
in interface IArtifactRepository
descriptor
- the descriptor to remove.public void removeDescriptor(IArtifactKey key)
IArtifactRepository
removeDescriptor
in interface IArtifactRepository
key
- the key to remove.public 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.6 |
|||||||||
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, 2010. All rights reserved.