Package de.guh.plugin.ldap
Class LDAPFilter
- java.lang.Object
-
- de.guh.plugin.ldap.LDAPFilter
-
public class LDAPFilter extends Object
Provides a class representing an LDAP filter.
-
-
Field Summary
Fields Modifier and Type Field Description static String
expression_EQUAL
Defines an "equal" filterstatic String
expression_GREATERANDEQUAL
Defines a "greater and equal" filterstatic String
expression_LESSANDEQUAL
Defines a "less and equal" filterstatic String
expression_NOTEQUAL
Defines a "not equal" filterstatic String
prefix_AND
Defines an "and" prefixstatic String
prefix_OR
Defines an "or" filter
-
Constructor Summary
Constructors Constructor Description LDAPFilter(LDAPAttribute attribute, String expression, String value)
Instantiates a new LDAPFilter object with an associatedLDAPAttribute
, a filter expression and a value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getFilter()
Returns the resulting LDAP filter string constructed of the provided values.String
getPrefix()
void
setPrefix(String prefix)
Sets the filter's prefix to one of the valuesprefix_AND
orprefix_OR
.
-
-
-
Field Detail
-
expression_EQUAL
public static String expression_EQUAL
Defines an "equal" filter
-
expression_GREATERANDEQUAL
public static String expression_GREATERANDEQUAL
Defines a "greater and equal" filter
-
expression_LESSANDEQUAL
public static String expression_LESSANDEQUAL
Defines a "less and equal" filter
-
expression_NOTEQUAL
public static String expression_NOTEQUAL
Defines a "not equal" filter
-
prefix_AND
public static String prefix_AND
Defines an "and" prefix
-
prefix_OR
public static String prefix_OR
Defines an "or" filter
-
-
Constructor Detail
-
LDAPFilter
public LDAPFilter(LDAPAttribute attribute, String expression, String value)
Instantiates a new LDAPFilter object with an associatedLDAPAttribute
, a filter expression and a value. The filter expression can be one of the defined values:expression_EQUAL
,expression_GREATERANDEQUAL
, orexpression_NOTEQUAL
.- Parameters:
attribute
- the attribute to be filtered forexpression
- one of the provided expressions used to compare the value to the attribute's value when filtering, e.g.expression_EQUAL
value
- the value of the attribute to be filtered for
-
-
Method Detail
-
getPrefix
public String getPrefix()
- Returns:
- the filter's prefix if set, unset value is ""
-
setPrefix
public void setPrefix(String prefix)
Sets the filter's prefix to one of the valuesprefix_AND
orprefix_OR
. Unknown values will be set toprefix_AND
.- Parameters:
prefix
- the prefix to be set
-
getFilter
public String getFilter()
Returns the resulting LDAP filter string constructed of the provided values. E.g. for attribute with name "attrName", value set to "val" and expression set toexpression_EQUAL
this will result in "(attrName=val)".- Returns:
- the LDAP filter string
-
-