public abstract class AbstractBaseOBR extends Object implements RegistryPlugin, Plugin, RemoteRepositoryPlugin, OBRIndexProvider
The repository implementation is read-only by default. To implement a writable
repository, subclasses should override canWrite() and put(Jar).
RepositoryPlugin.Strategy| Modifier and Type | Field and Description |
|---|---|
protected String |
name |
static String |
PROP_NAME |
static String |
PROP_RESOLUTION_MODE |
static String |
PROP_RESOLUTION_MODE_ANY |
protected Registry |
registry |
protected Reporter |
reporter |
static String |
REPOSITORY_FILE_NAME |
protected Set<OBRResolutionMode> |
supportedModes |
| Constructor and Description |
|---|
AbstractBaseOBR() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addResourceToIndex(Resource resource) |
boolean |
canWrite()
Answer if this repository can be used to store files.
|
File[] |
get(String bsn,
String range)
Return a URL to a matching version of the given bundle.
|
File |
get(String bsn,
String range,
RepositoryPlugin.Strategy strategy,
Map<String,String> properties)
Return a URL to a matching version of the given bundle.
|
ResourceHandle |
getHandle(String bsn,
String range,
RepositoryPlugin.Strategy strategy,
Map<String,String> properties)
Retrieve a resource handle from the repository.
|
protected ResourceHandle[] |
getHandles(String bsn,
String rangeStr) |
String |
getName() |
Set<OBRResolutionMode> |
getSupportedModes() |
protected void |
init() |
protected void |
initialiseIndexes()
Initialize the indexes prior to main initialisation of internal
data structures.
|
List<String> |
list(String regex)
Return a list of bsns that are present in the repository.
|
protected static List<URL> |
parseLocations(String locationsStr)
Utility function for parsing lists of URLs.
|
File |
put(Jar jar)
Put a JAR file in the repository.
|
protected static File[] |
requestAll(ResourceHandle[] handles) |
protected void |
reset() |
void |
setProperties(Map<String,String> map)
Give the plugin the remaining properties.
|
void |
setRegistry(Registry registry) |
void |
setReporter(Reporter reporter)
Set the current reporter.
|
List<Version> |
versions(String bsn)
Return a list of versions.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCacheDirectorygetOBRIndexespublic static final String PROP_NAME
public static final String PROP_RESOLUTION_MODE
public static final String PROP_RESOLUTION_MODE_ANY
public static final String REPOSITORY_FILE_NAME
protected Registry registry
protected Reporter reporter
protected String name
protected Set<OBRResolutionMode> supportedModes
protected void addResourceToIndex(Resource resource)
protected void reset()
protected void initialiseIndexes()
throws Exception
Exceptionpublic final void setRegistry(Registry registry)
setRegistry in interface RegistryPluginpublic void setProperties(Map<String,String> map)
PluginsetProperties in interface Pluginmap - attributes and directives for this plugin's clausepublic File[] get(String bsn, String range) throws Exception
RepositoryPluginget 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.Exception - when anything goes wrongprotected static File[] requestAll(ResourceHandle[] handles) throws IOException
IOExceptionprotected ResourceHandle[] getHandles(String bsn, String rangeStr) throws Exception
Exceptionpublic void setReporter(Reporter reporter)
PluginsetReporter in interface Pluginpublic File get(String bsn, String range, RepositoryPlugin.Strategy strategy, Map<String,String> properties) throws Exception
RepositoryPluginget 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 lowestException - when anything goes wrongpublic ResourceHandle getHandle(String bsn, String range, RepositoryPlugin.Strategy strategy, Map<String,String> properties) throws Exception
RemoteRepositoryPlugingetFile(bsn, range, strategy, props)
should always return the same result as getResource(bsn, range, strategy, props).request().getHandle in interface RemoteRepositoryPluginExceptionpublic boolean canWrite()
RepositoryPlugincanWrite in interface RepositoryPluginpublic File put(Jar jar) throws Exception
RepositoryPluginput in interface RepositoryPluginExceptionpublic List<String> list(String regex) throws Exception
RepositoryPluginlist in interface RepositoryPluginregex - if not null, match against the bsn and if matches, return
otherwise skipExceptionpublic List<Version> versions(String bsn) throws Exception
RepositoryPluginversions in interface RepositoryPluginExceptionpublic String getName()
getName in interface RepositoryPluginprotected static List<URL> parseLocations(String locationsStr) throws MalformedURLException
locationsStr - Comma-separated list of URLsMalformedURLExceptionpublic Set<OBRResolutionMode> getSupportedModes()
getSupportedModes in interface OBRIndexProviderCopyright © 2015 aQute SARL. All Rights Reserved.