@PublicAPI(stability=UNCOMMITTED, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class SearchFilter extends Object
Constructor and Description |
---|
SearchFilter(FilterType filterType,
Collection<SearchFilter> filterComponents,
SearchFilter notComponent,
org.forgerock.opendj.ldap.AttributeDescription attributeDescription,
org.forgerock.opendj.ldap.ByteString assertionValue,
org.forgerock.opendj.ldap.ByteString subInitialElement,
List<org.forgerock.opendj.ldap.ByteString> subAnyElements,
org.forgerock.opendj.ldap.ByteString subFinalElement,
String matchingRuleID,
boolean dnAttributes)
Creates a new search filter with the provided information.
|
Modifier and Type | Method and Description |
---|---|
static SearchFilter |
createANDFilter(Collection<SearchFilter> filterComponents)
Creates a new AND search filter with the provided information.
|
static SearchFilter |
createApproximateFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
org.forgerock.opendj.ldap.ByteString assertionValue)
Creates an approximate search filter with the provided
information.
|
static SearchFilter |
createApproximateFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
Set<String> attributeOptions,
org.forgerock.opendj.ldap.ByteString assertionValue)
Creates an approximate search filter with the provided
information.
|
static SearchFilter |
createEqualityFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
org.forgerock.opendj.ldap.ByteString assertionValue)
Creates a new equality search filter with the provided
information.
|
static SearchFilter |
createEqualityFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
Set<String> attributeOptions,
org.forgerock.opendj.ldap.ByteString assertionValue)
Creates a new equality search filter with the provided
information.
|
static SearchFilter |
createExtensibleMatchFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
org.forgerock.opendj.ldap.ByteString assertionValue,
String matchingRuleID,
boolean dnAttributes)
Creates an extensible matching filter with the provided
information.
|
static SearchFilter |
createExtensibleMatchFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
Set<String> attributeOptions,
org.forgerock.opendj.ldap.ByteString assertionValue,
String matchingRuleID,
boolean dnAttributes)
Creates an extensible matching filter with the provided
information.
|
static SearchFilter |
createFilterFromString(String filterString)
Decodes the provided filter string as a search filter.
|
static SearchFilter |
createGreaterOrEqualFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
org.forgerock.opendj.ldap.ByteString assertionValue)
Creates a greater-or-equal search filter with the provided
information.
|
static SearchFilter |
createGreaterOrEqualFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
Set<String> attributeOptions,
org.forgerock.opendj.ldap.ByteString assertionValue)
Creates a greater-or-equal search filter with the provided
information.
|
static SearchFilter |
createLessOrEqualFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
org.forgerock.opendj.ldap.ByteString assertionValue)
Creates a less-or-equal search filter with the provided
information.
|
static SearchFilter |
createLessOrEqualFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
Set<String> attributeOptions,
org.forgerock.opendj.ldap.ByteString assertionValue)
Creates a less-or-equal search filter with the provided
information.
|
static SearchFilter |
createNOTFilter(SearchFilter notComponent)
Creates a new NOT search filter with the provided information.
|
static SearchFilter |
createORFilter(Collection<SearchFilter> filterComponents)
Creates a new OR search filter with the provided information.
|
static SearchFilter |
createPresenceFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType)
Creates a presence search filter with the provided information.
|
static SearchFilter |
createPresenceFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
Set<String> attributeOptions)
Creates a presence search filter with the provided information.
|
static SearchFilter |
createSubstringFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
org.forgerock.opendj.ldap.ByteString subInitialElement,
List<org.forgerock.opendj.ldap.ByteString> subAnyElements,
org.forgerock.opendj.ldap.ByteString subFinalElement)
Creates a new substring search filter with the provided
information.
|
static SearchFilter |
createSubstringFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType,
Set<String> attributeOptions,
org.forgerock.opendj.ldap.ByteString subInitialElement,
List<org.forgerock.opendj.ldap.ByteString> subAnyElements,
org.forgerock.opendj.ldap.ByteString subFinalElement)
Creates a new substring search filter with the provided
information.
|
boolean |
equals(Object o)
Indicates whether this search filter is equal to the provided
object.
|
org.forgerock.opendj.ldap.ByteString |
getAssertionValue()
Retrieves the assertion value for this filter.
|
org.forgerock.opendj.ldap.schema.AttributeType |
getAttributeType()
Retrieves the attribute type for this filter.
|
boolean |
getDNAttributes()
Retrieves the dnAttributes flag for this extensible matching
filter.
|
Set<SearchFilter> |
getFilterComponents()
Retrieves the set of filter components for this AND or OR filter.
|
FilterType |
getFilterType()
Retrieves the filter type for this search filter.
|
String |
getMatchingRuleID()
Retrieves the matching rule ID for this extensible matching
filter.
|
SearchFilter |
getNotComponent()
Retrieves the filter component for this NOT filter.
|
List<org.forgerock.opendj.ldap.ByteString> |
getSubAnyElements()
Retrieves the set of subAny elements for this substring filter.
|
org.forgerock.opendj.ldap.ByteString |
getSubFinalElement()
Retrieves the subFinal element for this substring filter.
|
org.forgerock.opendj.ldap.ByteString |
getSubInitialElement()
Retrieves the subInitial element for this substring filter.
|
int |
hashCode()
Retrieves the hash code for this search filter.
|
boolean |
matchesEntry(Entry entry)
Indicates whether this search filter matches the provided entry.
|
static SearchFilter |
objectClassPresent()
Returns the
objectClass presence filter (objectClass=*) . |
String |
toString()
Retrieves a string representation of this search filter.
|
void |
toString(StringBuilder buffer)
Appends a string representation of this search filter to the
provided buffer.
|
public SearchFilter(FilterType filterType, Collection<SearchFilter> filterComponents, SearchFilter notComponent, org.forgerock.opendj.ldap.AttributeDescription attributeDescription, org.forgerock.opendj.ldap.ByteString assertionValue, org.forgerock.opendj.ldap.ByteString subInitialElement, List<org.forgerock.opendj.ldap.ByteString> subAnyElements, org.forgerock.opendj.ldap.ByteString subFinalElement, String matchingRuleID, boolean dnAttributes)
filterType
- The filter type for this search
filter.filterComponents
- The set of filter components for AND
and OR filters.notComponent
- The filter component for NOT filters.attributeDescription
- The attribute description for this filter.assertionValue
- The assertion value for this filter.subInitialElement
- The subInitial element for substring
filters.subAnyElements
- The subAny elements for substring
filters.subFinalElement
- The subFinal element for substring
filters.matchingRuleID
- The matching rule ID for this search
filter.dnAttributes
- Indicates whether to match on DN
attributes for extensible match
filters.
FIXME: this should be private.public static SearchFilter createANDFilter(Collection<SearchFilter> filterComponents)
filterComponents
- The set of filter components for the
AND filter.public static SearchFilter createORFilter(Collection<SearchFilter> filterComponents)
filterComponents
- The set of filter components for the OR
filter.public static SearchFilter createNOTFilter(SearchFilter notComponent)
notComponent
- The filter component for this NOT filter.public static SearchFilter createEqualityFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, org.forgerock.opendj.ldap.ByteString assertionValue)
attributeType
- The attribute type for this equality
filter.assertionValue
- The assertion value for this equality
filter.public static SearchFilter createEqualityFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, Set<String> attributeOptions, org.forgerock.opendj.ldap.ByteString assertionValue)
attributeType
- The attribute type for this equality
filter.attributeOptions
- The set of attribute options for this
equality filter.assertionValue
- The assertion value for this equality
filter.public static SearchFilter createSubstringFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, org.forgerock.opendj.ldap.ByteString subInitialElement, List<org.forgerock.opendj.ldap.ByteString> subAnyElements, org.forgerock.opendj.ldap.ByteString subFinalElement)
attributeType
- The attribute type for this filter.subInitialElement
- The subInitial element for substring
filters.subAnyElements
- The subAny elements for substring
filters.subFinalElement
- The subFinal element for substring
filters.public static SearchFilter createSubstringFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, Set<String> attributeOptions, org.forgerock.opendj.ldap.ByteString subInitialElement, List<org.forgerock.opendj.ldap.ByteString> subAnyElements, org.forgerock.opendj.ldap.ByteString subFinalElement)
attributeType
- The attribute type for this filter.attributeOptions
- The set of attribute options for this
search filter.subInitialElement
- The subInitial element for substring
filters.subAnyElements
- The subAny elements for substring
filters.subFinalElement
- The subFinal element for substring
filters.public static SearchFilter createGreaterOrEqualFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, org.forgerock.opendj.ldap.ByteString assertionValue)
attributeType
- The attribute type for this
greater-or-equal filter.assertionValue
- The assertion value for this
greater-or-equal filter.public static SearchFilter createGreaterOrEqualFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, Set<String> attributeOptions, org.forgerock.opendj.ldap.ByteString assertionValue)
attributeType
- The attribute type for this
greater-or-equal filter.attributeOptions
- The set of attribute options for this
search filter.assertionValue
- The assertion value for this
greater-or-equal filter.public static SearchFilter createLessOrEqualFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, org.forgerock.opendj.ldap.ByteString assertionValue)
attributeType
- The attribute type for this less-or-equal
filter.assertionValue
- The assertion value for this
less-or-equal filter.public static SearchFilter createLessOrEqualFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, Set<String> attributeOptions, org.forgerock.opendj.ldap.ByteString assertionValue)
attributeType
- The attribute type for this
less-or-equal filter.attributeOptions
- The set of attribute options for this
search filter.assertionValue
- The assertion value for this
less-or-equal filter.public static SearchFilter createPresenceFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType)
attributeType
- The attribute type for this presence
filter.public static SearchFilter createPresenceFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, Set<String> attributeOptions)
attributeType
- The attribute type for this presence
filter.attributeOptions
- The attribute options for this presence
filter.public static SearchFilter createApproximateFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, org.forgerock.opendj.ldap.ByteString assertionValue)
attributeType
- The attribute type for this approximate
filter.assertionValue
- The assertion value for this approximate
filter.public static SearchFilter createApproximateFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, Set<String> attributeOptions, org.forgerock.opendj.ldap.ByteString assertionValue)
attributeType
- The attribute type for this approximate
filter.attributeOptions
- The attribute options for this
approximate filter.assertionValue
- The assertion value for this
approximate filter.public static SearchFilter createExtensibleMatchFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, org.forgerock.opendj.ldap.ByteString assertionValue, String matchingRuleID, boolean dnAttributes) throws DirectoryException
attributeType
- The attribute type for this extensible
match filter.assertionValue
- The assertion value for this extensible
match filter.matchingRuleID
- The matching rule ID for this search
filter.dnAttributes
- Indicates whether to match on DN
attributes for extensible match filters.DirectoryException
- If the provided information is not
sufficient to create an extensible
match filter.public static SearchFilter createExtensibleMatchFilter(org.forgerock.opendj.ldap.schema.AttributeType attributeType, Set<String> attributeOptions, org.forgerock.opendj.ldap.ByteString assertionValue, String matchingRuleID, boolean dnAttributes) throws DirectoryException
attributeType
- The attribute type for this extensible
match filter.attributeOptions
- The set of attribute options for this
extensible match filter.assertionValue
- The assertion value for this extensible
match filter.matchingRuleID
- The matching rule ID for this search
filter.dnAttributes
- Indicates whether to match on DN
attributes for extensible match
filters.DirectoryException
- If the provided information is not
sufficient to create an extensible
match filter.public static SearchFilter createFilterFromString(String filterString) throws DirectoryException
filterString
- The filter string to be decoded as a search
filter.DirectoryException
- If a problem occurs while attempting
to decode the provided string as a
search filter.public FilterType getFilterType()
public Set<SearchFilter> getFilterComponents()
public SearchFilter getNotComponent()
null
if this is not a NOT filter.public org.forgerock.opendj.ldap.schema.AttributeType getAttributeType()
null
if there is none.public org.forgerock.opendj.ldap.ByteString getAssertionValue()
null
if there is none.public org.forgerock.opendj.ldap.ByteString getSubInitialElement()
null
if there is none.public List<org.forgerock.opendj.ldap.ByteString> getSubAnyElements()
public org.forgerock.opendj.ldap.ByteString getSubFinalElement()
public String getMatchingRuleID()
public boolean getDNAttributes()
public boolean matchesEntry(Entry entry) throws DirectoryException
entry
- The entry for which to make the determination.true
if this search filter matches the
provided entry, or false
if it does not.DirectoryException
- If a problem is encountered during
processing.public boolean equals(Object o)
public int hashCode()
public void toString(StringBuilder buffer)
buffer
- The buffer to which the information should be
appended.public static SearchFilter objectClassPresent()
objectClass
presence filter (objectClass=*)
.objectClass
presence filter (objectClass=*)
.Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.