"WEBNMS_5 API Docs"

com.adventnet.management.policydb
Interface PolicyCondition

All Superinterfaces:
java.io.Serializable

public interface PolicyCondition
extends java.io.Serializable

This class stipulates a condition for the execution of a Policy. A policy can be executed on successful satisfaction of a condition. This interface has been introduced to enable the execution of a policy when it satisfies a given set of conditions. When the condtion is satisfied the corressponding action is invoked/called (the PolicyAction). The condition and its corresponding action share a common key. This key (a unique string)helps identify/correlate a condition to an action. Thus, a(time,condition) can now be specified to execute policy. The use of PolicyCondition interface and PolicyAction interface helps in handling the condition and action separately,if required.


Method Summary
 java.lang.String getKey()
          Returns the key of this PolicyCondition.
 boolean isConditionSatisfied(PolicyEvent pt)
          Returns whether the condition is satisfied or not.
 

Method Detail

isConditionSatisfied

boolean isConditionSatisfied(PolicyEvent pt)
Returns whether the condition is satisfied or not. The PolicyEventobject contains a list of policies that are to be executed.

Parameters:
pt - PolicyEvent
Returns:
boolean to represent success or failure

getKey

java.lang.String getKey()
Returns the key of this PolicyCondition. A common key value is shared between the condition and its corresponding action. The key can be any unique string.

The default implementation of the PolicyObject will do a PolicyCondition.isConditionSatisfied(PolicyEvent) and then if true call the corresponding PolicyAction, The actions corresponding to this condition should have the same key as this.

Returns:
key of this PolicyCondition

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.