Interface RepositoryAdmin
- All Known Implementing Classes:
RepositoryAdminImpl
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 Capabilities 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 fulfilled 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 $
-
Method Summary
Modifier and TypeMethodDescriptionaddRepository
(String repository) Add a new repository to the federation.addRepository
(URL repository) Add a new repository to the federation.Resource[]
discoverResources
(String filterExpr) Discover any resources that match the given filter.Resource[]
discoverResources
(Requirement[] requirements) Discover any resources that match the given requirements.Return a helper to perform various operations on the data modelReturn the repository containing locally installed resourcesReturn the repository containing the system bundleList all the repositories.boolean
removeRepository
(String repository) Remove a repository from the federation The url must point to a repository XML file.resolver()
Create a resolver.resolver
(Repository[] repositories) Create a resolver on the given repositories.
-
Method Details
-
discoverResources
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.
- Throws:
org.osgi.framework.InvalidSyntaxException
-
discoverResources
Discover any resources that match the given requirements.- Parameters:
requirements
-- Returns:
- List of resources matching the filter
-
resolver
Resolver resolver()Create a resolver.- Returns:
-
resolver
Create a resolver on the given repositories.- Parameters:
repositories
- the list of repositories to use for the resolution- Returns:
-
addRepository
Add a new repository to the federation. The url must point to a repository XML file.- Parameters:
repository
-- Returns:
- Throws:
Exception
-
addRepository
Add a new repository to the federation. The url must point to a repository XML file.- Parameters:
repository
-- Returns:
- Throws:
Exception
-
removeRepository
Remove a repository from the federation The url must point to a repository XML file.- Parameters:
repository
-- Returns:
-
listRepositories
Repository[] listRepositories()List all the repositories.- Returns:
-
getSystemRepository
Repository getSystemRepository()Return the repository containing the system bundle- Returns:
-
getLocalRepository
Repository getLocalRepository()Return the repository containing locally installed resources- Returns:
-
getHelper
DataModelHelper getHelper()Return a helper to perform various operations on the data model- Returns:
-