IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.continuousquery.filter
Class AbstractCQFilter<KeyType,ValueType,AttributeType,MatchType>

java.lang.Object
  extended by com.ibm.websphere.objectgrid.continuousquery.filter.AbstractCQFilter<KeyType,ValueType,AttributeType,MatchType>
Type Parameters:
KeyType - Type of the key object for the map being queried
ValueType - Type of the value object for the map being queried
AttributeType - Type of the attribute referenced by the attribute path
MatchType - Type of the object being compared to
All Implemented Interfaces:
ContinuousQueryFilter<KeyType,ValueType,AttributeType,MatchType>, Serializable
Direct Known Subclasses:
BinaryLogicalFilter, CompareFilter, FalseFilter, IsNotNullFilter, IsNullFilter, NotFilter, TrueFilter

public abstract class AbstractCQFilter<KeyType,ValueType,AttributeType,MatchType>
extends Object
implements ContinuousQueryFilter<KeyType,ValueType,AttributeType,MatchType>

This is an abstract class which all continuous query filters must extend. It defines how cached entries should be compared and filtered. All subclasses must provide a no-argument constructor for serialization purposes.

Since:
8.6
See Also:
Serialized Form

Field Summary
protected  int version
          Version of the filter implementation, which can be used internally for backward compatibility.
 
Fields inherited from interface com.ibm.websphere.objectgrid.continuousquery.ContinuousQueryFilter
POJO_ADDRESSABLEKEYNAME, POJO_PATHSEPARATOR
 
Constructor Summary
AbstractCQFilter()
           
 
Method Summary
abstract  String createString()
          Creates a string representation of the continuous query filter, this method is used by toString().
 boolean equals(Object obj)
           
protected  Object getAttribute(FilterContent content, String attributePath)
          Retrieves an attribute from the content that is to be filtered based on the specified attribute path.
 int hashCode()
           
 boolean isKeyFilter()
           
 String toString()
           
protected  void validateAttributePath(String attributePath)
          Ensure that attribute path used to retrieve an attribute from a cache entry is valid.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.websphere.objectgrid.continuousquery.ContinuousQueryFilter
filter
 

Field Detail

version

protected int version
Version of the filter implementation, which can be used internally for backward compatibility. The version can be used to, for example, determine what filtering logic should be used, how serialization/inflation should be done, etc. Version 1 filters are shipped with WebSphere eXtreme Scale 8.6.0.0.

Constructor Detail

AbstractCQFilter

public AbstractCQFilter()
Method Detail

isKeyFilter

public boolean isKeyFilter()

createString

public abstract String createString()
Creates a string representation of the continuous query filter, this method is used by toString().

The string will be used for identifying and comparing filters, i.e. it will be used in hashCode() and equals(Object), so the returned value must be in unique format among all filters in the system.

Returns:
an unique string representation of the filter

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

validateAttributePath

protected void validateAttributePath(String attributePath)
                              throws ContinuousQueryAttributePathException
Ensure that attribute path used to retrieve an attribute from a cache entry is valid.

Parameters:
attributePath - the path to the attribute
Throws:
ContinuousQueryAttributePathException

getAttribute

protected Object getAttribute(FilterContent content,
                              String attributePath)
                       throws ContinuousQueryException
Retrieves an attribute from the content that is to be filtered based on the specified attribute path.

Parameters:
content - The cache entry (key and value) to be processed by this filter
attributePath - the path specifying the attribute of this cache entry to be examined. For a description of attribute paths, @see CompareFilter#CompareFilter(String, Object)
Returns:
the attribute specified by the attributePath, extracted from the cache entry represented by the FilterContent instance.
Throws:
ContinuousQueryException

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.