atg.scenario.filter
Class Filter

java.lang.Object
  extended by atg.scenario.filter.Filter
Direct Known Subclasses:
ExpressionFilter

Deprecated. This class has been deprecated in favour of atg.process.filter.Filter

public abstract class Filter
extends java.lang.Object

An abstract base class for all scenario filters.

See Also:
Filter

Field Summary
static java.lang.String CLASS_VERSION
          Deprecated. Class version string
static Filter FALSE
          Deprecated. Filter which represents false
static Filter TRUE
          Deprecated. Filter which represents true
 
Constructor Summary
Filter()
          Deprecated.  
 
Method Summary
static Filter andFilters(Filter[] pFilters)
          Deprecated. Returns a filter which is obtained by ANDing the filters in the given array.
static Filter andFilters(Filter pFilter1, Filter pFilter2)
          Deprecated. Returns a filter which is obtained by ANDing the two given filters.
 Filter assumeFalse(Filter pFalseFilter)
          Deprecated. Assumes that the given filter evaluates to FALSE, and tries to simplify this filter.
 Filter assumeTrue(Filter pTrueFilter)
          Deprecated. Assumes that the given filter evaluates to TRUE, and tries to simplify this filter.
 Query createProfileQuery(QueryBuilder pProfileQueryBuilder)
          Deprecated. Creates a repository query which can be used to find all the profiles that satisfy the filter.
 Query createScenarioInstanceQuery(QueryBuilder pProfileQueryBuilder, QueryBuilder pScenarioInstanceQueryBuilder)
          Deprecated. Creates a repository query which can be used to find all the individual scenario instances that satisfy the filter.
protected abstract  Filter evaluate(ScenarioExecutionContext pContext)
          Deprecated. Evaluates this filter in the given scenario execution context.
 java.lang.String getProfileType()
          Deprecated. If this filter has profile-related conditions any of which assume a particular profile type, returns that type.
 boolean implies(Filter pFilter)
          Deprecated. Returns true if this filter implies the given filter - that is, if this filter evaluates to TRUE, the given filter must also evaluate to TRUE.
 Filter negate()
          Deprecated. Returns a filter which is obtained by negating this filter.
static Filter orFilters(Filter[] pFilters)
          Deprecated. Returns a filter which is obtained by ORing the filters in the given array.
static Filter orFilters(Filter pFilter1, Filter pFilter2)
          Deprecated. Returns a filter which is obtained by ORing the two given filters.
 Filter test(ScenarioExecutionContext pContext)
          Deprecated. Calls evaluate on this filter, and returns one of the following values: Filter.TRUE - if evaluate returned Filter.TRUE Filter.FALSE - if evaluate returned Filter.FALSE or null this or another, simplified, Filter - in all other cases
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Deprecated. 
Class version string


TRUE

public static final Filter TRUE
Deprecated. 
Filter which represents true


FALSE

public static final Filter FALSE
Deprecated. 
Filter which represents false

Constructor Detail

Filter

public Filter()
Deprecated. 
Method Detail

evaluate

protected abstract Filter evaluate(ScenarioExecutionContext pContext)
                            throws ScenarioException
Deprecated. 
Evaluates this filter in the given scenario execution context. The context may not yet contain all of the information necessary to evaluate the filter - specifically, it may be missing the particular scenario instance and/or profile that the scenario is being executed on. If that is the case, the filter is evaluated as much as possible, and the simplified filter is returned.

The possible return values of this method are as follows:

Throws:
ScenarioException - if there is a problem evaluating the filter (other than information missing from the context)

test

public Filter test(ScenarioExecutionContext pContext)
            throws ScenarioException
Deprecated. 
Calls evaluate on this filter, and returns one of the following values:

In other words, this method is different from evaluate only in that null values are treated instead as Filter.FALSE.

Throws:
ScenarioException - if there is a problem evaluating the filter (other than information missing from the context)

getProfileType

public java.lang.String getProfileType()
                                throws ScenarioException
Deprecated. 
If this filter has profile-related conditions any of which assume a particular profile type, returns that type. If the filter has no profile-related conditions, or if all such conditions apply to the base profile type, returns null.

The default implementation returns null.

Throws:
ScenarioException - if there is a problem determining the profile type

createProfileQuery

public Query createProfileQuery(QueryBuilder pProfileQueryBuilder)
                         throws RepositoryException,
                                ScenarioException
Deprecated. 
Creates a repository query which can be used to find all the profiles that satisfy the filter. Returns null if no profiles can satisfy this filter.

This method will only be called on filters which have already been evaluated (by calling evaluate). Thus, the only subclasses which need to override this method are those which have conditions that contribute to the repository query (i.e., profile-related conditions). The default implementation throws a ScenarioException.

Throws:
RepositoryException - if there is a repository problem constructing the query
ScenarioException - if there is any other problem creating the query

createScenarioInstanceQuery

public Query createScenarioInstanceQuery(QueryBuilder pProfileQueryBuilder,
                                         QueryBuilder pScenarioInstanceQueryBuilder)
                                  throws RepositoryException,
                                         ScenarioException
Deprecated. 
Creates a repository query which can be used to find all the individual scenario instances that satisfy the filter. Returns null if no scenario instances can satisfy this filter.

This method will only be called on filters which have already been evaluated (by calling evaluate). Thus, the only subclasses which need to override this method are those which have conditions that contribute to the repository query (i.e., profile- or scenario instance-related conditions). The default implementation throws a ScenarioException.

Throws:
RepositoryException - if there is a repository problem constructing the query
ScenarioException - if there is any other problem creating the query

andFilters

public static Filter andFilters(Filter pFilter1,
                                Filter pFilter2)
Deprecated. 
Returns a filter which is obtained by ANDing the two given filters.


andFilters

public static Filter andFilters(Filter[] pFilters)
Deprecated. 
Returns a filter which is obtained by ANDing the filters in the given array.


orFilters

public static Filter orFilters(Filter pFilter1,
                               Filter pFilter2)
Deprecated. 
Returns a filter which is obtained by ORing the two given filters.


orFilters

public static Filter orFilters(Filter[] pFilters)
Deprecated. 
Returns a filter which is obtained by ORing the filters in the given array.


negate

public Filter negate()
Deprecated. 
Returns a filter which is obtained by negating this filter.


assumeTrue

public Filter assumeTrue(Filter pTrueFilter)
Deprecated. 
Assumes that the given filter evaluates to TRUE, and tries to simplify this filter.


assumeFalse

public Filter assumeFalse(Filter pFalseFilter)
Deprecated. 
Assumes that the given filter evaluates to FALSE, and tries to simplify this filter.


implies

public boolean implies(Filter pFilter)
Deprecated. 
Returns true if this filter implies the given filter - that is, if this filter evaluates to TRUE, the given filter must also evaluate to TRUE. For example, this returns true if this filter is "(gender=Male)&(age=Young)" and the given filter is "age=Young."