Package org.ldaptive.ad.handler
Class ObjectGuidHandler
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<T>
org.ldaptive.ad.handler.AbstractBinaryAttributeHandler<LdapEntry>
org.ldaptive.ad.handler.ObjectGuidHandler
- All Implemented Interfaces:
Function<LdapEntry,,LdapEntry> Freezable,LdapEntryHandler
public class ObjectGuidHandler
extends AbstractBinaryAttributeHandler<LdapEntry>
implements LdapEntryHandler
Processes an objectGuid attribute by converting it from binary to its string form.
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringobjectGuid attribute name.private static final inthash code seed.private booleanwhether to enclose the guid in brackets.Fields inherited from class org.ldaptive.transport.AbstractMessageFunctionalEntryHandler
logger -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new object guid handler.ObjectGuidHandler(boolean brackets) Creates a new object guid handler.ObjectGuidHandler(String attrName) Creates a new object guid handler.ObjectGuidHandler(String attrName, boolean brackets) Creates a new object guid handler. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringconvertValue(byte[] value) Converts the supplied binary value to its string form.booleanbooleanReturns whether the guid will be enclosed in brackets.inthashCode()Create a new instance of this message functional.voidsetWithBrackets(boolean brackets) Sets whether to enclose the GUID in brackets.Methods inherited from class org.ldaptive.ad.handler.AbstractBinaryAttributeHandler
getAttributeName, handleAttributes, setAttributeName, setRequestMethods inherited from class org.ldaptive.transport.AbstractMessageFunctionalEntryHandler
handleAttribute, handleAttributeName, handleAttributeValue, handleAttributeValue, handleDn, handleEntryMethods inherited from class org.ldaptive.transport.MessageFunctional
getConnection, getHandle, getRequest, setConnection, setHandleMethods 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:
-
ATTRIBUTE_NAME
objectGuid attribute name.- See Also:
-
withBrackets
private boolean withBracketswhether to enclose the guid in brackets.
-
-
Constructor Details
-
ObjectGuidHandler
public ObjectGuidHandler()Creates a new object guid handler. -
ObjectGuidHandler
public ObjectGuidHandler(boolean brackets) Creates a new object guid handler.- Parameters:
brackets- whether to enclose the GUID in brackets
-
ObjectGuidHandler
Creates a new object guid handler.- Parameters:
attrName- name of the attribute which is encoded as an objectGUID
-
ObjectGuidHandler
Creates a new object guid handler.- Parameters:
attrName- name of the attribute which is encoded as an objectGUIDbrackets- whether to enclose the GUID in brackets
-
-
Method Details
-
getWithBrackets
public boolean getWithBrackets()Returns whether the guid will be enclosed in brackets.- Returns:
- whether the guid will be enclosed in brackets
-
setWithBrackets
public void setWithBrackets(boolean brackets) Sets whether to enclose the GUID in brackets.- Parameters:
brackets- whether to enclose the GUID in brackets
-
apply
-
convertValue
Description copied from class:AbstractBinaryAttributeHandlerConverts the supplied binary value to its string form.- Specified by:
convertValuein classAbstractBinaryAttributeHandler<LdapEntry>- Parameters:
value- to convert- Returns:
- string form of the value
-
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 classAbstractBinaryAttributeHandler<LdapEntry>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractBinaryAttributeHandler<LdapEntry>
-