com.buglabs.osgi.cm.persistance
Class PersistanceManager

java.lang.Object
  extended by com.buglabs.osgi.cm.persistance.PersistanceManager
All Implemented Interfaces:
IPersistanceManager, java.io.Serializable

public class PersistanceManager
extends java.lang.Object
implements IPersistanceManager, java.io.Serializable

Helper class that aids in persisting, updating and retrieving Configurations

See Also:
Serialized Form

Constructor Summary
PersistanceManager()
           
 
Method Summary
 boolean delete(Configuration config)
          Delete files from storage provided by the Framework
 Configuration retrieve(java.lang.String pid)
          Retrieves Configuration identified by pid
 void store(Configuration config)
          Persists Configuration object to storage provided by the Framework
 void update(java.util.Dictionary properies, Configuration configuration)
          Updates properties of Configuration, if properties is null, all Dictionary values will be removed exception Constants .SERVICE_PID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistanceManager

public PersistanceManager()
Method Detail

delete

public boolean delete(Configuration config)
               throws java.io.IOException
Delete files from storage provided by the Framework

Specified by:
delete in interface IPersistanceManager
Parameters:
pid - id of the Configuration to delete
Returns:
true if Configuration has been removed successfuly, false otherwise
Throws:
java.io.IOException

store

public void store(Configuration config)
           throws java.io.IOException
Persists Configuration object to storage provided by the Framework

Specified by:
store in interface IPersistanceManager
Parameters:
properties -
Throws:
java.io.IOException

retrieve

public Configuration retrieve(java.lang.String pid)
                       throws java.io.IOException,
                              java.lang.ClassNotFoundException
Description copied from interface: IPersistanceManager
Retrieves Configuration identified by pid

Specified by:
retrieve in interface IPersistanceManager
Parameters:
pid - id of the service for which configuration need to be retrieved
Returns:
Returns Configuration for this service
Throws:
java.io.IOException
java.lang.ClassNotFoundException

update

public void update(java.util.Dictionary properies,
                   Configuration configuration)
            throws java.io.IOException,
                   java.lang.ClassNotFoundException
Updates properties of Configuration, if properties is null, all Dictionary values will be removed exception Constants .SERVICE_PID

Specified by:
update in interface IPersistanceManager
Parameters:
configuration - Configuration object properties of which should be updated
Throws:
java.lang.ClassNotFoundException
java.io.IOException