org.objectweb.jonas.ldap
Class DataSourceLDAPImpl

java.lang.Object
  |
  +--org.objectweb.jonas.ldap.DataSourceLDAPImpl
All Implemented Interfaces:
DataSourceLDAP, javax.naming.Referenceable, java.io.Serializable

public class DataSourceLDAPImpl
extends java.lang.Object
implements DataSourceLDAP, javax.naming.Referenceable, java.io.Serializable

This object acts as a factory for LDAP connections (tested on Netscape Directory Server 3.0)

Author:
Paul Desgranges, Philippe Durieux Contributor(): Philippe. Coq
See Also:
Serialized Form

Constructor Summary
DataSourceLDAPImpl()
          Constructor for DataSourceLDAPImplFactory
 
Method Summary
 java.lang.String getDataSourceName()
           
 javax.naming.directory.DirContext getDirContext()
          Attempts to get a context to interface the LDAP server via JNDI.
 javax.naming.directory.DirContext getDirContext(java.lang.String userName, java.lang.String password)
          Attempts to get a context to interface the LDAP server via JNDI.
 java.lang.String getPassword()
           
 javax.naming.Reference getReference()
          Retrieves the Reference of this object.
 java.lang.String getUrl()
           
 java.lang.String getUserName()
           
 void setBinAttribs(java.lang.String s)
          Set the list of byte-array attributes for this bean.
 void setDataSourceName(java.lang.String s)
           
 void setPassword(java.lang.String s)
           
 void setUrl(java.lang.String s)
           
 void setUserName(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceLDAPImpl

public DataSourceLDAPImpl()
Constructor for DataSourceLDAPImplFactory
Method Detail

getDataSourceName

public java.lang.String getDataSourceName()

setDataSourceName

public void setDataSourceName(java.lang.String s)

getUserName

public java.lang.String getUserName()

setUserName

public void setUserName(java.lang.String s)

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String s)

getUrl

public java.lang.String getUrl()

setUrl

public void setUrl(java.lang.String s)

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Retrieves the Reference of this object.
Specified by:
getReference in interface javax.naming.Referenceable
Returns:
The non-null Reference of this object.
Throws:
javax.naming.NamingException - If a naming exception was encountered while retrieving the reference.

setBinAttribs

public void setBinAttribs(java.lang.String s)
Description copied from interface: DataSourceLDAP
Set the list of byte-array attributes for this bean. Note that we have one datasource per lookup (i.e. per bean)!
Specified by:
setBinAttribs in interface DataSourceLDAP
Following copied from interface: org.objectweb.jonas.ldap.DataSourceLDAP
Parameters:
name - of the attribute

getDirContext

public javax.naming.directory.DirContext getDirContext()
                                                throws javax.naming.NamingException
Attempts to get a context to interface the LDAP server via JNDI.
Specified by:
getDirContext in interface DataSourceLDAP
Returns:
a DirContext to the database.
Throws:
javax.naming.NamingException - - if a database-access error occurs.

getDirContext

public javax.naming.directory.DirContext getDirContext(java.lang.String userName,
                                                       java.lang.String password)
                                                throws javax.naming.NamingException
Attempts to get a context to interface the LDAP server via JNDI.
Specified by:
getDirContext in interface DataSourceLDAP
Parameters:
user - - the database user on whose behalf the Connection is being made.
password - - the user's password
Returns:
a DirContext to the database
Throws:
javax.naming.NamingException - - if a jndi error occurs.