kaos.policy.util
Class KAoSPolicyBuilderImpl

java.lang.Object
  extended by kaos.policy.util.KAoSPolicyBuilderImpl

public class KAoSPolicyBuilderImpl
extends java.lang.Object

Class building an Ontology (DAML or OWL) Policy representation within com.hp.hpl.jena.ontology.OntModel


Constructor Summary
KAoSPolicyBuilderImpl()
           
KAoSPolicyBuilderImpl(PolicyMsg msg)
          Constructor.
 
Method Summary
 KAoSConditionBuilder getConditionActionClass()
          Get the condition action.
 KAoSRoleValueMapContainer getConditionActionRVMContainer()
           
 KAoSClassBuilderImpl getControlsActionClass()
          Get the action that is controlled (authorized or not authorized) by this policy.
 KAoSRoleValueMapContainer getControlsActionRVMContainer()
           
 java.lang.String getHasSiteOfEnforcement()
          Get the site of enforcment for the current policy.
 java.lang.String getModalityType()
          Get the value of the modality type for the current policy.
 ObligationConstraintsBuilder getObligationConstraints()
          set the obligation constraints for this policy
 OntologyPolicyContainer getPolicy()
          Return the built policy as OntModels in a container.
 java.lang.String getPolicyAsText()
          Return the built policy as text.
 java.lang.String getPolicyDesc()
          Get the value of the policy description for the current policy.
 java.lang.String getPolicyID()
          Get the id of the current policy.
 java.lang.String getPolicyName()
          Get the value of the policy name for the current policy.
 KAoSRoleValueMapContainer getPolicyRVMContainer()
           
 int getPriority()
          Get the priority for the current policy.
 KAoSClassBuilderImpl getTriggerActionClass()
          Get the trigger action which make this policy applicable.
 KAoSRoleValueMapContainer getTriggerActionRVMContainer()
           
 java.lang.Long getUpdateTimeStamp()
          Get the value of the time stamp for the current policy.
 void readConditionFromConditionContainer(OntologyConditionContainer occ)
           
 void readControlActionFromModel(SerializableOntModelImpl dm, java.lang.String classURI)
           
 void readObligationConstraintsFromModel(SerializableOntModelImpl dm, java.lang.String classURI)
           
 void readPolicyFromModel(SerializableOntModelImpl dm)
          A method to recreate a DAMLPolicyBuilder object by reading from a DAMLModel object
 void readTriggerActionFromModel(SerializableOntModelImpl dm, java.lang.String classURI)
           
 void resetPolicyBuilding()
          Starts building the new policy, delete any existing state of the previously build policy.
 void setConditionActionClass(KAoSConditionBuilder condition)
          Set the condition action of this policy.
 void setControlsActionClass(KAoSClassBuilderImpl controls)
          Set the action that is controlled (authorized or not authorized) by this policy.
 void setControlsActionRVMContainer(KAoSRoleValueMapContainer container)
           
 void setHasSiteOfEnforcement(java.lang.String _siteName)
          Set the site of enforcment for the build policy.
 void setObligationConstraints(ObligationConstraintsBuilder ocb)
          set the obligation constraints for this policy
 void setPolicyDesc(java.lang.String desc)
          Set the description of the defined policy.
 void setPolicyIDAndModalityType(java.lang.String policyID, java.lang.String modalityType)
          Set the ID of the defined policy and its modality type.
 void setPolicyName(java.lang.String pName)
          Set the name of the defined policy.
 void setPriority(int priority)
          Set the priority of the defined policy.
 void setTriggerActionClass(KAoSClassBuilderImpl trigger)
          Set the action that will make this policy applicable (will 'trigger' this policy into being applied).
 void setTriggerActionRVMContainer(KAoSRoleValueMapContainer container)
           
 void showPolicy()
          A utility method to print the policy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KAoSPolicyBuilderImpl

public KAoSPolicyBuilderImpl()

