kaos.policy.information
Class PolicyDBManagerImpl

java.lang.Object
  extended by kaos.policy.information.PolicyDBManagerImpl
All Implemented Interfaces:
PolicyDBManager

public class PolicyDBManagerImpl
extends java.lang.Object
implements PolicyDBManager

This interface defines methods to manage policy database


Constructor Summary
PolicyDBManagerImpl()
           
 
Method Summary
 void addPolicy(PolicyInformation policy)
          Add the given policy object to this database.
 java.util.List getActionSubclassesOfInterest()
          This method returns all the subclasses of actions of all policies in this database, along with the original action class name.
 java.util.Enumeration getAllPolicies()
          Get all policy objects contained in this database.
 java.util.List getClassRangesOfInterest()
          This method returns all the classranges of properties of all policies in this database.
 PolicyInformation getPolicyInformation(java.lang.String policyID)
          Get the policy for the given policy id.
 java.util.List getPropretiesOfInterest()
          This method returns all the properties and their subproperties of all policies contained in this database.
 java.util.Enumeration getSortedAuthorizationPolicies()
          Get only authorization policy objects contained in this database.
 java.util.Enumeration getSortedObligationPolicies()
          Get only obligation policy objects contained in this database.
 void refreshAllPoliciesComplete()
          refresh all cached property values for all policies in this database.
 void refreshAllPoliciesPartial(java.util.Vector properties)
          refresh cached values of only those properties that are specified for all the policies in this database.
 void refreshPolicyComplete(java.lang.String policyID)
          refresh all cached property values for the given policy.
 void refreshPolicyPartial(java.lang.String policyID, java.util.Vector properties)
          refresh cached values of only those properties that are specified for the given policy.
 void refreshSpecifiedPoliciesComplete(java.util.Vector policyIDs)
          refresh cached values of all properties of the specified policies.
 void refreshSpecifiedPoliciesPartial(java.util.Vector policyIDs, java.util.Vector properties)
          refresh cached values of only those properties that are specified for only specified policies.
 void removeAllPolicies()
          remove all policy objects contained in this database.
 PolicyInformation removePolicyInformation(java.lang.String policyID)
          Remove from this database the policy object for the given policy id.
 void setDirProxy(KAoSAgentDirectoryServiceProxy dcomm)
           
 void setPolicy(PolicyInformation policy)
          Set the policy object.
 void updateActionSubclasses(java.lang.String className, java.util.Collection subclasses)
          to update the subclasses of an action class in policies.
 void updateInstanceOfClass(java.lang.String className, java.util.Collection instances)
          update cached instances of the given class in concerned policies.
 void updateSubpropertiesOfProperty(java.lang.String propName, java.util.Collection subProps)
          update cached subproperties of the given property in concerned policies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicyDBManagerImpl

public PolicyDBManagerImpl()
Method Detail

setDirProxy

public void setDirProxy(KAoSAgentDirectoryServiceProxy dcomm)

getPolicyInformation

public PolicyInformation getPolicyInformation(java.lang.String policyID)
Get the policy for the given policy id.

Specified by:
getPolicyInformation in interface PolicyDBManager
Parameters:
policyID - A String indicating the policy id.
Returns:
The policy object for the given policy name.

removePolicyInformation

public PolicyInformation removePolicyInformation(java.lang.String policyID)
Remove from this database the policy object for the given policy id.

Specified by:
removePolicyInformation in interface PolicyDBManager
Parameters:
policyID - A String indicating the policy id.
Returns:
The removed policy object.

setPolicy

public void setPolicy(PolicyInformation policy)
Set the policy object. This is the same as calling addPolicy.

Specified by:
setPolicy in interface PolicyDBManager
Parameters:
policy - The policy object to be set

addPolicy

public void addPolicy(PolicyInformation policy)
Add the given policy object to this database. If the policy for the policy id contained in this object already exists, it will be replaced by this object. If not, a new entry will be created.

Specified by:
addPolicy in interface PolicyDBManager
Parameters:
policy - The policy object to be added.

