public abstract class AbstractRequestControlDirContextProcessor extends Object implements DirContextProcessor
DirContextProcessor.postProcess(DirContext) and template method
createRequestControl().| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
log |
| Constructor and Description |
|---|
AbstractRequestControlDirContextProcessor() |
| Modifier and Type | Method and Description |
|---|---|
abstract Control |
createRequestControl()
Create an instance of the appropriate RequestControl.
|
boolean |
isReplaceSameControlEnabled()
If there already exists a request control of the same class as the one
created by
createRequestControl() in the context, the new
control can either replace the existing one (default behavior) or be
added. |
void |
preProcess(DirContext ctx)
Get the existing RequestControls from the LdapContext, call
createRequestControl() to get a new instance, build a new array
of Controls and set it on the LdapContext. |
void |
setReplaceSameControlEnabled(boolean replaceSameControlEnabled)
If there already exists a request control of the same class as the one
created by
createRequestControl() in the context, the new
control can either replace the existing one (default behavior) or be
added. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpostProcesspublic AbstractRequestControlDirContextProcessor()
public boolean isReplaceSameControlEnabled()
createRequestControl() in the context, the new
control can either replace the existing one (default behavior) or be
added.public void setReplaceSameControlEnabled(boolean replaceSameControlEnabled)
createRequestControl() in the context, the new
control can either replace the existing one (default behavior) or be
added.replaceSameControlEnabled - true if an already
existing control should be replacedpublic void preProcess(DirContext ctx) throws NamingException
createRequestControl() to get a new instance, build a new array
of Controls and set it on the LdapContext.
The Control feature is specific for LDAP v3 and thus applies only
to LdapContext. However, the generic DirContextProcessor
mechanism used for calling preProcess and
postProcess uses DirContext, since it also works for LDAP
v2. This is the reason that DirContext has to be cast to a LdapContext.
preProcess in interface DirContextProcessorctx - an LdapContext instance.NamingExceptionIllegalArgumentException - if the supplied DirContext is not an
LdapContext.public abstract Control createRequestControl()