|
||||||||||
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 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 Summary | |
---|---|
AbstractBaseOBR()
|
Method Summary | |
---|---|
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. |
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 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
Constructor Detail |
---|
public AbstractBaseOBR()
Method Detail |
---|
protected void addResourceToIndex(Resource resource)
protected void reset()
protected void initialiseIndexes() throws Exception
Exception
protected final void init() throws Exception
Exception
public final void setRegistry(Registry registry)
setRegistry
in interface RegistryPlugin
public void setProperties(Map<String,String> map)
Plugin
setProperties
in interface Plugin
map
- attributes and directives for this plugin's clausepublic File[] get(String bsn, String range) throws Exception
RepositoryPlugin
get
in interface RepositoryPlugin
bsn
- 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
IOException
protected ResourceHandle[] getHandles(String bsn, String rangeStr) throws Exception
Exception
public void setReporter(Reporter reporter)
Plugin
setReporter
in interface Plugin
public File get(String bsn, String range, RepositoryPlugin.Strategy strategy, Map<String,String> properties) throws Exception
RepositoryPlugin
get
in interface RepositoryPlugin
bsn
- 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
Exception
- when anything goes wrongpublic ResourceHandle getHandle(String bsn, String range, RepositoryPlugin.Strategy strategy, Map<String,String> properties) throws Exception
RemoteRepositoryPlugin
getFile(bsn, range, strategy, props)
should always return the same result as getResource(bsn, range, strategy, props).request()
.
getHandle
in interface RemoteRepositoryPlugin
Exception
public boolean canWrite()
RepositoryPlugin
canWrite
in interface RepositoryPlugin
public File put(Jar jar) throws Exception
RepositoryPlugin
put
in interface RepositoryPlugin
Exception
public List<String> list(String regex) throws Exception
RepositoryPlugin
list
in interface RepositoryPlugin
regex
- if not null, match against the bsn and if matches, return
otherwise skip
Exception
public List<Version> versions(String bsn) throws Exception
RepositoryPlugin
versions
in interface RepositoryPlugin
Exception
public String getName()
getName
in interface RepositoryPlugin
protected static List<URL> parseLocations(String locationsStr) throws MalformedURLException
locationsStr
- Comma-separated list of URLs
MalformedURLException
public Set<OBRResolutionMode> getSupportedModes()
getSupportedModes
in interface OBRIndexProvider
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |