|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.ldap.core.support.SingleContextSource
public class SingleContextSource
A ContextSource to be used as a decorator around a target ContextSource
to make sure the target is never actually closed. Useful when working with e.g. paged results,
as these require the same target to be used.
| Nested Class Summary | |
|---|---|
static class |
SingleContextSource.NonClosingDirContextInvocationHandler
A proxy for DirContext forwarding all operation to the target DirContext, but making sure that no close operations will be performed. |
| Constructor Summary | |
|---|---|
SingleContextSource(javax.naming.directory.DirContext ctx)
Constructor. |
|
| Method Summary | |
|---|---|
void |
destroy()
Destroy method that allows the target DirContext to be cleaned up when the SingleContextSource is not going to be used any more. |
javax.naming.directory.DirContext |
getContext(java.lang.String principal,
java.lang.String credentials)
Gets a DirContext instance authenticated using the supplied
principal and credentials. |
javax.naming.directory.DirContext |
getReadOnlyContext()
Gets a read-only DirContext. |
javax.naming.directory.DirContext |
getReadWriteContext()
Gets a read-write DirContext instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SingleContextSource(javax.naming.directory.DirContext ctx)
ctx - the target DirContext.| Method Detail |
|---|
public javax.naming.directory.DirContext getReadOnlyContext()
throws NamingException
ContextSourceDirContext. The returned
DirContext must be possible to perform read-only operations
on.
getReadOnlyContext in interface ContextSourceNamingException - if some error occurs creating an DirContext.
public javax.naming.directory.DirContext getReadWriteContext()
throws NamingException
ContextSourceDirContext instance.
getReadWriteContext in interface ContextSourceDirContext instance, never null.
NamingException - if some error occurs creating an
DirContext.
public javax.naming.directory.DirContext getContext(java.lang.String principal,
java.lang.String credentials)
throws NamingException
ContextSourceDirContext instance authenticated using the supplied
principal and credentials.
getContext in interface ContextSourceprincipal - The principal (typically a distinguished name of a user
in the LDAP tree) to use for authentication.credentials - The credentials to use for authentication.
DirContext instance, never
null.
NamingExceptionpublic void destroy()
destroy in interface org.springframework.beans.factory.DisposableBean
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||