org.knopflerfish.framework.bundlestorage.memory
Class BundleStorageImpl

java.lang.Object
  extended by org.knopflerfish.framework.bundlestorage.memory.BundleStorageImpl
All Implemented Interfaces:
BundleStorage

public class BundleStorageImpl
extends java.lang.Object
implements BundleStorage

Storage of all bundles jar content.


Constructor Summary
BundleStorageImpl()
          Create a container for all bundle data in this framework.
 
Method Summary
 BundleArchive[] getAllBundleArchives()
          Get all bundle archive objects.
 java.util.List getStartOnLaunchBundles()
          Get all bundles tagged to start at next launch of framework.
 BundleArchive insertBundleJar(java.lang.String location, java.io.InputStream is)
          Insert bundle into persistent storage
 void replaceBundleArchive(BundleArchive oldBA, BundleArchive newBA)
          Replace old bundle archive with a new updated bundle archive, that was created with updateBundleArchive.
 void setCheckSigned(boolean value)
          Set if bundles in this storage should check if they are signed.
 BundleArchive updateBundleArchive(BundleArchive old, java.io.InputStream is)
          Insert a new jar file into persistent storagedata as an update to an existing bundle archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleStorageImpl

public BundleStorageImpl()
Create a container for all bundle data in this framework. Try to restore all saved bundle archive state.

Method Detail

insertBundleJar

public BundleArchive insertBundleJar(java.lang.String location,
                                     java.io.InputStream is)
                              throws java.lang.Exception
Insert bundle into persistent storage

Specified by:
insertBundleJar in interface BundleStorage
Parameters:
location - Location of bundle.
is - Inputstrem with bundle content.
Returns:
Bundle archive object.
Throws:
java.lang.Exception

updateBundleArchive

public BundleArchive updateBundleArchive(BundleArchive old,
                                         java.io.InputStream is)
                                  throws java.lang.Exception
Insert a new jar file into persistent storagedata as an update to an existing bundle archive. To commit this data a call to replaceBundleArchive is needed.

Specified by:
updateBundleArchive in interface BundleStorage
Parameters:
old - BundleArchive to be replaced.
is - Inputstrem with bundle content.
Returns:
Bundle archive object.
Throws:
java.lang.Exception

replaceBundleArchive

public void replaceBundleArchive(BundleArchive oldBA,
                                 BundleArchive newBA)
                          throws java.lang.Exception
Replace old bundle archive with a new updated bundle archive, that was created with updateBundleArchive.

Specified by:
replaceBundleArchive in interface BundleStorage
Parameters:
oldBA - BundleArchive to be replaced.
newBA - Inputstrem with bundle content.
Throws:
java.lang.Exception

getAllBundleArchives

public BundleArchive[] getAllBundleArchives()
Get all bundle archive objects.

Specified by:
getAllBundleArchives in interface BundleStorage
Returns:
Private array of all BundleArchives.

getStartOnLaunchBundles

public java.util.List getStartOnLaunchBundles()
Get all bundles tagged to start at next launch of framework. This list is sorted in increasing bundle id order.

Specified by:
getStartOnLaunchBundles in interface BundleStorage
Returns:
Private copy of a List with bundle id's.

setCheckSigned

public void setCheckSigned(boolean value)
Description copied from interface: BundleStorage
Set if bundles in this storage should check if they are signed.

Specified by:
setCheckSigned in interface BundleStorage
Parameters:
value - If true check for certificates.