Package org.ldaptive.auth
Class FormatDnResolver
java.lang.Object
org.ldaptive.auth.FormatDnResolver
- All Implemented Interfaces:
DnResolver
Returns a DN by applying a formatter. See
Formatter
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AttributeValueEscaper
attribute value escaper.private boolean
whether to escape the user input.private Object[]
format arguments.private String
format of DN.protected final org.slf4j.Logger
log for this class. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.FormatDnResolver
(String format) Creates a new format DN resolver.FormatDnResolver
(String format, Object[] args) Creates a new format DN resolver with the supplied format and arguments. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the user input will be escaped usingattributeValueEscaper
.Returns the formatter string used to return the entry DN.Object[]
Returns the format arguments.Returns a DN for the supplied user by applying it to a format string.void
setEscapeUser
(boolean b) Sets whether the user input will be escaped usingattributeValueEscaper
.void
Sets the formatter string used to return the entry DN.void
setFormatArgs
(Object[] args) Sets the format arguments.toString()
-
Field Details
-
logger
protected final org.slf4j.Logger loggerlog for this class. -
attributeValueEscaper
attribute value escaper. -
formatString
format of DN. -
formatArgs
format arguments. -
escapeUser
private boolean escapeUserwhether to escape the user input.
-
-
Constructor Details
-
FormatDnResolver
public FormatDnResolver()Default constructor. -
FormatDnResolver
Creates a new format DN resolver.- Parameters:
format
- formatter string
-
FormatDnResolver
Creates a new format DN resolver with the supplied format and arguments.- Parameters:
format
- to set formatter stringargs
- to set formatter arguments
-
-
Method Details
-
getFormat
Returns the formatter string used to return the entry DN.- Returns:
- user field
-
setFormat
Sets the formatter string used to return the entry DN.- Parameters:
format
- formatter string
-
getFormatArgs
Returns the format arguments.- Returns:
- format args
-
setFormatArgs
Sets the format arguments.- Parameters:
args
- to set format arguments
-
getEscapeUser
public boolean getEscapeUser()Returns whether the user input will be escaped usingattributeValueEscaper
.- Returns:
- whether the user input will be escaped.
-
setEscapeUser
public void setEscapeUser(boolean b) Sets whether the user input will be escaped usingattributeValueEscaper
.- Parameters:
b
- whether the user input will be escaped.
-
resolve
Returns a DN for the supplied user by applying it to a format string.- Specified by:
resolve
in interfaceDnResolver
- Parameters:
user
- to format dn for- Returns:
- user DN
- Throws:
LdapException
- never
-
toString
-