Package org.ldaptive.auth
Class FormatDnResolver
- java.lang.Object
-
- org.ldaptive.AbstractFreezable
-
- org.ldaptive.auth.FormatDnResolver
-
- All Implemented Interfaces:
DnResolver,Freezable
public class FormatDnResolver extends AbstractFreezable implements DnResolver
Returns a DN by applying a formatter. SeeFormatter.
-
-
Field Summary
Fields Modifier and Type Field Description private AttributeValueEscaperattributeValueEscaperattribute value escaper.private booleanescapeUserwhether to escape the user input.private Object[]formatArgsformat arguments.private StringformatStringformat of DN.protected Loggerloggerlog for this class.
-
Constructor Summary
Constructors Constructor Description FormatDnResolver()Default 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetEscapeUser()Returns whether the user input will be escaped usingattributeValueEscaper.StringgetFormat()Returns the formatter string used to return the entry DN.Object[]getFormatArgs()Returns the format arguments.Stringresolve(User user)Returns a DN for the supplied user by applying it to a format string.voidsetEscapeUser(boolean b)Sets whether the user input will be escaped usingattributeValueEscaper.voidsetFormat(String format)Sets the formatter string used to return the entry DN.voidsetFormatArgs(Object[] args)Sets the format arguments.StringtoString()-
Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, freeze, isFrozen
-
-
-
-
Field Detail
-
logger
protected final Logger logger
log for this class.
-
attributeValueEscaper
private final AttributeValueEscaper attributeValueEscaper
attribute value escaper.
-
formatString
private String formatString
format of DN.
-
formatArgs
private Object[] formatArgs
format arguments.
-
escapeUser
private boolean escapeUser
whether to escape the user input.
-
-
Constructor Detail
-
FormatDnResolver
public FormatDnResolver()
Default constructor.
-
FormatDnResolver
public FormatDnResolver(String format)
Creates a new format DN resolver.- Parameters:
format- formatter string
-
-
Method Detail
-
getFormat
public final String getFormat()
Returns the formatter string used to return the entry DN.- Returns:
- user field
-
setFormat
public final void setFormat(String format)
Sets the formatter string used to return the entry DN.- Parameters:
format- formatter string
-
getFormatArgs
public final Object[] getFormatArgs()
Returns the format arguments.- Returns:
- format args
-
setFormatArgs
public final void setFormatArgs(Object[] args)
Sets the format arguments.- Parameters:
args- to set format arguments
-
getEscapeUser
public final boolean getEscapeUser()
Returns whether the user input will be escaped usingattributeValueEscaper.- Returns:
- whether the user input will be escaped.
-
setEscapeUser
public final void setEscapeUser(boolean b)
Sets whether the user input will be escaped usingattributeValueEscaper.- Parameters:
b- whether the user input will be escaped.
-
resolve
public String resolve(User user) throws LdapException
Returns a DN for the supplied user by applying it to a format string.- Specified by:
resolvein interfaceDnResolver- Parameters:
user- to format dn for- Returns:
- user DN
- Throws:
LdapException- never
-
-