|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bankframe.ei.ldap.LDAPServerContext
This class provides the connectivity to an LDAP server. Connecting to the server requires several configuration parameters, these are defined as the following constant fields in this class
The physical connection to the server will not be established until it is actually required ie. when one of create(), get(), update(), remove() or list() is called. The physical connection will be closed when the context is destroyed, it can also be closed explicitly by calling the close() method. The open() method can be used to explicitly establish the physical connection.
Field Summary | |
static java.lang.String |
BASE_DN
|
static java.lang.String |
CONTEXT_ALIAS
|
static java.lang.String |
DEFAULT_INITIAL_CONTEXT_FACTORY
|
static java.lang.String |
DEFAULT_SEARCH_FILTER
|
static java.lang.String |
INITIAL_CONTEXT_FACTORY
|
static java.lang.String |
PROVIDER_URL
|
static java.lang.String |
RDN_ATTRIBUTE
|
static java.lang.String |
REFERRAL
|
static java.lang.String |
SECURITY_AUTHENTICATION
|
static java.lang.String |
SECURITY_CREDENTIALS
|
static java.lang.String |
SECURITY_PRINCIPAL
|
static java.lang.String |
SECURITY_PROTOCOL
|
Constructor Summary | |
LDAPServerContext(java.util.Hashtable ldapServerProperties)
This constructor creates a LDAPServerContext instance using the configuration settings in the hashtable. |
Method Summary | |
void |
close()
This method closes the connection to the server |
void |
create(java.lang.String rdn,
javax.naming.directory.Attributes attrs)
This method creates a new entry in the context with the specified attributes |
javax.naming.directory.Attributes |
get(java.lang.String rdn)
This method retrieves the attributes of an existing entry |
java.lang.String |
getDn(java.lang.String rdn)
This method gets the fully qualified distinguished name of the specified object |
javax.naming.directory.DirContext |
getJndiContext()
This method gets a reference to the JNDI context for this connection |
java.lang.Object |
getProperty(java.lang.String name)
This method gets a property setting for this context |
java.util.Enumeration |
list()
This method lists the names of all the entries in this context |
void |
open()
This method opens a connection with the LDAP server |
void |
putProperty(java.lang.String name,
java.lang.Object value)
This method updates or adds a property setting in this context |
void |
remove(java.lang.String rdn)
This method removes an entry from the context |
javax.naming.NamingEnumeration |
search(java.lang.String filter,
java.lang.Object[] filterArgs)
This method searches for objects matching the specified filter, in the current context and in all sub-contexts. |
java.lang.String |
toString()
This method converts this context to a string representation. |
void |
update(java.lang.String rdn,
javax.naming.directory.Attributes attrs)
This method updates the attributes of an existing entry |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String PROVIDER_URL
public static final java.lang.String INITIAL_CONTEXT_FACTORY
public static final java.lang.String SECURITY_AUTHENTICATION
public static final java.lang.String SECURITY_PRINCIPAL
public static final java.lang.String SECURITY_CREDENTIALS
public static final java.lang.String SECURITY_PROTOCOL
public static final java.lang.String REFERRAL
public static final java.lang.String BASE_DN
public static final java.lang.String CONTEXT_ALIAS
public static final java.lang.String RDN_ATTRIBUTE
public static final java.lang.String DEFAULT_SEARCH_FILTER
public static final java.lang.String DEFAULT_INITIAL_CONTEXT_FACTORY
Constructor Detail |
public LDAPServerContext(java.util.Hashtable ldapServerProperties)
ldapServerProperties
- Hashtable containing the configuration informationMethod Detail |
public void close() throws javax.naming.NamingException
javax.naming.NamingException
- if an error occurspublic void create(java.lang.String rdn, javax.naming.directory.Attributes attrs) throws javax.naming.NamingException
rdn
- Relative Distinguished Name of the new entryattrs
- Attributes of the new entry
javax.naming.NamingException
- if the entry cannot be createdpublic javax.naming.directory.Attributes get(java.lang.String rdn) throws javax.naming.NamingException
rdn
- Relative Distinguished Name of the entry to retrieve
javax.naming.NamingException
- if the entry cannot be rerievedpublic java.lang.String getDn(java.lang.String rdn) throws javax.naming.NamingException
rdn
- Relative distinguished name of the object
javax.naming.NamingException
- on errorpublic javax.naming.directory.DirContext getJndiContext() throws javax.naming.NamingException
javax.naming.NamingException
public java.lang.Object getProperty(java.lang.String name)
name
- Name of the property to retrievepublic java.util.Enumeration list() throws javax.naming.NamingException
javax.naming.NamingException
- on errorpublic void open() throws javax.naming.NamingException
javax.naming.NamingException
- if the connection cannot be openedpublic void putProperty(java.lang.String name, java.lang.Object value) throws javax.naming.NamingException
name
- Name of the property to add/updatevalue
- Value of the property
javax.naming.NamingException
- if an error occurspublic void remove(java.lang.String rdn) throws javax.naming.NamingException
rdn
- Relative Distinguished Name of the entry to remove
javax.naming.NamingException
- on errorpublic javax.naming.NamingEnumeration search(java.lang.String filter, java.lang.Object[] filterArgs) throws javax.naming.NamingException, javax.naming.directory.InvalidSearchFilterException
Enumeration
of SearchResult
s
javax.naming.NamingException
javax.naming.directory.InvalidSearchFilterException
public java.lang.String toString()
public void update(java.lang.String rdn, javax.naming.directory.Attributes attrs) throws javax.naming.NamingException
rdn
- Relative Distinguished Name of the entry to updateattrs
- The attributes to update
javax.naming.NamingException
- on error
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |