|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectaQute.lib.deployer.obr.AbstractBaseOBR
public abstract class AbstractBaseOBR
Abstract base class for OBR-based repositories.
The repository implementation is read-only by default. To implement a writable
repository, subclasses should override canWrite() and put(Jar).
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface aQute.bnd.service.RepositoryPlugin |
|---|
RepositoryPlugin.Strategy |
| Field Summary | |
|---|---|
protected java.lang.String |
name
|
static java.lang.String |
PROP_NAME
|
static java.lang.String |
PROP_RESOLUTION_MODE
|
static java.lang.String |
PROP_RESOLUTION_MODE_ANY
|
protected Registry |
registry
|
protected Reporter |
reporter
|
static java.lang.String |
REPOSITORY_FILE_NAME
|
protected java.util.Set<OBRResolutionMode> |
supportedModes
|
| Constructor Summary | |
|---|---|
AbstractBaseOBR()
|
|
| Method Summary | |
|---|---|
protected void |
addResourceToIndex(Resource resource)
|
boolean |
canWrite()
Answer if this repository can be used to store files. |
java.io.File[] |
get(java.lang.String bsn,
java.lang.String range)
Return a URL to a matching version of the given bundle. |
java.io.File |
get(java.lang.String bsn,
java.lang.String range,
RepositoryPlugin.Strategy strategy,
java.util.Map<java.lang.String,java.lang.String> properties)
Return a URL to a matching version of the given bundle. |
ResourceHandle |
getHandle(java.lang.String bsn,
java.lang.String range,
RepositoryPlugin.Strategy strategy,
java.util.Map<java.lang.String,java.lang.String> properties)
Retrieve a resource handle from the repository. |
protected ResourceHandle[] |
getHandles(java.lang.String bsn,
java.lang.String rangeStr)
|
java.lang.String |
getName()
|
java.util.Set<OBRResolutionMode> |
getSupportedModes()
|
protected void |
init()
|
protected void |
initialiseIndexes()
Initialize the indexes prior to main initialisation of internal data structures. |
java.util.List<java.lang.String> |
list(java.lang.String regex)
Return a list of bsns that are present in the repository. |
protected static java.util.List<java.net.URL> |
parseLocations(java.lang.String locationsStr)
Utility function for parsing lists of URLs. |
java.io.File |
put(Jar jar)
Put a JAR file in the repository. |
protected static java.io.File[] |
requestAll(ResourceHandle[] handles)
|
protected void |
reset()
|
void |
setProperties(java.util.Map<java.lang.String,java.lang.String> map)
Give the plugin the remaining properties. |
void |
setRegistry(Registry registry)
|
void |
setReporter(Reporter reporter)
Set the current reporter. |
java.util.List<Version> |
versions(java.lang.String bsn)
Return a list of versions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface aQute.bnd.service.RemoteRepositoryPlugin |
|---|
getCacheDirectory |
| Methods inherited from interface aQute.bnd.service.OBRIndexProvider |
|---|
getOBRIndexes |
| Field Detail |
|---|
public static final java.lang.String PROP_NAME
public static final java.lang.String PROP_RESOLUTION_MODE
public static final java.lang.String PROP_RESOLUTION_MODE_ANY
public static final java.lang.String REPOSITORY_FILE_NAME
protected Registry registry
protected Reporter reporter
protected java.lang.String name
protected java.util.Set<OBRResolutionMode> supportedModes
| Constructor Detail |
|---|
public AbstractBaseOBR()
| Method Detail |
|---|
protected void addResourceToIndex(Resource resource)
protected void reset()
protected void initialiseIndexes()
throws java.lang.Exception
java.lang.Exception
protected final void init()
throws java.lang.Exception
java.lang.Exceptionpublic final void setRegistry(Registry registry)
setRegistry in interface RegistryPluginpublic void setProperties(java.util.Map<java.lang.String,java.lang.String> map)
Plugin
setProperties in interface Pluginmap - attributes and directives for this plugin's clause
public java.io.File[] get(java.lang.String bsn,
java.lang.String range)
throws java.lang.Exception
RepositoryPlugin
get in interface RepositoryPluginbsn - Bundle-SymbolicName of the searched bundlerange - Version range for this bundle,"latest" if you only want the
latest, or null when you want all.
java.lang.Exception - when anything goes wrong
protected static java.io.File[] requestAll(ResourceHandle[] handles)
throws java.io.IOException
java.io.IOException
protected ResourceHandle[] getHandles(java.lang.String bsn,
java.lang.String rangeStr)
throws java.lang.Exception
java.lang.Exceptionpublic void setReporter(Reporter reporter)
Plugin
setReporter in interface Plugin
public java.io.File get(java.lang.String bsn,
java.lang.String range,
RepositoryPlugin.Strategy strategy,
java.util.Map<java.lang.String,java.lang.String> properties)
throws java.lang.Exception
RepositoryPlugin
get in interface RepositoryPluginbsn - Bundle-SymbolicName of the searched bundlerange - Version range for this bundle,"latest" if you only want the
latest, or null when you want all.strategy - Get the highest or the lowest
java.lang.Exception - when anything goes wrong
public ResourceHandle getHandle(java.lang.String bsn,
java.lang.String range,
RepositoryPlugin.Strategy strategy,
java.util.Map<java.lang.String,java.lang.String> properties)
throws java.lang.Exception
RemoteRepositoryPlugingetFile(bsn, range, strategy, props)
should always return the same result as getResource(bsn, range, strategy, props).request().
getHandle in interface RemoteRepositoryPluginjava.lang.Exceptionpublic boolean canWrite()
RepositoryPlugin
canWrite in interface RepositoryPlugin
public java.io.File put(Jar jar)
throws java.lang.Exception
RepositoryPlugin
put in interface RepositoryPluginjava.lang.Exception
public java.util.List<java.lang.String> list(java.lang.String regex)
throws java.lang.Exception
RepositoryPlugin
list in interface RepositoryPluginregex - if not null, match against the bsn and if matches, return
otherwise skip
java.lang.Exception
public java.util.List<Version> versions(java.lang.String bsn)
throws java.lang.Exception
RepositoryPlugin
versions in interface RepositoryPluginjava.lang.Exceptionpublic java.lang.String getName()
getName in interface RepositoryPlugin
protected static java.util.List<java.net.URL> parseLocations(java.lang.String locationsStr)
throws java.net.MalformedURLException
locationsStr - Comma-separated list of URLs
java.net.MalformedURLExceptionpublic java.util.Set<OBRResolutionMode> getSupportedModes()
getSupportedModes in interface OBRIndexProvider
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||