getAllPolicies

public java.util.Enumeration getAllPolicies()
Get all policy objects contained in this database.

Specified by:
getAllPolicies in interface PolicyDBManager
Returns:
A Vector containing all policy objects.

getSortedAuthorizationPolicies

public java.util.Enumeration getSortedAuthorizationPolicies()
Get only authorization policy objects contained in this database.

Returns:
An Enumeration containing authorization policy objects in descending order

getSortedObligationPolicies

public java.util.Enumeration getSortedObligationPolicies()
Get only obligation policy objects contained in this database.

Returns:
An Enumeration containing obligation policy objects in descending order

removeAllPolicies

public void removeAllPolicies()
remove all policy objects contained in this database.

Specified by:
removeAllPolicies in interface PolicyDBManager

refreshPolicyComplete

public void refreshPolicyComplete(java.lang.String policyID)
refresh all cached property values for the given policy.

Specified by:
refreshPolicyComplete in interface PolicyDBManager
Parameters:
policyID - A String indicating the policy id.

refreshPolicyPartial

public void refreshPolicyPartial(java.lang.String policyID,
                                 java.util.Vector properties)
refresh cached values of only those properties that are specified for the given policy.

Specified by:
refreshPolicyPartial in interface PolicyDBManager
Parameters:
policyID - A String indicating the policy id.
properties - A Vector containing property names whose values are to be refreshed.

refreshAllPoliciesComplete

public void refreshAllPoliciesComplete()
refresh all cached property values for all policies in this database.

Specified by:
refreshAllPoliciesComplete in interface PolicyDBManager

refreshAllPoliciesPartial

public void refreshAllPoliciesPartial(java.util.Vector properties)
refresh cached values of only those properties that are specified for all the policies in this database.

Specified by:
refreshAllPoliciesPartial in interface PolicyDBManager
Parameters:
properties - A Vector containing property names whose values are to be refreshed.

refreshSpecifiedPoliciesComplete

public void refreshSpecifiedPoliciesComplete(java.util.Vector policyIDs)
refresh cached values of all properties of the specified policies.

Specified by:
refreshSpecifiedPoliciesComplete in interface PolicyDBManager
Parameters:
policyIDs - A Vector containing ids of those policies that are to be refreshed.

refreshSpecifiedPoliciesPartial

public void refreshSpecifiedPoliciesPartial(java.util.Vector policyIDs,
                                            java.util.Vector properties)
refresh cached values of only those properties that are specified for only specified policies.

Specified by:
refreshSpecifiedPoliciesPartial in interface PolicyDBManager
Parameters:
policyIDs - A Vector containing ids of those policies that are to be refreshed.
properties - A Vector containing property names whose values are to be refreshed.

updateSubpropertiesOfProperty

public void updateSubpropertiesOfProperty(java.lang.String propName,
                                          java.util.Collection subProps)
update cached subproperties of the given property in concerned policies.

Parameters:
propertyName - the property whose subproperties are to be updated.
subProps - the new subproperties.

updateInstanceOfClass

public void updateInstanceOfClass(java.lang.String className,
                                  java.util.Collection instances)
update cached instances of the given class in concerned policies.

Parameters:
className - the class whose instances are to be updated.
instances - the new instances.

updateActionSubclasses

public void updateActionSubclasses(java.lang.String className,
                                   java.util.Collection subclasses)
to update the subclasses of an action class in policies.

Parameters:
className - the action class whose subclasses are updated
subclasses - the collection of updated subclasses

getPropretiesOfInterest

public java.util.List getPropretiesOfInterest()
This method returns all the properties and their subproperties of all policies contained in this database. This excludes _actor and _action properties because they don't have subproperties, only subclasses.


getClassRangesOfInterest

public java.util.List getClassRangesOfInterest()
This method returns all the classranges of properties of all policies in this database. This excludes _action property because it doesn't have a class range.


getActionSubclassesOfInterest

public java.util.List getActionSubclassesOfInterest()
This method returns all the subclasses of actions of all policies in this database, along with the original action class name.