Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.net.policies
Class AndPolicy

java.lang.Object
  extended by com.jivesoftware.forum.net.policies.AndPolicy
All Implemented Interfaces:
AcceptPolicy

public class AndPolicy
extends java.lang.Object
implements AcceptPolicy

Performs a basic logical AND evaluation on child policies (both must evaluate to true in order for this policy to evaluate true).

This policy is useful for combining simpler policies to create complex policy decisions. The comparison is done using the logical AND operation so if the first policy evaluates to false, the second policy is not evaluated.


Constructor Summary
AndPolicy(AcceptPolicy firstPolicy, AcceptPolicy secondPolicy)
          Create an AND policy with the given two child policies.
 
Method Summary
 boolean evaluate(Connection connection)
          Enforce an AND comparison of the two policies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndPolicy

public AndPolicy(AcceptPolicy firstPolicy,
                 AcceptPolicy secondPolicy)

Create an AND policy with the given two child policies.

Parameters:
firstPolicy - the first policy that will be evaluated.
secondPolicy - the first policy that will be evaluated.
Method Detail

evaluate

public boolean evaluate(Connection connection)

Enforce an AND comparison of the two policies.

Specified by:
evaluate in interface AcceptPolicy
Parameters:
connection - the connection being evaluated by the two policies.
Returns:
true if both policies evaluate to true.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.