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:
  1. Capabilities - Capabilities provide a named aspect: a bundle, a display, memory, etc.
  2. 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? ###)
  3. 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.
  4. Version: $Revision: 1.3 $

Method Summary
RepositoryaddRepository(URL repository)
Add a new repository to the federation.
Resource[]discoverResources(String filterExpr)
Discover any resources that match the given filter.
ResourcegetResource(String respositoryId)
Repository[]listRepositories()
List all the repositories.
booleanremoveRepository(URL repository)
Resolverresolver()
Create a resolver.

Method Detail

addRepository

public Repository addRepository(URL repository)
Add a new repository to the federation. The url must point to a repository XML file.

Parameters: repository

Returns:

Throws: Exception

discoverResources

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:
  1. name
  2. version (uses filter matching rules)
  3. description
  4. category
  5. copyright
  6. license
  7. source

Parameters: filterExpr A standard OSGi filter

Returns: List of resources matching the filters.

getResource

public Resource getResource(String respositoryId)

listRepositories

public Repository[] listRepositories()
List all the repositories.

Returns:

removeRepository

public boolean removeRepository(URL repository)

resolver

public Resolver resolver()
Create a resolver.

Parameters: resource

Returns: