Package org.ldaptive.ad.handler
Class PrimaryGroupIdHandler
- java.lang.Object
-
- org.ldaptive.transport.MessageFunctional<Q,S>
-
- org.ldaptive.transport.MessageFunctional.Function<SearchRequest,SearchResponse,T,T>
-
- org.ldaptive.handler.AbstractEntryHandler<SearchResponse>
-
- org.ldaptive.ad.handler.PrimaryGroupIdHandler
-
- All Implemented Interfaces:
java.util.function.Function<SearchResponse,SearchResponse>
,SearchResultHandler
public class PrimaryGroupIdHandler extends AbstractEntryHandler<SearchResponse> implements SearchResultHandler
Constructs the primary group SID and then searches for that group and puts it's 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 theObjectSidHandler
to ensure the 'objectSid' attribute is in the proper form. See http://support2.microsoft.com/kb/297951 This handler should only be used with theSearchOperation.execute()
method since it leverages the connection to make further searches.- Author:
- Middleware Services
-
-
Field Summary
-
Fields inherited from class org.ldaptive.handler.AbstractEntryHandler
logger
-
-
Constructor Summary
Constructors Constructor Description PrimaryGroupIdHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchResponse
apply(SearchResponse response)
boolean
equals(java.lang.Object o)
java.lang.String
getBaseDn()
Returns the base DN to search for the primary group.java.lang.String
getGroupFilter()
Returns the search filter used to find the primary group.protected void
handleAttributes(LdapEntry entry)
Handle the attributes of a search entry.int
hashCode()
void
setBaseDn(java.lang.String dn)
Sets the base DN to search for the primary group.void
setGroupFilter(java.lang.String filter)
Sets the search filter used to find the primary group.-
Methods inherited from class org.ldaptive.handler.AbstractEntryHandler
handleAttribute, handleAttributeName, handleAttributeValue, handleAttributeValue, handleDn, handleEntry
-
Methods inherited from class org.ldaptive.transport.MessageFunctional
getConnection, getHandle, getRequest, setConnection, setHandle, setRequest
-
-
-
-
Method Detail
-
getGroupFilter
public java.lang.String getGroupFilter()
Returns the search filter used to find the primary group.- Returns:
- group search filter
-
setGroupFilter
public void setGroupFilter(java.lang.String filter)
Sets the search filter used to find the primary group.- Parameters:
filter
- search filter
-
getBaseDn
public java.lang.String 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
public void setBaseDn(java.lang.String dn)
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
public SearchResponse apply(SearchResponse response)
- Specified by:
apply
in interfacejava.util.function.Function<SearchResponse,SearchResponse>
-
handleAttributes
protected void handleAttributes(LdapEntry entry)
Description copied from class:AbstractEntryHandler
Handle the attributes of a search entry.- Overrides:
handleAttributes
in classAbstractEntryHandler<SearchResponse>
- Parameters:
entry
- search entry to extract the attributes from
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classAbstractEntryHandler<SearchResponse>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classAbstractEntryHandler<SearchResponse>
-
-