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
     Repository addRepository(java.net.URL repository)
              Add a new repository to the federation.
     Resource[] discoverResources(java.lang.String filterExpr)
              Discover any resources that match the given filter.
     Resource getResource(java.lang.String respositoryId)
               
     Repository[] listRepositories()
              List all the repositories.
     boolean removeRepository(java.net.URL repository)
               
     Resolver resolver()
              Create a resolver.
     

    Method Detail

    discoverResources

    Resource[] discoverResources(java.lang.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.

    resolver

    Resolver resolver()
    Create a resolver.

    Parameters:
    resource -
    Returns:

    addRepository

    Repository addRepository(java.net.URL repository)
                             throws java.lang.Exception
    Add a new repository to the federation. The url must point to a repository XML file.

    Parameters:
    repository -
    Returns:
    Throws:
    java.lang.Exception

    removeRepository

    boolean removeRepository(java.net.URL repository)

    listRepositories

    Repository[] listRepositories()
    List all the repositories.

    Returns:

    getResource

    Resource getResource(java.lang.String respositoryId)