Package org.ldaptive.ad.handler
Class PrimaryGroupIdHandler
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.PrimaryGroupIdHandler
- All Implemented Interfaces:
Function<SearchResponse,,SearchResponse> Freezable,SearchResultHandler
public class PrimaryGroupIdHandler
extends AbstractMessageFunctionalEntryHandler<SearchResponse>
implements SearchResultHandler
Constructs the primary group SID and then searches for that group and puts its DN in the 'memberOf' attribute of the
original search entry. This handler requires that entries contain both the 'objectSid' and 'primaryGroupID'
attributes. If those attributes are not found this handler is a no-op. This handler should be used in conjunction
with the
ObjectSidHandler to ensure the 'objectSid' attribute is in the proper form. See
http://support2.microsoft.com/kb/297951
This handler should only be used with the SearchOperation.execute() method since it leverages
the connection to make further searches.-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringbase DN used for searching for the primary group.private Stringsearch filter used to find the primary group.private static final inthash code seed.Fields inherited from class org.ldaptive.transport.AbstractMessageFunctionalEntryHandler
logger -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PrimaryGroupIdHandler(String filter, String dn) Creates a new primary group id handler. -
Method Summary
Modifier and TypeMethodDescriptionapply(SearchResponse response) booleanReturns the base DN to search for the primary group.Returns the search filter used to find the primary group.protected voidhandleAttributes(LdapEntry entry) Handle the attributes of a search entry.inthashCode()Create a new instance of this message functional.voidSets the base DN to search for the primary group.voidsetGroupFilter(String filter) Sets the search filter used to find the primary group.Methods inherited from class org.ldaptive.transport.AbstractMessageFunctionalEntryHandler
handleAttribute, handleAttributeName, handleAttributeValue, handleAttributeValue, handleDn, handleEntryMethods inherited from class org.ldaptive.transport.MessageFunctional
getConnection, getHandle, getRequest, setConnection, setHandle, setRequestMethods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, freeze, isFrozen
-
Field Details
-
HASH_CODE_SEED
private static final int HASH_CODE_SEEDhash code seed.- See Also:
-
groupFilter
search filter used to find the primary group. -
baseDn
base DN used for searching for the primary group.
-
-
Constructor Details
-
PrimaryGroupIdHandler
public PrimaryGroupIdHandler()Default constructor. -
PrimaryGroupIdHandler
Creates a new primary group id handler.- Parameters:
filter- to locate the primary groupdn- base DN to search for the primary group
-
-
Method Details
-
getGroupFilter
Returns the search filter used to find the primary group.- Returns:
- group search filter
-
setGroupFilter
Sets the search filter used to find the primary group.- Parameters:
filter- search filter
-
getBaseDn
Returns the base DN to search for the primary group. If this is not set the base DN from the original search is used.- Returns:
- base DN to search for the primary group
-
setBaseDn
Sets the base DN to search for the primary group. If this is not set the base DN from the original search is used.- Parameters:
dn- base DN
-
apply
- Specified by:
applyin interfaceFunction<SearchResponse,SearchResponse>
-
handleAttributes
Description copied from class:AbstractMessageFunctionalEntryHandlerHandle the attributes of a search entry.- Overrides:
handleAttributesin classAbstractMessageFunctionalEntryHandler<SearchResponse>- Parameters:
entry- search entry to extract the attributes from
-
newInstance
Description copied from class:MessageFunctionalCreate a new instance of this message functional.- Specified by:
newInstancein classMessageFunctional<SearchRequest,SearchResponse> - Returns:
- new instance of this message functional
-
equals
- Overrides:
equalsin classAbstractMessageFunctionalEntryHandler<SearchResponse>
-
hashCode
public int hashCode()- Specified by:
hashCodein classAbstractMessageFunctionalEntryHandler<SearchResponse>
-