Nitido Inc.

com.nitido.nimx.nuggets.iplanetset
Class FilterCondition

java.lang.Object
  extended by com.nitido.nimx.nuggets.iplanetset.FilterCondition

public class FilterCondition
extends java.lang.Object

The data object of a filter condition.

Each filter condition is composed of three parts:

  1. Key
  2. Comparator
  3. Value
The key is the identifier of what the condition is going to compare to. This implementation support the following valid key values
Constant Name Display As Description Actual Key Stored Supported Comparator Valid Values
KEY_TO To ["To","Cc","Bcc","Resent-to","Resent-cc","Resent-bcc"] COMP_CONTAINS, COMP_BEGINS_WITH, COMP_ENDS_WITH, COMP_MATCHES, COMP_EXACT, COMP_EXISTS Any string. If your "exact" value contains characters "*", "?" or """, make sure you escape them by perpending "\\" before the character.
KEY_FROM From ["From","Sender","Resent-from","Resent-sender","Return-path"] COMP_CONTAINS, COMP_BEGINS_WITH, COMP_ENDS_WITH, COMP_MATCHES, COMP_EXACT, COMP_EXISTS Any string. If your "exact" value contains characters "*", "?" or """, make sure you escape them by perpending "\\" before the character.
KEY_SUBJECT Subject ["Subject","Comments","Keywords"] COMP_CONTAINS, COMP_BEGINS_WITH, COMP_ENDS_WITH, COMP_MATCHES, COMP_EXACT, COMP_EXISTS Any string. If your "exact" value contains characters "*", "?" or """, make sure you escape them by perpending "\\" before the character.
KEY_PRIORITY Priority The priority of email ["X-Priority","X-MSMail-Priority"] COMP_BEGINS_WITH 1 to 5, where 1 is highest priority
KEY_SIZE Size This is a pseudo key to indicate we are comparing the size. - no real key stored - COMP_OVER, COMP_UNDER An integer number that can follows the quantifier "K", "M" or "G". (which stands for Kilo, Mega and Giga). If no quantifier is specified, it assumes the unit to be octet.
- - You may also specify any key identifier that complies RFC 3028 - -

The comparator identify what kind of relationship that we are evaluating between the key and value. The valid comparators are:

Constant Name Display As Actual Comparator Stored Additional action
COMP_CONTAINS contains header :contains -
COMP_BEGINS_WITH begins with header :matches prepends "*" before the value.
COMP_ENDS_WITH ends with header :matches appends "*" after the value.
COMP_MATCHES matches header :matches -
COMP_EXACT is exactly header :is -
COMP_OVER over size :over -
COMP_UNDER under size :under -
COMP_EXISTS exists exists -


Field Summary
protected  java.lang.String _comparator
           
protected  boolean _isPositive
           
protected  java.lang.String _key
           
protected  java.lang.String _value
           
static java.lang.String COMP_BEGINS_WITH
           
static java.lang.String COMP_CONTAINS
           
static java.lang.String COMP_ENDS_WITH
           
static java.lang.String COMP_EXACT
           
static java.lang.String COMP_EXISTS
           
static java.lang.String COMP_MATCHES
           
static java.lang.String COMP_OVER
           
static java.lang.String COMP_UNDER
           
static java.lang.String KEY_FROM
           
static java.lang.String KEY_PRIORITY
           
static java.lang.String KEY_SIZE
           
static java.lang.String KEY_SUBJECT
           
static java.lang.String KEY_TO
           
 
Constructor Summary
FilterCondition(boolean isPositive, java.lang.String key, java.lang.String comparator, java.lang.String value)
          Default constructor.
FilterCondition(java.lang.String ldapStr)
          Parser constructor.
 
Method Summary
 java.lang.String getComparator()
           
 boolean getIsPositive()
           
 java.lang.String getKey()
           
 java.lang.String getValue()
           
 void setComparator(java.lang.String comparator)
           
 void setIsPositive(boolean isPositive)
           
 void setKey(java.lang.String key)
           
 void setValue(java.lang.String value)
           
 java.lang.String toLdapString()
          Returns the string that is actually stored to LDAP.
 java.lang.String toString()
          Returns the displayable representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_isPositive

protected boolean _isPositive

_key

protected java.lang.String _key

_comparator

protected java.lang.String _comparator

_value

protected java.lang.String _value

KEY_FROM

public static final java.lang.String KEY_FROM
See Also:
Constant Field Values

KEY_TO

public static final java.lang.String KEY_TO
See Also:
Constant Field Values

KEY_SUBJECT

public static final java.lang.String KEY_SUBJECT
See Also:
Constant Field Values

KEY_SIZE

public static final java.lang.String KEY_SIZE
See Also:
Constant Field Values

KEY_PRIORITY

public static final java.lang.String KEY_PRIORITY
See Also:
Constant Field Values

COMP_CONTAINS

public static final java.lang.String COMP_CONTAINS
See Also:
Constant Field Values

COMP_BEGINS_WITH

public static final java.lang.String COMP_BEGINS_WITH
See Also:
Constant Field Values

COMP_ENDS_WITH

public static final java.lang.String COMP_ENDS_WITH
See Also:
Constant Field Values

COMP_MATCHES

public static final java.lang.String COMP_MATCHES
See Also:
Constant Field Values

COMP_EXACT

public static final java.lang.String COMP_EXACT
See Also:
Constant Field Values

COMP_OVER

public static final java.lang.String COMP_OVER
See Also:
Constant Field Values

COMP_UNDER

public static final java.lang.String COMP_UNDER
See Also:
Constant Field Values

COMP_EXISTS

public static final java.lang.String COMP_EXISTS
See Also:
Constant Field Values
Constructor Detail

FilterCondition

public FilterCondition(boolean isPositive,
                       java.lang.String key,
                       java.lang.String comparator,
                       java.lang.String value)
Default constructor. This is what a developer would use.

Parameters:
isPositive - indicates whether this condition is evaluated as is. If this parameter is set to false, the condition will be evaluated as the opposite value.

key - the key string. This is the display key string (i.e. the shorter version).

comparator - A string object of the comparator.

value - The value of the evaluation.


FilterCondition

public FilterCondition(java.lang.String ldapStr)
Parser constructor. This constructor is usually used by the Nugget to constructor the FilterCondition from the string returned from the backend storage.

Parameters:
ldapStr - The string from the storage. This string should have all the special command key words and separator removed.
Method Detail

setKey

public void setKey(java.lang.String key)

getKey

public java.lang.String getKey()

setComparator

public void setComparator(java.lang.String comparator)

getComparator

public java.lang.String getComparator()

setValue

public void setValue(java.lang.String value)

getValue

public java.lang.String getValue()

setIsPositive

public void setIsPositive(boolean isPositive)

getIsPositive

public boolean getIsPositive()

toString

public java.lang.String toString()
Returns the displayable representation of this object. The output format is
 key comparator "value"
 

Overrides:
toString in class java.lang.Object

toLdapString

public java.lang.String toLdapString()
Returns the string that is actually stored to LDAP.


Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.