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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Repository
addRepository(java.lang.String repository)
Add a new repository to the federation.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[]
discoverResources(Requirement[] requirements)
Discover any resources that match the given requirements.DataModelHelper
getHelper()
Return a helper to perform various operations on the data modelRepository
getLocalRepository()
Return the repository containing locally installed resourcesRepository
getSystemRepository()
Return the repository containing the system bundleRepository[]
listRepositories()
List all the repositories.boolean
removeRepository(java.lang.String repository)
Remove a repository from the federation The url must point to a repository XML file.Resolver
resolver()
Create a resolver.Resolver
resolver(Repository[] repositories)
Create a resolver on the given repositories.
-
-
-
Method Detail
-
discoverResources
Resource[] discoverResources(java.lang.String filterExpr) throws org.osgi.framework.InvalidSyntaxException
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
Resource[] discoverResources(Requirement[] requirements)
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
Resolver resolver(Repository[] repositories)
Create a resolver on the given repositories.- Parameters:
repositories
- the list of repositories to use for the resolution- Returns:
-
addRepository
Repository addRepository(java.lang.String 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
-
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.lang.String repository)
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:
-
-