Package org.ldaptive.handler
Class DnAttributeEntryHandler
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.handler.AbstractEntryHandler
-
- org.ldaptive.handler.DnAttributeEntryHandler
-
- All Implemented Interfaces:
Function<LdapEntry,LdapEntry>
,Freezable
,LdapEntryHandler
public class DnAttributeEntryHandler extends AbstractEntryHandler implements LdapEntryHandler
Adds the entry DN as an attribute to the result set. Provides a client side implementation of RFC 5020.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DnAttributeEntryHandler.Builder
DN attribute entry handler builder.
-
Field Summary
Fields Modifier and Type Field Description private boolean
addIfExists
Whether to add the entry dn if an attribute of the same name exists.private String
dnAttributeName
Attribute name for the entry dn.private static int
HASH_CODE_SEED
hash code seed.-
Fields inherited from class org.ldaptive.handler.AbstractEntryHandler
logger
-
-
Constructor Summary
Constructors Constructor Description DnAttributeEntryHandler()
Default constructor.DnAttributeEntryHandler(String attrName, boolean add)
Creates a new DN attribute entry handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LdapEntry
apply(LdapEntry entry)
static DnAttributeEntryHandler.Builder
builder()
Creates a builder for this class.boolean
equals(Object o)
String
getDnAttributeName()
Returns the DN attribute name.protected void
handleAttributes(LdapEntry entry)
Handle the attributes of a search entry.int
hashCode()
boolean
isAddIfExists()
Returns whether to add the entryDN if an attribute of the same name exists.void
setAddIfExists(boolean b)
Sets whether to add the entryDN if an attribute of the same name exists.void
setDnAttributeName(String name)
Sets the DN attribute name.String
toString()
-
Methods inherited from class org.ldaptive.handler.AbstractEntryHandler
handleAttribute, handleAttributeName, handleAttributeValue, handleAttributeValue, handleDn, handleEntry
-
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
-
dnAttributeName
private String dnAttributeName
Attribute name for the entry dn.
-
addIfExists
private boolean addIfExists
Whether to add the entry dn if an attribute of the same name exists.
-
-
Constructor Detail
-
DnAttributeEntryHandler
public DnAttributeEntryHandler()
Default constructor.
-
DnAttributeEntryHandler
public DnAttributeEntryHandler(String attrName, boolean add)
Creates a new DN attribute entry handler.- Parameters:
attrName
- to add the DN toadd
- whether to add the DN if the attribute exists
-
-
Method Detail
-
getDnAttributeName
public String getDnAttributeName()
Returns the DN attribute name.- Returns:
- DN attribute name
-
setDnAttributeName
public void setDnAttributeName(String name)
Sets the DN attribute name.- Parameters:
name
- of the DN attribute
-
isAddIfExists
public boolean isAddIfExists()
Returns whether to add the entryDN if an attribute of the same name exists.- Returns:
- whether to add the entryDN if an attribute of the same name exists
-
setAddIfExists
public void setAddIfExists(boolean b)
Sets whether to add the entryDN if an attribute of the same name exists.- Parameters:
b
- whether to add the entryDN if an attribute of the same name exists
-
handleAttributes
protected void handleAttributes(LdapEntry entry)
Description copied from class:AbstractEntryHandler
Handle the attributes of a search entry.- Overrides:
handleAttributes
in classAbstractEntryHandler
- Parameters:
entry
- search entry to extract the attributes from
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractEntryHandler
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classAbstractEntryHandler
-
builder
public static DnAttributeEntryHandler.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-