Class RepositoryAdminImpl
- java.lang.Object
-
- org.apache.felix.bundlerepository.impl.RepositoryAdminImpl
-
- All Implemented Interfaces:
RepositoryAdmin
public class RepositoryAdminImpl extends java.lang.Object implements RepositoryAdmin
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEXTERN_REPOSITORY_TAGstatic java.lang.StringREPOSITORY_URL_PROP
-
Constructor Summary
Constructors Constructor Description RepositoryAdminImpl(org.osgi.framework.BundleContext context, org.apache.felix.utils.log.Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RepositoryaddRepository(java.lang.String uri)Add a new repository to the federation.RepositoryaddRepository(java.net.URL url)Add a new repository to the federation.RepositoryImpladdRepository(java.net.URL url, int hopCount)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.voiddispose()DataModelHelpergetHelper()Return a helper to perform various operations on the data modelRepositorygetLocalRepository()Return the repository containing locally installed resourcesRepositorygetSystemRepository()Return the repository containing the system bundleRepository[]listRepositories()List all the repositories.booleanremoveRepository(java.lang.String uri)Remove a repository from the federation The url must point to a repository XML file.Resolverresolver()Create a resolver.Resolverresolver(Repository[] repositories)Create a resolver on the given repositories.
-
-
-
Field Detail
-
REPOSITORY_URL_PROP
public static final java.lang.String REPOSITORY_URL_PROP
- See Also:
- Constant Field Values
-
EXTERN_REPOSITORY_TAG
public static final java.lang.String EXTERN_REPOSITORY_TAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getHelper
public DataModelHelper getHelper()
Description copied from interface:RepositoryAdminReturn a helper to perform various operations on the data model- Specified by:
getHelperin interfaceRepositoryAdmin- Returns:
-
getLocalRepository
public Repository getLocalRepository()
Description copied from interface:RepositoryAdminReturn the repository containing locally installed resources- Specified by:
getLocalRepositoryin interfaceRepositoryAdmin- Returns:
-
getSystemRepository
public Repository getSystemRepository()
Description copied from interface:RepositoryAdminReturn the repository containing the system bundle- Specified by:
getSystemRepositoryin interfaceRepositoryAdmin- Returns:
-
dispose
public void dispose()
-
addRepository
public Repository addRepository(java.lang.String uri) throws java.lang.Exception
Description copied from interface:RepositoryAdminAdd a new repository to the federation. The url must point to a repository XML file.- Specified by:
addRepositoryin interfaceRepositoryAdmin- Returns:
- Throws:
java.lang.Exception
-
addRepository
public Repository addRepository(java.net.URL url) throws java.lang.Exception
Description copied from interface:RepositoryAdminAdd a new repository to the federation. The url must point to a repository XML file.- Specified by:
addRepositoryin interfaceRepositoryAdmin- Returns:
- Throws:
java.lang.Exception
-
addRepository
public RepositoryImpl addRepository(java.net.URL url, int hopCount) throws java.lang.Exception
- Throws:
java.lang.Exception
-
removeRepository
public boolean removeRepository(java.lang.String uri)
Description copied from interface:RepositoryAdminRemove a repository from the federation The url must point to a repository XML file.- Specified by:
removeRepositoryin interfaceRepositoryAdmin- Returns:
-
listRepositories
public Repository[] listRepositories()
Description copied from interface:RepositoryAdminList all the repositories.- Specified by:
listRepositoriesin interfaceRepositoryAdmin- Returns:
-
resolver
public Resolver resolver()
Description copied from interface:RepositoryAdminCreate a resolver.- Specified by:
resolverin interfaceRepositoryAdmin- Returns:
-
resolver
public Resolver resolver(Repository[] repositories)
Description copied from interface:RepositoryAdminCreate a resolver on the given repositories.- Specified by:
resolverin interfaceRepositoryAdmin- Parameters:
repositories- the list of repositories to use for the resolution- Returns:
-
discoverResources
public Resource[] discoverResources(java.lang.String filterExpr) throws org.osgi.framework.InvalidSyntaxException
Description copied from interface:RepositoryAdminDiscover 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
- Specified by:
discoverResourcesin interfaceRepositoryAdmin- Parameters:
filterExpr- A standard OSGi filter- Returns:
- List of resources matching the filters.
- Throws:
org.osgi.framework.InvalidSyntaxException
-
discoverResources
public Resource[] discoverResources(Requirement[] requirements)
Description copied from interface:RepositoryAdminDiscover any resources that match the given requirements.- Specified by:
discoverResourcesin interfaceRepositoryAdmin- Returns:
- List of resources matching the filter
-
-