ponderEnforcement.ponderMC.policyObjects
Class EnforcementObject

java.lang.Object
  |
  +--ponderEnforcement.ponderMC.policyObjects.EnforcementObject
Direct Known Subclasses:
ObligEnforcementObject, RefrainEnforcementObject

public class EnforcementObject
extends java.lang.Object

Function:Models an Enforcement Object, the superclass of all enforcement objects (i.e. obligation and refrain).


Field Summary
protected  ConstraintHandler constraintHandler
           
protected  java.lang.String name
          Fields
protected  int state
           
 
Constructor Summary
EnforcementObject(java.lang.String newName, BasicPolicyI newPolicyObj, PonderMCimpl pmc)
          Constructor
 
Method Summary
 java.util.Vector checkConstraints(PonderEventI event)
          The method to check the constraints of this policy.
 void disable()
          Disable the policy
 void enable()
          Enable the policy
 java.lang.String getName()
           
 int getState()
          Get State
 java.lang.String getStateStr()
          Get State as a String
 boolean isEnabled()
          Return true if enabled, false otherwise
 void setState(int newState)
          Set State
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Fields

state

protected int state

constraintHandler

protected ConstraintHandler constraintHandler
Constructor Detail

EnforcementObject

public EnforcementObject(java.lang.String newName,
                         BasicPolicyI newPolicyObj,
                         PonderMCimpl pmc)
Constructor
Parameters:
newName - The name of the policy object
policyObj - The policy object associated with this Enforcement Object
Method Detail

getName

public java.lang.String getName()
Returns:
The name of the policy

enable

public void enable()
Enable the policy

disable

public void disable()
Disable the policy

getState

public int getState()
Get State

getStateStr

public java.lang.String getStateStr()
Get State as a String

setState

public void setState(int newState)
Set State

isEnabled

public boolean isEnabled()
Return true if enabled, false otherwise

checkConstraints

public java.util.Vector checkConstraints(PonderEventI event)
The method to check the constraints of this policy. It accepts Event as a parameter in order to get any parameters that the event may be passing to the policy and are required by the constraint. It returns ALLOW or DISALLOW. DISALLOW if constraints prevent this policy from executing. ALLOW if constraints do not evaluate to true