org.apache.felix.bundlerepository.impl
Class RepositoryAdminImpl

java.lang.Object
  extended by org.apache.felix.bundlerepository.impl.RepositoryAdminImpl
All Implemented Interfaces:
RepositoryAdmin

public class RepositoryAdminImpl
extends java.lang.Object
implements RepositoryAdmin


Field Summary
static java.lang.String EXTERN_REPOSITORY_TAG
           
static java.lang.String REPOSITORY_URL_PROP
           
 
Constructor Summary
RepositoryAdminImpl(org.osgi.framework.BundleContext context, org.apache.felix.utils.log.Logger logger)
           
 
Method Summary
 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(Requirement[] requirements)
          Discover any resources that match the given requirements.
 Resource[] discoverResources(java.lang.String filterExpr)
          Discover any resources that match the given filter.
 void dispose()
           
 DataModelHelper getHelper()
          Return a helper to perform various operations on the data model
 Repository getLocalRepository()
          Return the repository containing locally installed resources
 Repository getSystemRepository()
          Return the repository containing the system bundle
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
Constructor Detail

RepositoryAdminImpl

public RepositoryAdminImpl(org.osgi.framework.BundleContext context,
                           org.apache.felix.utils.log.Logger logger)
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 interface RepositoryAdmin
Returns:

getLocalRepository

public Repository getLocalRepository()
Description copied from interface: RepositoryAdmin
Return the repository containing locally installed resources

Specified by:
getLocalRepository in interface RepositoryAdmin
Returns:

getSystemRepository

public Repository getSystemRepository()
Description copied from interface: RepositoryAdmin
Return the repository containing the system bundle

Specified by:
getSystemRepository in interface RepositoryAdmin
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 interface RepositoryAdmin
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 interface RepositoryAdmin
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 interface RepositoryAdmin
Returns:

listRepositories

public Repository[] listRepositories()
Description copied from interface: RepositoryAdmin
List all the repositories.

Specified by:
listRepositories in interface RepositoryAdmin
Returns:

resolver

public Resolver resolver()
Description copied from interface: RepositoryAdmin
Create a resolver.

Specified by:
resolver in interface RepositoryAdmin
Returns:

resolver

public Resolver resolver(Repository[] repositories)
Description copied from interface: RepositoryAdmin
Create a resolver on the given repositories.

Specified by:
resolver in interface RepositoryAdmin
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:
  1. name
  2. version (uses filter matching rules)
  3. description
  4. category
  5. copyright
  6. license
  7. source

Specified by:
discoverResources in interface RepositoryAdmin
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 interface RepositoryAdmin
Returns:
List of resources matching the filter


Copyright © 2011. All Rights Reserved.