Package org.ldaptive.ad.handler
Class RangeEntryHandler
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.transport.MessageFunctional<Q,S>
-
- org.ldaptive.transport.MessageFunctional.Function<SearchRequest,SearchResponse,T,T>
-
- org.ldaptive.transport.AbstractMessageFunctionalEntryHandler<SearchResponse>
-
- org.ldaptive.ad.handler.RangeEntryHandler
-
- All Implemented Interfaces:
Function<SearchResponse,SearchResponse>
,Freezable
,SearchResultHandler
public class RangeEntryHandler extends AbstractMessageFunctionalEntryHandler<SearchResponse> implements SearchResultHandler
Rewrites attributes returned from Active Directory to include all values by performing additional searches. This behavior is based on the expired RFC "Incremental Retrieval of Multi-valued Properties" http://www.ietf.org/proceedings/53/I-D/draft-kashi-incremental-00.txt.For example, when the membership of a group exceeds 1500, requests for the member attribute will likely return an attribute with name "member;Range=0-1499" and 1500 values. For a group with just over 3000 members, subsequent searches will request "member;Range=1500-2999" and then "member;Range=3000-4499". When the returned attribute is of the form "member;Range=3000-*", all values have been retrieved.
This handler should only be used with theSearchOperation.execute()
method since it leverages the connection to make further searches.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
END_OF_RANGE
The character indicating that the end of the range has been reached.private static int
HASH_CODE_SEED
hash code seed.private static String
RANGE_FORMAT
The format used to calculate attribute IDs for subsequent searches.private static Pattern
RANGE_PATTERN
The pattern matching the range attribute ID.private static String
RANGE_PATTERN_STRING
The expression matching the range attribute ID "<id>range=<X>-<Y>".-
Fields inherited from class org.ldaptive.transport.AbstractMessageFunctionalEntryHandler
logger
-
-
Constructor Summary
Constructors Constructor Description RangeEntryHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchResponse
apply(SearchResponse response)
boolean
equals(Object o)
protected void
handleAttributes(LdapEntry entry)
Handle the attributes of a search entry.int
hashCode()
RangeEntryHandler
newInstance()
Create a new instance of this message functional.-
Methods inherited from class org.ldaptive.transport.AbstractMessageFunctionalEntryHandler
handleAttribute, handleAttributeName, handleAttributeValue, handleAttributeValue, handleDn, handleEntry
-
Methods inherited from class org.ldaptive.transport.MessageFunctional
getConnection, getHandle, getRequest, setConnection, setHandle, setRequest
-
Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, freeze, isFrozen
-
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
END_OF_RANGE
private static final String END_OF_RANGE
The character indicating that the end of the range has been reached.- See Also:
- Constant Field Values
-
RANGE_FORMAT
private static final String RANGE_FORMAT
The format used to calculate attribute IDs for subsequent searches.- See Also:
- Constant Field Values
-
RANGE_PATTERN_STRING
private static final String RANGE_PATTERN_STRING
The expression matching the range attribute ID "<id>range=<X>-<Y>".- See Also:
- Constant Field Values
-
RANGE_PATTERN
private static final Pattern RANGE_PATTERN
The pattern matching the range attribute ID.
-
-
Method Detail
-
apply
public SearchResponse apply(SearchResponse response)
- Specified by:
apply
in interfaceFunction<SearchResponse,SearchResponse>
-
handleAttributes
protected void handleAttributes(LdapEntry entry)
Description copied from class:AbstractMessageFunctionalEntryHandler
Handle the attributes of a search entry.- Overrides:
handleAttributes
in classAbstractMessageFunctionalEntryHandler<SearchResponse>
- Parameters:
entry
- search entry to extract the attributes from
-
newInstance
public RangeEntryHandler newInstance()
Description copied from class:MessageFunctional
Create a new instance of this message functional.- Specified by:
newInstance
in classMessageFunctional<SearchRequest,SearchResponse>
- Returns:
- new instance of this message functional
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractMessageFunctionalEntryHandler<SearchResponse>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classAbstractMessageFunctionalEntryHandler<SearchResponse>
-
-