|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bankframe.ei.ldap.LDAPServerContext
public class 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 String |
BASE_DN
|
static String |
CONTEXT_ALIAS
|
static String |
DEFAULT_INITIAL_CONTEXT_FACTORY
|
static String |
DEFAULT_SEARCH_FILTER
|
static String |
INITIAL_CONTEXT_FACTORY
|
static String |
PROVIDER_URL
|
static String |
RDN_ATTRIBUTE
|
static String |
REFERRAL
|
static String |
SECURITY_AUTHENTICATION
|
static String |
SECURITY_CREDENTIALS
|
static String |
SECURITY_PRINCIPAL
|
static String |
SECURITY_PROTOCOL
|
Constructor Summary | |
---|---|
LDAPServerContext(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(String rdn,
Attributes attrs)
This method creates a new entry in the context with the specified attributes |
Attributes |
get(String rdn)
This method retrieves the attributes of an existing entry |
String |
getDn(String rdn)
This method gets the fully qualified distinguished name of the specified object |
DirContext |
getJndiContext()
This method gets a reference to the JNDI context for this connection |
Object |
getProperty(String name)
This method gets a property setting for this context |
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(String name,
Object value)
This method updates or adds a property setting in this context |
void |
remove(String rdn)
This method removes an entry from the context |
NamingEnumeration |
search(String filter,
Object[] filterArgs)
This method searches for objects matching the specified filter, in the current context and in all sub-contexts. |
String |
toString()
This method converts this context to a string representation. |
void |
update(String rdn,
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 String PROVIDER_URL
public static final String INITIAL_CONTEXT_FACTORY
public static final String SECURITY_AUTHENTICATION
public static final String SECURITY_PRINCIPAL
public static final String SECURITY_CREDENTIALS
public static final String SECURITY_PROTOCOL
public static final String REFERRAL
public static final String BASE_DN
public static final String CONTEXT_ALIAS
public static final String RDN_ATTRIBUTE
public static final String DEFAULT_SEARCH_FILTER
public static final String DEFAULT_INITIAL_CONTEXT_FACTORY
Constructor Detail |
---|
public LDAPServerContext(Hashtable ldapServerProperties)
ldapServerProperties
- Hashtable containing the configuration informationMethod Detail |
---|
public void close() throws NamingException
NamingException
- if an error occurspublic void create(String rdn, Attributes attrs) throws NamingException
rdn
- Relative Distinguished Name of the new entryattrs
- Attributes of the new entry
NamingException
- if the entry cannot be createdpublic Attributes get(String rdn) throws NamingException
rdn
- String Relative Distinguished Name of the entry to retrieve
NamingException
- if the entry cannot be rerievedpublic String getDn(String rdn) throws NamingException
rdn
- String Relative distinguished name of the object
NamingException
- on errorpublic DirContext getJndiContext() throws NamingException
NamingException
public Object getProperty(String name)
name
- String Name of the property to retrieve
public Enumeration list() throws NamingException
NamingException
- on errorpublic void open() throws NamingException
NamingException
- if the connection cannot be openedpublic void putProperty(String name, Object value) throws NamingException
name
- Name of the property to add/updatevalue
- Value of the property
NamingException
- if an error occurspublic void remove(String rdn) throws NamingException
rdn
- Relative Distinguished Name of the entry to remove
NamingException
- on errorpublic NamingEnumeration search(String filter, Object[] filterArgs) throws NamingException, InvalidSearchFilterException
Enumeration
of SearchResult
s
NamingException
InvalidSearchFilterException
public String toString()
toString
in class Object
public void update(String rdn, Attributes attrs) throws NamingException
rdn
- Relative Distinguished Name of the entry to updateattrs
- The attributes to update
NamingException
- on error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |