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.String
EXTERN_REPOSITORY_TAG
private org.osgi.framework.BundleContext
m_context
private DataModelHelper
m_helper
private boolean
m_initialized
private LocalRepositoryImpl
m_local
private org.apache.felix.utils.log.Logger
m_logger
private java.util.Comparator
m_nameComparator
private java.util.Map
m_repoMap
private SystemRepositoryImpl
m_system
static java.lang.String
REPOSITORY_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 Repository
addRepository(java.lang.String uri)
Add a new repository to the federation.Repository
addRepository(java.net.URL url)
Add a new repository to the federation.RepositoryImpl
addRepository(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.void
dispose()
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 bundleprivate void
initialize()
Repository[]
listRepositories()
List all the repositories.boolean
removeRepository(java.lang.String uri)
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.
-
-
-
Field Detail
-
m_context
private final org.osgi.framework.BundleContext m_context
-
m_logger
private final org.apache.felix.utils.log.Logger m_logger
-
m_system
private final SystemRepositoryImpl m_system
-
m_local
private final LocalRepositoryImpl m_local
-
m_helper
private final DataModelHelper m_helper
-
m_repoMap
private java.util.Map m_repoMap
-
m_initialized
private boolean m_initialized
-
m_nameComparator
private java.util.Comparator m_nameComparator
-
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:RepositoryAdmin
Return a helper to perform various operations on the data model- Specified by:
getHelper
in interfaceRepositoryAdmin
- Returns:
-
getLocalRepository
public Repository getLocalRepository()
Description copied from interface:RepositoryAdmin
Return the repository containing locally installed resources- Specified by:
getLocalRepository
in interfaceRepositoryAdmin
- Returns:
-
getSystemRepository
public Repository getSystemRepository()
Description copied from interface:RepositoryAdmin
Return the repository containing the system bundle- Specified by:
getSystemRepository
in interfaceRepositoryAdmin
- Returns:
-
dispose
public void dispose()
-
addRepository
public Repository addRepository(java.lang.String uri) throws java.lang.Exception
Description copied from interface:RepositoryAdmin
Add a new repository to the federation. The url must point to a repository XML file.- Specified by:
addRepository
in interfaceRepositoryAdmin
- Returns:
- Throws:
java.lang.Exception
-
addRepository
public Repository addRepository(java.net.URL url) throws java.lang.Exception
Description copied from interface:RepositoryAdmin
Add a new repository to the federation. The url must point to a repository XML file.- Specified by:
addRepository
in 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:RepositoryAdmin
Remove a repository from the federation The url must point to a repository XML file.- Specified by:
removeRepository
in interfaceRepositoryAdmin
- Returns:
-
listRepositories
public Repository[] listRepositories()
Description copied from interface:RepositoryAdmin
List all the repositories.- Specified by:
listRepositories
in interfaceRepositoryAdmin
- Returns:
-
resolver
public Resolver resolver()
Description copied from interface:RepositoryAdmin
Create a resolver.- Specified by:
resolver
in interfaceRepositoryAdmin
- Returns:
-
resolver
public Resolver resolver(Repository[] repositories)
Description copied from interface:RepositoryAdmin
Create a resolver on the given repositories.- Specified by:
resolver
in 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:RepositoryAdmin
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
- Specified by:
discoverResources
in 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:RepositoryAdmin
Discover any resources that match the given requirements.- Specified by:
discoverResources
in interfaceRepositoryAdmin
- Returns:
- List of resources matching the filter
-
initialize
private void initialize()
-
-