kaos.policy.management
Class PolicyPersistenceManager

java.lang.Object
  extended by kaos.policy.management.PolicyPersistenceManager
All Implemented Interfaces:
PersistenceManager
Direct Known Subclasses:
DSPersistenceManager, GuardPersistenceManager

public abstract class PolicyPersistenceManager
extends java.lang.Object
implements PersistenceManager


Constructor Summary
PolicyPersistenceManager()
           
PolicyPersistenceManager(PolicyState state)
           
 
Method Summary
 void addPolicies(java.util.List policies)
          A method to add policies to the current state.
 void changePolicies(java.util.List policies)
          A method to change policies in the current state.
 java.util.List getPolicies()
          A method to get all current policies from the state.
 StateObject getState()
           
 void removePolicies(java.util.List policies)
          A method to remove policies from the current state.
abstract  void saveState()
          force the state to be saved immediately
 void setPolicies(java.util.List policies)
          A method to replace all current policies in the state.
 void setState(StateObject state)
          set the current state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicyPersistenceManager

public PolicyPersistenceManager()

PolicyPersistenceManager

public PolicyPersistenceManager(PolicyState state)
Method Detail

getState

public StateObject getState()
Specified by:
getState in interface PersistenceManager
Returns:
the current state

setState

public void setState(StateObject state)
set the current state

Specified by:
setState in interface PersistenceManager

addPolicies

public void addPolicies(java.util.List policies)
A method to add policies to the current state.

Parameters:
policies - a List containing the changed policies.

removePolicies

public void removePolicies(java.util.List policies)
A method to remove policies from the current state.

Parameters:
policies - a List containing the policies to be removed.

changePolicies

public void changePolicies(java.util.List policies)
A method to change policies in the current state. This method is called when policy ids remain the same but their contents are changed.

Parameters:
policies - a List containing the policies to be changed.

setPolicies

public void setPolicies(java.util.List policies)
A method to replace all current policies in the state. In this method all the current policies are removed first and then the given policies are added.

Parameters:
policies - a List containing the policies to replace the current policies.

getPolicies

public java.util.List getPolicies()
A method to get all current policies from the state.

Returns:
a List containing policies

saveState

public abstract void saveState()
force the state to be saved immediately

Specified by:
saveState in interface PersistenceManager