Knopflerfish OSGi 2.4.0

org.ungoverned.osgi.service.bundlerepository
Interface BundleRepositoryService


public interface BundleRepositoryService

This interface defines a simple bundle repository service for Oscar.


Method Summary
 boolean deployBundle(java.io.PrintStream out, java.io.PrintStream err, java.lang.String updateLocation, boolean isResolve, boolean isStart)
          Deploys the bundle in the repository that corresponds to the specified update location.
 BundleRecord getBundleRecord(int i)
          Get the specified bundle record from the repository.
 BundleRecord getBundleRecord(java.lang.String name, int[] version)
          Get bundle record for the bundle with the specified name and version from the repository.
 int getBundleRecordCount()
          Get the number of bundles available in the repository.
 BundleRecord[] getBundleRecords(java.lang.String name)
          Get all versions of bundle records for the specified name from the repository.
 java.lang.String[] getRepositoryURLs()
          Get URL list of repositories.
 BundleRecord[] resolvePackages(PackageDeclaration[] pkgs)
          Returns an array containing all bundle records in the repository that resolve the transitive closure of the passed in array of package declarations.
 void setRepositoryURLs(java.lang.String[] urls)
          Set URL list of repositories.
 

Method Detail

getRepositoryURLs

java.lang.String[] getRepositoryURLs()
Get URL list of repositories.

Returns:
a space separated list of URLs to use or null to refresh the cached list of bundles.

setRepositoryURLs

void setRepositoryURLs(java.lang.String[] urls)
Set URL list of repositories.

Parameters:
urls - a space separated list of URLs to use or null to refresh the cached list of bundles.

getBundleRecordCount

int getBundleRecordCount()
Get the number of bundles available in the repository.

Returns:
the number of available bundles.

getBundleRecord

BundleRecord getBundleRecord(int i)
Get the specified bundle record from the repository.

Parameters:
i - the bundle record index to retrieve.
Returns:
the associated bundle record or null.

getBundleRecord

BundleRecord getBundleRecord(java.lang.String name,
                             int[] version)
Get bundle record for the bundle with the specified name and version from the repository.

Parameters:
name - the bundle record name to retrieve.
version - three-interger array of the version associated with the name to retrieve.
Returns:
the associated bundle record or null.

getBundleRecords

BundleRecord[] getBundleRecords(java.lang.String name)
Get all versions of bundle records for the specified name from the repository.

Parameters:
name - the bundle record name to retrieve.
Returns:
an array of all versions of bundle records having the specified name or null.

deployBundle

boolean deployBundle(java.io.PrintStream out,
                     java.io.PrintStream err,
                     java.lang.String updateLocation,
                     boolean isResolve,
                     boolean isStart)
Deploys the bundle in the repository that corresponds to the specified update location. The action taken depends on whether the specified bundle is already installed in the local framework. If the bundle is already installed, then this method will attempt to update it. If the bundle is not already installed, then this method will attempt to install it.

Parameters:
out - the stream to use for informational messages.
err - the stream to use for error messages.
updateLocation - the update location of the bundle to deploy.
isResolve - a flag to indicates whether dependencies should should be resolved.
isStart - a flag to indicate whether installed bundles should be started.
Returns:
true if successful, false otherwise.

resolvePackages

BundleRecord[] resolvePackages(PackageDeclaration[] pkgs)
                               throws ResolveException
Returns an array containing all bundle records in the repository that resolve the transitive closure of the passed in array of package declarations.

Parameters:
pkgs - an array of package declarations to resolve.
Returns:
an array containing all bundle records in the repository that resolve the transitive closure of the passed in array of package declarations.
Throws:
ResolveException - if any packages in the transitive closure of packages cannot be resolved.

Knopflerfish OSGi 2.4.0