com.ibm.websphere.brb.query
Class EndDateNode

java.lang.Object
  extended bycom.ibm.websphere.brb.query.QueryNode
      extended bycom.ibm.websphere.brb.query.AttributeNode
          extended bycom.ibm.websphere.brb.query.AbstractDateNode
              extended bycom.ibm.websphere.brb.query.EndDateNode
All Implemented Interfaces:
java.io.Serializable

public class EndDateNode
extends AbstractDateNode

Allows the endDate attribute of a rule to be queried. An EndDateNode is given a date for which to search and a constant describing the comparison operation to perform on the given date. These constants are defined in superclass AbstractDateNode. The following example finds all rules that end on January 31, 2001 at midnight:

    IRuleFolder root = RuleMgmtHelper.getRootFolder();
    java.util.Date date = new Date(2001, 01, 31); // defaults to midnight
    EndDateNode endDateNode = new EndDateNode(date, AbstractDateNode.EQUAL);
    Collection collection = root.findRules(endDateNode, true, IRule.TYPE_REFERENCE);
 
The following example finds all rules that end anytime on January 31, 2001:
    IRuleFolder root = RuleMgmtHelper.getRootFolder(); 
    java.util.Date beginDate = new Date(2001, 01, 31);
    java.util.Date endDate = new Date(2001, 02, 01);
    EndDateNode beginDateNode = new EndDateNode(beginDate, AbstractDateNode.AFTER_INCLUSIVE);
    EndDateNode endDateNode = new EndDateNode(endDate, AbstractDateNode.BEFORE_EXCLUSIVE);
    AndNode andNode = new AndNode(beginDateNode, endDateNode);
    Collection collection = root.findRules(andNode, true, IRule.TYPE_REFERENCE);
 
These nodes can be combined with other QueryNodes by using an AndNode or an OrNode.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.websphere.brb.query.AbstractDateNode
AFTER_EXCLUSIVE, AFTER_INCLUSIVE, BEFORE_EXCLUSIVE, BEFORE_INCLUSIVE, EQUAL, IS_NOT_NULL, IS_NULL, NOT_EQUAL
 
Constructor Summary
EndDateNode(java.util.Date searchDateIn, int comparisonOpIn)
          Constructs an EndDateNode that will search for an end date matching searchDate with the given date comparison operator (see the constants defined in AbstractDateNode).
 
Methods inherited from class com.ibm.websphere.brb.query.AbstractDateNode
buildWhereClause
 
Methods inherited from class com.ibm.websphere.brb.query.QueryNode
getWhereClause, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EndDateNode

public EndDateNode(java.util.Date searchDateIn,
                   int comparisonOpIn)
Constructs an EndDateNode that will search for an end date matching searchDate with the given date comparison operator (see the constants defined in AbstractDateNode). Unless the operator is IS_NULL or IS_NOT_NULL, the searchDateIn must be non-null. A java.lang.IllegalArgumentException is thrown if this condition is not met.

Parameters:
searchDateIn - The date for which to search.
comparisonOpIn - The type of operation to perform. See the constants defined in this class.
Throws:
java.lang.IllegalArgumentException