KAoSPolicyBuilderImpl

public KAoSPolicyBuilderImpl(PolicyMsg msg)
Constructor. Constructs this object from a PolicyMsg that contains models for policy data and its actions

Method Detail

resetPolicyBuilding

public void resetPolicyBuilding()
Starts building the new policy, delete any existing state of the previously build policy.


getPolicy

public OntologyPolicyContainer getPolicy()
                                  throws PolicyBuildingNotCompleted
Return the built policy as OntModels in a container.

Returns:
SerializableOntModelImpl containg the Ontology policy
Throws:
PolicyBuildingNotCompleted - if the current policy is not fully specified

getPolicyAsText

public java.lang.String getPolicyAsText()
Return the built policy as text.

Returns:
string containg the DAML policy
Throws:
PolicyBuildingNotCompleted - if the current policy is not fully specified

getUpdateTimeStamp

public java.lang.Long getUpdateTimeStamp()
                                  throws ValueNotSet
Get the value of the time stamp for the current policy.

Returns:
the value of the time stamp
Throws:
ValueNotSet - if value of the time stamp is not known

setPolicyIDAndModalityType

public void setPolicyIDAndModalityType(java.lang.String policyID,
                                       java.lang.String modalityType)
                                throws SpecifiedModalityTypeNotExists
Set the ID of the defined policy and its modality type. Currently there is no method to change the ID and the modality type of the policy; in this case a new policy should be build or the current policy reset.

Parameters:
policyName - the name of the policy
modalityType - the name (url) of the class representing the modality type of policy, one of: PosAuthorizationPolicy NegAuthorizationPolicy PosObligationPolicy NegObligationPolicy
Throws:
SpecifiedModalityTypeNotExists - if the modality type does not exist
See Also:
kaos.ontology.PolicyConcepts

getPolicyID

public java.lang.String getPolicyID()
                             throws ValueNotSet
Get the id of the current policy.

Returns:
the id of the policy
Throws:
ValueNotSet - if value of the policy ID is not known

getPolicyRVMContainer

public KAoSRoleValueMapContainer getPolicyRVMContainer()
Returns:
the container with role-value-map constraints for Policy Class

getModalityType

public java.lang.String getModalityType()
                                 throws ValueNotSet
Get the value of the modality type for the current policy.

Returns:
the name of the modality type
Throws:
ValueNotSet - if value of the modalitytype is not known

setPolicyName

public void setPolicyName(java.lang.String pName)
Set the name of the defined policy. If the name is already set, it will be replaced by the given name. NOTE : The name of the policy and the ID of the policy are two seperate entities. The name can be changed, but currently, the ID can't be.

Parameters:
pName - the name of the policy

getPolicyName

public java.lang.String getPolicyName()
                               throws ValueNotSet
Get the value of the policy name for the current policy.

Returns:
the name of the policy
Throws:
ValueNotSet - if value of the modalitytype is not known

setPolicyDesc

public void setPolicyDesc(java.lang.String desc)
Set the description of the defined policy. If the desc is already set, it will be replaced by the given desc.

Parameters:
desc - description of the policy

getPolicyDesc

public java.lang.String getPolicyDesc()
                               throws ValueNotSet
Get the value of the policy description for the current policy.

Returns:
the description of the policy
Throws:
ValueNotSet - if value of the modalitytype is not known

setPriority

public void setPriority(int priority)
                 throws PriorityNotValid,
                        PolicyNameNotSet
Set the priority of the defined policy. If the priority is already set, it will be replaced by the given value.

Parameters:
priority - priority of the policy
Throws:
PriorityNotValid
PolicyNameNotSet

getPriority

public int getPriority()
                throws ValueNotSet
Get the priority for the current policy.

Returns:
the value of the priority
Throws:
ValueNotSet - if value of the priority is not known

setHasSiteOfEnforcement

