org.osgi.service.obr
Interface RepositoryAdmin
public
interface
RepositoryAdmin
Provides centralized access to the distributed repository.
A repository contains a set of
resources. A resource contains a
number of fixed attributes (name, version, etc) and sets of:
- Capabilities - Capabilities provide a named aspect: a bundle, a display,
memory, etc.
- Requirements - A named filter expression. The filter must be satisfied
by one or more Capabilties with the given name. These capabilities can come
from other resources or from the platform. If multiple resources provide the
requested capability, one is selected. (### what algorithm? ###)
- Requests - Requests are like requirements, except that a request can be
fullfilled by 0..n resources. This feature can be used to link to resources
that are compatible with the given resource and provide extra functionality.
For example, a bundle could request all its known fragments. The UI
associated with the repository could list these as optional downloads.
Version: $Revision: 1.3 $
Add a new repository to the federation.
The url must point to a repository XML file.
Parameters: repository
Returns:
Throws: Exception
public
Resource[] discoverResources(String filterExpr)
Discover any resources that match the given filter.
This is not a detailed search, but a first scan of applicable resources.
### Checking the capabilities of the filters is not possible because that
requires a new construct in the filter.
The filter expression can assert any of the main headers of the resource.
The attributes that can be checked are:
- name
- version (uses filter matching rules)
- description
- category
- copyright
- license
- source
Parameters: filterExpr
A standard OSGi filter
Returns: List of resources matching the filters.
public
Resource getResource(String respositoryId)
List all the repositories.
Returns:
public boolean removeRepository(URL repository)
Create a resolver.
Parameters: resource
Returns: