Class LDAPInitialDirContextFactoryImpl
- java.lang.Object
-
- org.alfresco.repo.security.authentication.ldap.LDAPInitialDirContextFactoryImpl
-
- All Implemented Interfaces:
LDAPInitialDirContextFactory,org.springframework.beans.factory.InitializingBean
public class LDAPInitialDirContextFactoryImpl extends java.lang.Object implements LDAPInitialDirContextFactory, org.springframework.beans.factory.InitializingBean
-
-
Constructor Summary
Constructors Constructor Description LDAPInitialDirContextFactoryImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()javax.naming.directory.InitialDirContextgetDefaultIntialDirContext()Use the environment properties and connect to the LDAP server.javax.naming.directory.InitialDirContextgetDefaultIntialDirContext(int pageSize)Use the environment properties and connect to the LDAP server, optionally configuring RFC 2696 paged results.javax.naming.directory.InitialDirContextgetDefaultIntialDirContext(int pageSize, org.alfresco.repo.security.authentication.AuthenticationDiagnostic diagnostic)Use the environment properties and connect to the LDAP server, optionally configuring RFC 2696 paged results.javax.naming.directory.InitialDirContextgetDefaultIntialDirContext(org.alfresco.repo.security.authentication.AuthenticationDiagnostic diagnostic)Use the environment properties and connect to the LDAP server.javax.naming.directory.InitialDirContextgetInitialDirContext(java.lang.String principal, java.lang.String credentials)Augment the connection environment with the identity and credentials and bind to the ldap server.javax.naming.directory.InitialDirContextgetInitialDirContext(java.lang.String principal, java.lang.String credentials, org.alfresco.repo.security.authentication.AuthenticationDiagnostic diagnostic)Augment the connection environment with the identity and credentials and bind to the ldap server.java.util.Map<java.lang.String,java.lang.String>getInitialDirContextEnvironment()java.lang.StringgetTrustStorePassPhrase()java.lang.StringgetTrustStorePath()java.lang.StringgetTrustStoreType()booleanhasNextPage(javax.naming.directory.DirContext ctx, int pageSize)Determines whether there is another page to fetch from the last search to be run in this context.static voidmain(java.lang.String[] args)voidsetDefaultIntialDirContextEnvironment(java.util.Map<java.lang.String,java.lang.String> defaultEnvironment)voidsetInitialDirContextEnvironment(java.util.Map<java.lang.String,java.lang.String> initialDirContextEnvironment)Set the LDAP environment Hashtable properties used ot initialise the LDAP connection.voidsetPoolSystemProperties(java.util.Map<java.lang.String,java.lang.String> poolSystemProperties)voidsetTrustStorePassPhrase(java.lang.String trustStorePassPhrase)voidsetTrustStorePath(java.lang.String trustStorePath)voidsetTrustStoreType(java.lang.String trustStoreType)
-
-
-
Method Detail
-
getTrustStorePath
public java.lang.String getTrustStorePath()
-
setTrustStorePath
public void setTrustStorePath(java.lang.String trustStorePath)
-
getTrustStoreType
public java.lang.String getTrustStoreType()
-
setTrustStoreType
public void setTrustStoreType(java.lang.String trustStoreType)
-
getTrustStorePassPhrase
public java.lang.String getTrustStorePassPhrase()
-
setTrustStorePassPhrase
public void setTrustStorePassPhrase(java.lang.String trustStorePassPhrase)
-
setInitialDirContextEnvironment
public void setInitialDirContextEnvironment(java.util.Map<java.lang.String,java.lang.String> initialDirContextEnvironment)
Description copied from interface:LDAPInitialDirContextFactorySet the LDAP environment Hashtable properties used ot initialise the LDAP connection.- Specified by:
setInitialDirContextEnvironmentin interfaceLDAPInitialDirContextFactory
-
getInitialDirContextEnvironment
public java.util.Map<java.lang.String,java.lang.String> getInitialDirContextEnvironment()
-
setDefaultIntialDirContextEnvironment
public void setDefaultIntialDirContextEnvironment(java.util.Map<java.lang.String,java.lang.String> defaultEnvironment)
-
getDefaultIntialDirContext
public javax.naming.directory.InitialDirContext getDefaultIntialDirContext() throws org.alfresco.repo.security.authentication.AuthenticationExceptionDescription copied from interface:LDAPInitialDirContextFactoryUse the environment properties and connect to the LDAP server. Used to obtain read only access to the LDAP server.- Specified by:
getDefaultIntialDirContextin interfaceLDAPInitialDirContextFactory- Returns:
- InitialDirContext
- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
setPoolSystemProperties
public void setPoolSystemProperties(java.util.Map<java.lang.String,java.lang.String> poolSystemProperties)
-
getDefaultIntialDirContext
public javax.naming.directory.InitialDirContext getDefaultIntialDirContext(int pageSize) throws org.alfresco.repo.security.authentication.AuthenticationExceptionDescription copied from interface:LDAPInitialDirContextFactoryUse the environment properties and connect to the LDAP server, optionally configuring RFC 2696 paged results. Used to obtain read only access to the LDAP server.- Specified by:
getDefaultIntialDirContextin interfaceLDAPInitialDirContextFactory- Parameters:
pageSize- if a positive value, indicates that a LDAP v3 RFC 2696 paged results control should be used. The results of a search operation should be returned by the LDAP server in batches of the specified size.- Returns:
- the default intial dir context
- Throws:
org.alfresco.repo.security.authentication.AuthenticationException- the authentication exception
-
getDefaultIntialDirContext
public javax.naming.directory.InitialDirContext getDefaultIntialDirContext(org.alfresco.repo.security.authentication.AuthenticationDiagnostic diagnostic) throws org.alfresco.repo.security.authentication.AuthenticationExceptionDescription copied from interface:LDAPInitialDirContextFactoryUse the environment properties and connect to the LDAP server. Used to obtain read only access to the LDAP server.- Specified by:
getDefaultIntialDirContextin interfaceLDAPInitialDirContextFactory- Returns:
- InitialDirContext
- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
getDefaultIntialDirContext
public javax.naming.directory.InitialDirContext getDefaultIntialDirContext(int pageSize, org.alfresco.repo.security.authentication.AuthenticationDiagnostic diagnostic) throws org.alfresco.repo.security.authentication.AuthenticationExceptionDescription copied from interface:LDAPInitialDirContextFactoryUse the environment properties and connect to the LDAP server, optionally configuring RFC 2696 paged results. Used to obtain read only access to the LDAP server.- Specified by:
getDefaultIntialDirContextin interfaceLDAPInitialDirContextFactory- Parameters:
pageSize- if a positive value, indicates that a LDAP v3 RFC 2696 paged results control should be used. The results of a search operation should be returned by the LDAP server in batches of the specified size.diagnostic- AuthenticationDiagnostic- Returns:
- the default intial dir context
- Throws:
org.alfresco.repo.security.authentication.AuthenticationException- the authentication exception
-
hasNextPage
public boolean hasNextPage(javax.naming.directory.DirContext ctx, int pageSize)Description copied from interface:LDAPInitialDirContextFactoryDetermines whether there is another page to fetch from the last search to be run in this context. Also prepares the request controls so that the appropriate cookie will be passed in the next search.- Specified by:
hasNextPagein interfaceLDAPInitialDirContextFactory- Parameters:
ctx- the contextpageSize- if a positive value, indicates that a LDAP v3 RFC 2696 paged results control should be used. The results of a search operation should be returned by the LDAP server in batches of the specified size.- Returns:
- true, if is ready for next page
-
getInitialDirContext
public javax.naming.directory.InitialDirContext getInitialDirContext(java.lang.String principal, java.lang.String credentials) throws org.alfresco.repo.security.authentication.AuthenticationExceptionDescription copied from interface:LDAPInitialDirContextFactoryAugment the connection environment with the identity and credentials and bind to the ldap server. Mainly used to validate a user's credentials during authentication.- Specified by:
getInitialDirContextin interfaceLDAPInitialDirContextFactory- Parameters:
principal- Stringcredentials- String- Returns:
- InitialDirContext
- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
getInitialDirContext
public javax.naming.directory.InitialDirContext getInitialDirContext(java.lang.String principal, java.lang.String credentials, org.alfresco.repo.security.authentication.AuthenticationDiagnostic diagnostic) throws org.alfresco.repo.security.authentication.AuthenticationExceptionDescription copied from interface:LDAPInitialDirContextFactoryAugment the connection environment with the identity and credentials and bind to the ldap server. Mainly used to validate a user's credentials during authentication.- Specified by:
getInitialDirContextin interfaceLDAPInitialDirContextFactory- Parameters:
principal- Stringcredentials- Stringdiagnostic- AuthenticationDiagnostic- Returns:
- InitialDirContext
- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
main
public static void main(java.lang.String[] args)
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
-