Base class to make it easier to implement Search.
More...
Inherits Org.IdentityConnectors.Framework.Common.Objects.Filters.FilterTranslator< T >.
|
virtual T | CreateAndExpression (T leftExpression, T rightExpression) |
| Should be overridden by subclasses to create an AND expression if the native resource supports AND. More...
|
|
virtual T | CreateOrExpression (T leftExpression, T rightExpression) |
| Should be overridden by subclasses to create an OR expression if the native resource supports OR. More...
|
|
virtual T | CreateContainsExpression (ContainsFilter filter, bool not) |
| Should be overridden by subclasses to create a CONTAINS expression if the native resource supports CONTAINS. More...
|
|
virtual T | CreateContainsIgnoreCaseExpression (ContainsIgnoreCaseFilter filter, bool not) |
| Should be overridden by subclasses to create a CONTAINS expression if the native resource supports CONTAINS. More...
|
|
virtual T | CreateEndsWithExpression (EndsWithFilter filter, bool not) |
| Should be overridden by subclasses to create a ENDS-WITH expression if the native resource supports ENDS-WITH. More...
|
|
virtual T | CreateEndsWithIgnoreCaseExpression (EndsWithIgnoreCaseFilter filter, bool not) |
| Should be overridden by subclasses to create a ENDS-WITH expression if the native resource supports ENDS-WITH. More...
|
|
virtual T | CreateEqualsExpression (EqualsFilter filter, bool not) |
| Should be overridden by subclasses to create a EQUALS expression if the native resource supports EQUALS. More...
|
|
virtual T | CreateEqualsIgnoreCaseExpression (EqualsIgnoreCaseFilter filter, bool not) |
| Should be overridden by subclasses to create a EQUALS expression if the native resource supports EQUALS. More...
|
|
virtual T | CreateGreaterThanExpression (GreaterThanFilter filter, bool not) |
| Should be overridden by subclasses to create a GREATER-THAN expression if the native resource supports GREATER-THAN. More...
|
|
virtual T | CreateGreaterThanOrEqualExpression (GreaterThanOrEqualFilter filter, bool not) |
| Should be overridden by subclasses to create a GREATER-THAN-EQUAL expression if the native resource supports GREATER-THAN-EQUAL. More...
|
|
virtual T | CreateLessThanExpression (LessThanFilter filter, bool not) |
| Should be overridden by subclasses to create a LESS-THAN expression if the native resource supports LESS-THAN. More...
|
|
virtual T | CreateLessThanOrEqualExpression (LessThanOrEqualFilter filter, bool not) |
| Should be overridden by subclasses to create a LESS-THAN-EQUAL expression if the native resource supports LESS-THAN-EQUAL. More...
|
|
virtual T | CreateStartsWithExpression (StartsWithFilter filter, bool not) |
| Should be overridden by subclasses to create a STARTS-WITH expression if the native resource supports STARTS-WITH. More...
|
|
virtual T | CreateStartsWithIgnoreCaseExpression (StartsWithIgnoreCaseFilter filter, bool not) |
| Should be overridden by subclasses to create a STARTS-WITH expression if the native resource supports STARTS-WITH. More...
|
|
virtual T | CreateContainsAllValuesExpression (ContainsAllValuesFilter filter, bool not) |
|
virtual
AbstractFilterTranslator< T > | CreateEmbeddedObjectFilterTranslator (String attributeName) |
| Should be overridden by subclasses to create an instance of More...
|
|
Base class to make it easier to implement Search.
A search filter may contain operators (such as 'contains' or 'in') or may contain logical operators (such as 'AND', 'OR' or 'NOT') that a connector cannot implement using the native API of the target system or application. A connector developer should subclass
in order to declare which filter operations the connector does support. This allows the
instance to analyze a specified search filter and reduce the filter to its most efficient form. The default (and worst-case) behavior is to return a null expression, which means that the connector should return "everything" (that is, should return all values for every requested attribute) and rely on the common code in the framework to perform filtering. This "fallback" behavior is good (in that it ensures consistency of search behavior across connector implementations) but it is obviously better for performance and scalability if each connector performs as much filtering as the native API of the target can support.
A subclass should override each of the following methods where possible:
-
CreateAndExpression
-
CreateOrExpression
-
CreateContainsExpression(ContainsFilter, bool)
-
CreateEndsWithExpression(EndsWithFilter, bool)
-
CreateEqualsExpression(EqualsFilter, bool)
-
CreateGreaterThanExpression(GreaterThanFilter, bool)
-
CreateGreaterThanOrEqualExpression(GreaterThanOrEqualFilter, bool)
-
CreateStartsWithExpression(StartsWithFilter, bool)
Translation can then be performed using Translate(Filter).
- Template Parameters
-
T | The result type of the translator. Commonly this will be a string, but there are cases where you might need to return a more complex data structure. For example if you are building a SQL query, you will need not just the base WHERE clause but a list of tables that need to be joined together. |
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateAndExpression |
( |
T |
leftExpression, |
|
|
T |
rightExpression |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create an AND expression if the native resource supports AND.
- Parameters
-
leftExpression | The left expression. Will never be null. |
rightExpression | The right expression. Will never be null. |
- Returns
- The AND expression. A return value of null means a native AND query cannot be created for the given expressions. In this case, the resulting query will consist of the leftExpression only.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateContainsExpression |
( |
ContainsFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a CONTAINS expression if the native resource supports CONTAINS.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT CONTAINS |
- Returns
- The CONTAINS expression. A return value of null means a native CONTAINS query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateContainsIgnoreCaseExpression |
( |
ContainsIgnoreCaseFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a CONTAINS expression if the native resource supports CONTAINS.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT CONTAINS |
- Returns
- The CONTAINS expression. A return value of null means a native CONTAINS query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
virtual AbstractFilterTranslator<T> Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateEmbeddedObjectFilterTranslator |
( |
String |
attributeName | ) |
|
|
protectedvirtual |
Should be overridden by subclasses to create an instance of
AbstractFilterTranslator
that will be used to translate the filter of an EmbeddedObjectFilter.
- Parameters
-
- Returns
- an instance of
AbstractFilterTranslator
.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateEndsWithExpression |
( |
EndsWithFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a ENDS-WITH expression if the native resource supports ENDS-WITH.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT ENDS-WITH |
- Returns
- The ENDS-WITH expression. A return value of null means a native ENDS-WITH query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateEndsWithIgnoreCaseExpression |
( |
EndsWithIgnoreCaseFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a ENDS-WITH expression if the native resource supports ENDS-WITH.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT ENDS-WITH |
- Returns
- The ENDS-WITH expression. A return value of null means a native ENDS-WITH query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateEqualsExpression |
( |
EqualsFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a EQUALS expression if the native resource supports EQUALS.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT EQUALS |
- Returns
- The EQUALS expression. A return value of null means a native EQUALS query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateEqualsIgnoreCaseExpression |
( |
EqualsIgnoreCaseFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a EQUALS expression if the native resource supports EQUALS.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT EQUALS |
- Returns
- The EQUALS expression. A return value of null means a native EQUALS query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateGreaterThanExpression |
( |
GreaterThanFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a GREATER-THAN expression if the native resource supports GREATER-THAN.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT GREATER-THAN |
- Returns
- The GREATER-THAN expression. A return value of null means a native GREATER-THAN query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateGreaterThanOrEqualExpression |
( |
GreaterThanOrEqualFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a GREATER-THAN-EQUAL expression if the native resource supports GREATER-THAN-EQUAL.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT GREATER-THAN-EQUAL |
- Returns
- The GREATER-THAN-EQUAL expression. A return value of null means a native GREATER-THAN-EQUAL query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateLessThanExpression |
( |
LessThanFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a LESS-THAN expression if the native resource supports LESS-THAN.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT LESS-THAN |
- Returns
- The LESS-THAN expression. A return value of null means a native LESS-THAN query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateLessThanOrEqualExpression |
( |
LessThanOrEqualFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a LESS-THAN-EQUAL expression if the native resource supports LESS-THAN-EQUAL.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT LESS-THAN-EQUAL |
- Returns
- The LESS-THAN-EQUAL expression. A return value of null means a native LESS-THAN-EQUAL query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateOrExpression |
( |
T |
leftExpression, |
|
|
T |
rightExpression |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create an OR expression if the native resource supports OR.
- Parameters
-
leftExpression | The left expression. Will never be null. |
rightExpression | The right expression. Will never be null. |
- Returns
- The OR expression. A return value of null means a native OR query cannot be created for the given expressions. In this case, Translate may return multiple queries, each of which must be run and results combined.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateStartsWithExpression |
( |
StartsWithFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a STARTS-WITH expression if the native resource supports STARTS-WITH.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT STARTS-WITH |
- Returns
- The STARTS-WITH expression. A return value of null means a native STARTS-WITH query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
virtual T Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.CreateStartsWithIgnoreCaseExpression |
( |
StartsWithIgnoreCaseFilter |
filter, |
|
|
bool |
not |
|
) |
| |
|
protectedvirtual |
Should be overridden by subclasses to create a STARTS-WITH expression if the native resource supports STARTS-WITH.
- Parameters
-
filter | The contains filter. Will never be null. |
not | True if this should be a NOT STARTS-WITH |
- Returns
- The STARTS-WITH expression. A return value of null means a native STARTS-WITH query cannot be created for the given filter. In this case, Translate may return an empty query set, meaning fetch everything. The filter will be re-applied in memory to the resulting object stream. This does not scale well, so if possible, you should implement this method.
IList<T> Org.IdentityConnectors.Framework.Common.Objects.Filters.AbstractFilterTranslator< T >.Translate |
( |
Filter |
filter | ) |
|
Main method to be called to translate a filter
- Parameters
-
filter | The filter to translate. |
- Returns
- The list of queries to be performed. The list
size()
may be one of the following:
-
0 - This signifies fetch everything. This may occur if your filter was null or one of your
create*
methods returned null.
-
1 - List contains a single query that will return the results from the filter. Note that the results may be a superset of those specified by the filter in the case that one of your
create*
methods returned null. That is OK from a behavior standpoint since ConnectorFacade
performs a second level of filtering. However it is undesirable from a performance standpoint.
-
>1 - List contains multiple queries that must be performed in order to meet the filter that was passed in. Note that this only occurs if your CreateOrExpression method can return null. If this happens, it is the responsibility of the connector implementor to perform each query and combine the results. In order to eliminate duplicates, the connector implementation must keep an in-memory
HashSet
of those UID that have been visited thus far. This will not scale well if your result sets are large. Therefore it is recommended that if at all possible you implement CreateOrExpression
Implements Org.IdentityConnectors.Framework.Common.Objects.Filters.FilterTranslator< T >.
The documentation for this class was generated from the following file:
- C:/ADE/icfbuild_docgen/icf/framework/.ade_path/dotnet/Framework/CommonObjectsFilter.cs