public void setHasSiteOfEnforcement(java.lang.String _siteName)
                             throws PolicyNameNotSet,
                                    SiteOfEnforcementTypeNotExists
Set the site of enforcment for the build policy. If the site of enforcment is already set it will replace its value with the provided value.

Parameters:
_siteName - the name (url) of the class representing the site of policy enforcment, currently one of: ActorSite TargetSite AnySite
Throws:
PolicyNameNotSet - if the name of the policy was not set yet; the construction of the policy was not really started
SpecifiedSiteOfEnforcementTypeNotExists - if the value of the site of enforcement does not exist
SiteOfEnforcementTypeNotExists
See Also:
kaos.ontology.PolicyConcepts

getHasSiteOfEnforcement

public java.lang.String getHasSiteOfEnforcement()
                                         throws ValueNotSet
Get the site of enforcment for the current policy.

Returns:
the name of the site of enformcment
Throws:
ValueNotSet - if value of the site of enforcment is not known

setControlsActionClass

public void setControlsActionClass(KAoSClassBuilderImpl controls)
Set the action that is controlled (authorized or not authorized) by this policy. If the action is already set, it will be replaced by the given one.

Parameters:
controls - the action to be controlled

getControlsActionClass

public KAoSClassBuilderImpl getControlsActionClass()
Get the action that is controlled (authorized or not authorized) by this policy.

Returns:
the action that is controlled

setControlsActionRVMContainer

public void setControlsActionRVMContainer(KAoSRoleValueMapContainer container)

getControlsActionRVMContainer

public KAoSRoleValueMapContainer getControlsActionRVMContainer()
Returns:
the container with role-value-map constraints for Control Action

setTriggerActionClass

public void setTriggerActionClass(KAoSClassBuilderImpl trigger)
Set the action that will make this policy applicable (will 'trigger' this policy into being applied). If the action is already set, it will be replaced by the given one.

Parameters:
trigger - the triggering action

getTriggerActionClass

public KAoSClassBuilderImpl getTriggerActionClass()
Get the trigger action which make this policy applicable.

Returns:
the trigger action

getTriggerActionRVMContainer

public KAoSRoleValueMapContainer getTriggerActionRVMContainer()
Returns:
the container with role-value-map constraints for Trigger Action

setTriggerActionRVMContainer

public void setTriggerActionRVMContainer(KAoSRoleValueMapContainer container)

setConditionActionClass

public void setConditionActionClass(KAoSConditionBuilder condition)
Set the condition action of this policy. If the action is already set, it will be replaced by the given one.

Parameters:
condition - the condition action

getConditionActionClass

public KAoSConditionBuilder getConditionActionClass()
Get the condition action.

Returns:
the condition action

getConditionActionRVMContainer

public KAoSRoleValueMapContainer getConditionActionRVMContainer()
Returns:
the container with role-value-map constraints for Condition Action

setObligationConstraints

public void setObligationConstraints(ObligationConstraintsBuilder ocb)
set the obligation constraints for this policy


getObligationConstraints

public ObligationConstraintsBuilder getObligationConstraints()
set the obligation constraints for this policy


showPolicy

public void showPolicy()
A utility method to print the policy.


readPolicyFromModel

public void readPolicyFromModel(SerializableOntModelImpl dm)
A method to recreate a DAMLPolicyBuilder object by reading from a DAMLModel object

Parameters:
dm - the model from which to read

readControlActionFromModel

public void readControlActionFromModel(SerializableOntModelImpl dm,
                                       java.lang.String classURI)

readTriggerActionFromModel

public void readTriggerActionFromModel(SerializableOntModelImpl dm,
                                       java.lang.String classURI)

readConditionFromConditionContainer

public void readConditionFromConditionContainer(OntologyConditionContainer occ)

readObligationConstraintsFromModel

public void readObligationConstraintsFromModel(SerializableOntModelImpl dm,
                                               java.lang.String classURI)