Package org.springframework.ldap.core
Interface ContextSource
-
- All Known Subinterfaces:
BaseLdapPathContextSource
- All Known Implementing Classes:
AbstractContextSource
,DirContextSource
,LdapContextSource
,MutablePooledContextSource
,MutablePoolingContextSource
,PooledContextSource
,PoolingContextSource
,SingleContextSource
,TransactionAwareContextSourceProxy
public interface ContextSource
AContextSource
is responsible for configuring and creatingDirContext
instances. It is typically used fromLdapTemplate
to acquiring contexts for LDAP operations, but may be used standalone to perform LDAP authentication.- See Also:
LdapTemplate
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.naming.directory.DirContext
getContext(java.lang.String principal, java.lang.String credentials)
Gets aDirContext
instance authenticated using the supplied principal and credentials.javax.naming.directory.DirContext
getReadOnlyContext()
Gets a read-onlyDirContext
.javax.naming.directory.DirContext
getReadWriteContext()
Gets a read-writeDirContext
instance.
-
-
-
Method Detail
-
getReadOnlyContext
javax.naming.directory.DirContext getReadOnlyContext() throws NamingException
Gets a read-onlyDirContext
. The returnedDirContext
must be possible to perform read-only operations on.- Returns:
- A DirContext instance, never null.
- Throws:
NamingException
- if some error occurs creating an DirContext.
-
getReadWriteContext
javax.naming.directory.DirContext getReadWriteContext() throws NamingException
Gets a read-writeDirContext
instance.- Returns:
- A
DirContext
instance, nevernull
. - Throws:
NamingException
- if some error occurs creating anDirContext
.
-
getContext
javax.naming.directory.DirContext getContext(java.lang.String principal, java.lang.String credentials) throws NamingException
Gets aDirContext
instance authenticated using the supplied principal and credentials. Typically to be used for plain authentication purposes. Note that this method will never make use of native Java LDAP pooling, even though this instance is configured to do so. This is to force password changes in the target directory to take effect as soon as possible.- Parameters:
principal
- The principal (typically a distinguished name of a user in the LDAP tree) to use for authentication.credentials
- The credentials to use for authentication.- Returns:
- an authenticated
DirContext
instance, nevernull
. - Throws:
NamingException
- Since:
- 1.3
-
-