Java Doc for DefaultInitialDirContextFactory.java in  » Security » acegi-security » org » acegisecurity » ldap » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Security » acegi security » org.acegisecurity.ldap 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.acegisecurity.ldap.DefaultInitialDirContextFactory

DefaultInitialDirContextFactory
public class DefaultInitialDirContextFactory implements InitialDirContextFactory,MessageSourceAware(Code)
Encapsulates the information for connecting to an LDAP server and provides an access point for obtaining DirContext references.

The directory location is configured using by setting the constructor argument providerUrl. This should be in the form ldap://monkeymachine.co.uk:389/dc=acegisecurity,dc=org. The Sun JNDI provider also supports lists of space-separated URLs, each of which will be tried in turn until a connection is obtained.

To obtain an initial context, the client calls the newInitialDirContext method. There are two signatures - one with no arguments and one which allows binding with a specific username and password.

The no-args version will bind anonymously unless a manager login has been configured using the properties managerDn and managerPassword, in which case it will bind as the manager user.

Connection pooling is enabled by default for anonymous or manager connections, but not when binding as a specific user.


author:
   Robert Sanders
author:
   Luke Taylor
version:
   $Id: DefaultInitialDirContextFactory.java 1784 2007-02-24 21:00:24Z luke_t $
See Also:    The Java tutorial's guide to LDAP
See Also:   connection pooling


Field Summary
protected  MessageSourceAccessormessages
    

Constructor Summary
public  DefaultInitialDirContextFactory(String providerUrl)
    

Method Summary
protected  HashtablegetEnvironment()
     Sets up the environment parameters for creating a new context.
public  StringgetRootDn()
     Returns the root DN of the configured provider URL.
public  DirContextnewInitialDirContext()
     Connects anonymously unless a manager user has been specified, in which case it will bind as the manager.
public  DirContextnewInitialDirContext(String username, String password)
    
public  voidsetAuthenticationType(String authenticationType)
    
public  voidsetExtraEnvVars(Map extraEnvVars)
     Sets any custom environment variables which will be added to the those returned by the getEnvironment method.
public  voidsetInitialContextFactory(String initialContextFactory)
    
public  voidsetManagerDn(String managerDn)
     Sets the directory user to authenticate as when obtaining a context using the newInitialDirContext() method.
public  voidsetManagerPassword(String managerPassword)
     Sets the password which will be used in combination with the manager DN.
public  voidsetMessageSource(MessageSource messageSource)
    
public  voidsetUseConnectionPool(boolean useConnectionPool)
     Connection pooling is enabled by default for anonymous or "manager" connections when using the default Sun provider.
public  voidsetUseLdapContext(boolean useLdapContext)
    

Field Detail
messages
protected MessageSourceAccessor messages(Code)




Constructor Detail
DefaultInitialDirContextFactory
public DefaultInitialDirContextFactory(String providerUrl)(Code)
Create and initialize an instance to the LDAP url provided
Parameters:
  providerUrl - a String of the form ldap://localhost:389/base_dn




Method Detail
getEnvironment
protected Hashtable getEnvironment()(Code)
Sets up the environment parameters for creating a new context. the Hashtable describing the base DirContext that will be created, minus the username/password if any.



getRootDn
public String getRootDn()(Code)
Returns the root DN of the configured provider URL. For example, if the URL is ldap://monkeymachine.co.uk:389/dc=acegisecurity,dc=org the value will be dc=acegisecurity,dc=org. the root DN calculated from the path of the LDAP url.



newInitialDirContext
public DirContext newInitialDirContext()(Code)
Connects anonymously unless a manager user has been specified, in which case it will bind as the manager. the resulting context object.



newInitialDirContext
public DirContext newInitialDirContext(String username, String password)(Code)



setAuthenticationType
public void setAuthenticationType(String authenticationType)(Code)



setExtraEnvVars
public void setExtraEnvVars(Map extraEnvVars)(Code)
Sets any custom environment variables which will be added to the those returned by the getEnvironment method.
Parameters:
  extraEnvVars - extra environment variables to be added at config time.



setInitialContextFactory
public void setInitialContextFactory(String initialContextFactory)(Code)



setManagerDn
public void setManagerDn(String managerDn)(Code)
Sets the directory user to authenticate as when obtaining a context using the newInitialDirContext() method. If no name is supplied then the context will be obtained anonymously.
Parameters:
  managerDn - The name of the "manager" user for default authentication.



setManagerPassword
public void setManagerPassword(String managerPassword)(Code)
Sets the password which will be used in combination with the manager DN.
Parameters:
  managerPassword - The "manager" user's password.



setMessageSource
public void setMessageSource(MessageSource messageSource)(Code)



setUseConnectionPool
public void setUseConnectionPool(boolean useConnectionPool)(Code)
Connection pooling is enabled by default for anonymous or "manager" connections when using the default Sun provider. To disable all connection pooling, set this property to false.
Parameters:
  useConnectionPool - whether to pool connections for non-specific users.



setUseLdapContext
public void setUseLdapContext(boolean useLdapContext)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.