org.springframework.ldap.support
Class DirContextAdapter

java.lang.Object
  extended by org.springframework.ldap.support.DirContextAdapter
All Implemented Interfaces:
javax.naming.Context, javax.naming.directory.DirContext, AttributeModificationsAware, DirContextOperations

public class DirContextAdapter
extends java.lang.Object
implements DirContextOperations

Implements the interesting methods of the DirContext interface. In particular it contains utility methods for getting and setting Attributes. Using the DefaultDirObjectFactory in your ContextSource you may receive instances of this class from searches and lookups. This can be particularly useful when updating data, since this class implements AttributeModificationsAware, providing a getModificationItems() method.

Author:
Magnus Robertsson, Andreas Ronge, Adam Skogman, Mattias Arthursson

Field Summary
 
Fields inherited from interface javax.naming.directory.DirContext
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE
 
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
 
Constructor Summary
  DirContextAdapter()
          Default constructor.
  DirContextAdapter(javax.naming.directory.Attributes attrs, javax.naming.Name dn)
          Create a new adapter from the supplied attributes and dn.
  DirContextAdapter(javax.naming.directory.Attributes attrs, javax.naming.Name dn, javax.naming.Name base)
          Create a new adapter from the supplied attributes, dn, and base.
protected DirContextAdapter(DirContextAdapter master)
          Constructor for cloning an existing adapter.
  DirContextAdapter(javax.naming.Name dn)
          Create a new adapter from the supplied dn.
 
Method Summary
 java.lang.Object addToEnvironment(java.lang.String propName, java.lang.Object propVal)
           
 void bind(javax.naming.Name name, java.lang.Object obj)
           
 void bind(javax.naming.Name name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
           
 void bind(java.lang.String name, java.lang.Object obj)
           
 void bind(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
           
 void close()
           
 javax.naming.Name composeName(javax.naming.Name name, javax.naming.Name prefix)
           
 java.lang.String composeName(java.lang.String name, java.lang.String prefix)
           
 javax.naming.Context createSubcontext(javax.naming.Name name)
           
 javax.naming.directory.DirContext createSubcontext(javax.naming.Name name, javax.naming.directory.Attributes attrs)
           
 javax.naming.Context createSubcontext(java.lang.String name)
           
 javax.naming.directory.DirContext createSubcontext(java.lang.String name, javax.naming.directory.Attributes attrs)
           
 void destroySubcontext(javax.naming.Name name)
           
 void destroySubcontext(java.lang.String name)
           
 boolean equals(java.lang.Object obj)
           
protected  boolean exists(javax.naming.directory.Attribute attr)
          Checks if an entry has a specific attribute.
protected  boolean exists(java.lang.String attrId)
          Checks if the attribute exists in this entry, either it was read or it has been added and update() has been called.
 javax.naming.directory.Attributes getAttributes()
          Get all attributes.
 javax.naming.directory.Attributes getAttributes(javax.naming.Name name)
           
 javax.naming.directory.Attributes getAttributes(javax.naming.Name name, java.lang.String[] attrIds)
           
 javax.naming.directory.Attributes getAttributes(java.lang.String name)
           
 javax.naming.directory.Attributes getAttributes(java.lang.String name, java.lang.String[] attrIds)
           
 java.util.SortedSet getAttributeSortedStringSet(java.lang.String name)
          Get all String values of the attribute as a SortedSet.
 javax.naming.Name getDn()
          Returns DN, without the base path.
 java.util.Hashtable getEnvironment()
           
 NamingExceptionTranslator getExceptionTranslator()
          Get the NamingExceptionTranslator.
 javax.naming.directory.ModificationItem[] getModificationItems()
          Creates an array of which attributes have been changed or added or removed.
 java.lang.String getNameInNamespace()
           
 javax.naming.NameParser getNameParser(javax.naming.Name name)
           
 javax.naming.NameParser getNameParser(java.lang.String name)
           
 java.lang.String[] getNamesOfModifiedAttributes()
          Creates a String array of the names of the attributes which have been changed.
 java.lang.Object getObjectAttribute(java.lang.String name)
          Get the value of an Object attribute.
 javax.naming.directory.DirContext getSchema(javax.naming.Name name)
           
 javax.naming.directory.DirContext getSchema(java.lang.String name)
           
 javax.naming.directory.DirContext getSchemaClassDefinition(javax.naming.Name name)
           
 javax.naming.directory.DirContext getSchemaClassDefinition(java.lang.String name)
           
 java.lang.String getStringAttribute(java.lang.String name)
          Get the value of a String attribute.
 java.lang.String[] getStringAttributes(java.lang.String name)
          Get all values of a String attribute.
 int hashCode()
           
 boolean isUpdateMode()
          Gets the update mode.
 javax.naming.NamingEnumeration list(javax.naming.Name name)
           
 javax.naming.NamingEnumeration list(java.lang.String name)
           
 javax.naming.NamingEnumeration listBindings(javax.naming.Name name)
           
 javax.naming.NamingEnumeration listBindings(java.lang.String name)
           
 java.lang.Object lookup(javax.naming.Name name)
           
 java.lang.Object lookup(java.lang.String name)
           
 java.lang.Object lookupLink(javax.naming.Name name)
           
 java.lang.Object lookupLink(java.lang.String name)
           
 void modifyAttributes(javax.naming.Name name, int modOp, javax.naming.directory.Attributes attrs)
           
 void modifyAttributes(javax.naming.Name name, javax.naming.directory.ModificationItem[] mods)
           
 void modifyAttributes(java.lang.String name, int modOp, javax.naming.directory.Attributes attrs)
           
 void modifyAttributes(java.lang.String name, javax.naming.directory.ModificationItem[] mods)
           
 void rebind(javax.naming.Name name, java.lang.Object obj)
           
 void rebind(javax.naming.Name name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
           
 void rebind(java.lang.String name, java.lang.Object obj)
           
 void rebind(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
           
 java.lang.Object removeFromEnvironment(java.lang.String propName)
           
 void rename(javax.naming.Name oldName, javax.naming.Name newName)
           
 void rename(java.lang.String oldName, java.lang.String newName)
           
 javax.naming.NamingEnumeration search(javax.naming.Name name, javax.naming.directory.Attributes matchingAttributes)
           
 javax.naming.NamingEnumeration search(javax.naming.Name name, javax.naming.directory.Attributes matchingAttributes, java.lang.String[] attributesToReturn)
           
 javax.naming.NamingEnumeration search(javax.naming.Name name, java.lang.String filterExpr, java.lang.Object[] filterArgs, javax.naming.directory.SearchControls cons)
           
 javax.naming.NamingEnumeration search(javax.naming.Name name, java.lang.String filter, javax.naming.directory.SearchControls cons)
           
 javax.naming.NamingEnumeration search(java.lang.String name, javax.naming.directory.Attributes matchingAttributes)
           
 javax.naming.NamingEnumeration search(java.lang.String name, javax.naming.directory.Attributes matchingAttributes, java.lang.String[] attributesToReturn)
           
 javax.naming.NamingEnumeration search(java.lang.String name, java.lang.String filterExpr, java.lang.Object[] filterArgs, javax.naming.directory.SearchControls cons)
           
 javax.naming.NamingEnumeration search(java.lang.String name, java.lang.String filter, javax.naming.directory.SearchControls cons)
           
 void setAttribute(javax.naming.directory.Attribute attribute)
          Set the supplied attribute.
 void setAttributeValue(java.lang.String name, java.lang.Object value)
          Set the with the name name to the value.
 void setAttributeValues(java.lang.String name, java.lang.Object[] values)
          Sets a multivalue attribute, disregarding the order of the values.
 void setAttributeValues(java.lang.String name, java.lang.Object[] values, boolean orderMatters)
          Sets a multivalue attribute.
 void setDn(javax.naming.Name dn)
          Set the dn of this entry.
 void setExceptionTranslator(NamingExceptionTranslator exceptionTranslator)
          Set the NamingExceptionTranslator to use.
protected  void setUpdateMode(boolean mode)
          Sets the update mode.
 java.lang.String toString()
           
 void unbind(javax.naming.Name name)
           
 void unbind(java.lang.String name)
           
 void update()
          Update the attributes.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirContextAdapter

public DirContextAdapter()
Default constructor.


DirContextAdapter

public DirContextAdapter(javax.naming.Name dn)
Create a new adapter from the supplied dn.

Parameters:
dn - the dn.

DirContextAdapter

public DirContextAdapter(javax.naming.directory.Attributes attrs,
                         javax.naming.Name dn)
Create a new adapter from the supplied attributes and dn.

Parameters:
attrs - the attributes.
dn - the dn.

DirContextAdapter

public DirContextAdapter(javax.naming.directory.Attributes attrs,
                         javax.naming.Name dn,
                         javax.naming.Name base)
Create a new adapter from the supplied attributes, dn, and base.

Parameters:
attrs - the attributes.
dn - the dn.
base - the base name.

DirContextAdapter

protected DirContextAdapter(DirContextAdapter master)
Constructor for cloning an existing adapter.

Parameters:
master - The adapter to be copied.
Method Detail

setUpdateMode

protected void setUpdateMode(boolean mode)
Sets the update mode. The update mode should be false for a new entry and true for an existing entry that is being updated.

Parameters:
mode - Update mode.

isUpdateMode

public boolean isUpdateMode()
Description copied from interface: DirContextOperations
Gets the update mode. The update mode should be true for a new entry and true for an existing entry that is being updated.

Specified by:
isUpdateMode in interface DirContextOperations
Returns:
update mode

getNamesOfModifiedAttributes

public java.lang.String[] getNamesOfModifiedAttributes()
Description copied from interface: DirContextOperations
Creates a String array of the names of the attributes which have been changed. If this is a new entry, all set entries will be in the list. If this is an updated entry, only changed and removed entries will be in the array.

Specified by:
getNamesOfModifiedAttributes in interface DirContextOperations
Returns:
Array of String

getModificationItems

public javax.naming.directory.ModificationItem[] getModificationItems()
Description copied from interface: AttributeModificationsAware
Creates an array of which attributes have been changed or added or removed.

Specified by:
getModificationItems in interface AttributeModificationsAware
Returns:
an array of modification items

exists

protected final boolean exists(javax.naming.directory.Attribute attr)
Checks if an entry has a specific attribute. This method simply calls exists(String) with the attribute name.

Parameters:
attr - the attribute to check.
Returns:
true if attribute exists in entry.

exists

protected final boolean exists(java.lang.String attrId)
Checks if the attribute exists in this entry, either it was read or it has been added and update() has been called.

Parameters:
attrId - id of the attribute to check.
Returns:
true if the attribute exists in the entry.

getStringAttribute

public java.lang.String getStringAttribute(java.lang.String name)
Description copied from interface: DirContextOperations
Get the value of a String attribute.

Specified by:
getStringAttribute in interface DirContextOperations
Parameters:
name - name of the attribute.
Returns:
the value of the attribute.

getObjectAttribute

public java.lang.Object getObjectAttribute(java.lang.String name)
Description copied from interface: DirContextOperations
Get the value of an Object attribute.

Specified by:
getObjectAttribute in interface DirContextOperations
Parameters:
name - name of the attribute.
Returns:
the attribute value as an object if it exists, or null otherwise.

setAttributeValue

public void setAttributeValue(java.lang.String name,
                              java.lang.Object value)
Description copied from interface: DirContextOperations
Set the with the name name to the value.

Specified by:
setAttributeValue in interface DirContextOperations
Parameters:
name - name of the attribute.
value - value to set the attribute to.

setAttributeValues

public void setAttributeValues(java.lang.String name,
                               java.lang.Object[] values)
Description copied from interface: DirContextOperations
Sets a multivalue attribute, disregarding the order of the values. If value is null or value.length == 0 then the attribute will be removed. If update mode, changes will be made only if the array has more or less objects or if one or more object has changed. Reordering the objects will not cause an update.

Specified by:
setAttributeValues in interface DirContextOperations
Parameters:
name - The id of the attribute.
values - Attribute values.

setAttributeValues

public void setAttributeValues(java.lang.String name,
                               java.lang.Object[] values,
                               boolean orderMatters)
Description copied from interface: DirContextOperations
Sets a multivalue attribute. If value is null or value.length == 0 then the attribute will be removed. If update mode, changes will be made if the array has more or less objects or if one or more string has changed. Reordering the objects will only cause an update if orderMatters is set to true.

Specified by:
setAttributeValues in interface DirContextOperations
Parameters:
name - The id of the attribute.
values - Attribute values.
orderMatters - If true, it will be changed even if data was just reordered.

update

public void update()
Description copied from interface: DirContextOperations
Update the attributes. This will mean that the getters (getStringAttribute methods) will return the updated values. Remove the attributes to be updated.

Specified by:
update in interface DirContextOperations

getStringAttributes

public java.lang.String[] getStringAttributes(java.lang.String name)
Description copied from interface: DirContextOperations
Get all values of a String attribute.

Specified by:
getStringAttributes in interface DirContextOperations
Parameters:
name - name of the attribute.
Returns:
all registered values of the attribute.

getAttributeSortedStringSet

public java.util.SortedSet getAttributeSortedStringSet(java.lang.String name)
Description copied from interface: DirContextOperations
Get all String values of the attribute as a SortedSet.

Specified by:
getAttributeSortedStringSet in interface DirContextOperations
Parameters:
name - name of the attribute.
Returns:
a SortedSet containing all values of the attribute.

setAttribute

public void setAttribute(javax.naming.directory.Attribute attribute)
Set the supplied attribute.

Parameters:
attribute - the attribute to set.

getAttributes

public javax.naming.directory.Attributes getAttributes()
Get all attributes.

Returns:
all attributes.

getAttributes

public javax.naming.directory.Attributes getAttributes(javax.naming.Name name)
                                                throws javax.naming.NamingException
Specified by:
getAttributes in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.getAttributes(Name)

getAttributes

public javax.naming.directory.Attributes getAttributes(java.lang.String name)
                                                throws javax.naming.NamingException
Specified by:
getAttributes in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.getAttributes(String)

getAttributes

public javax.naming.directory.Attributes getAttributes(javax.naming.Name name,
                                                       java.lang.String[] attrIds)
                                                throws javax.naming.NamingException
Specified by:
getAttributes in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.getAttributes(Name, String[])

getAttributes

public javax.naming.directory.Attributes getAttributes(java.lang.String name,
                                                       java.lang.String[] attrIds)
                                                throws javax.naming.NamingException
Specified by:
getAttributes in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.getAttributes(String, String[])

modifyAttributes

public void modifyAttributes(javax.naming.Name name,
                             int modOp,
                             javax.naming.directory.Attributes attrs)
                      throws javax.naming.NamingException
Specified by:
modifyAttributes in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes)

modifyAttributes

public void modifyAttributes(java.lang.String name,
                             int modOp,
                             javax.naming.directory.Attributes attrs)
                      throws javax.naming.NamingException
Specified by:
modifyAttributes in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.modifyAttributes(String, int, Attributes)

modifyAttributes

public void modifyAttributes(javax.naming.Name name,
                             javax.naming.directory.ModificationItem[] mods)
                      throws javax.naming.NamingException
Specified by:
modifyAttributes in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.modifyAttributes(Name, ModificationItem[])

modifyAttributes

public void modifyAttributes(java.lang.String name,
                             javax.naming.directory.ModificationItem[] mods)
                      throws javax.naming.NamingException
Specified by:
modifyAttributes in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.modifyAttributes(String, ModificationItem[])

bind

public void bind(javax.naming.Name name,
                 java.lang.Object obj,
                 javax.naming.directory.Attributes attrs)
          throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.bind(Name, Object, Attributes)

bind

public void bind(java.lang.String name,
                 java.lang.Object obj,
                 javax.naming.directory.Attributes attrs)
          throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.bind(String, Object, Attributes)

rebind

public void rebind(javax.naming.Name name,
                   java.lang.Object obj,
                   javax.naming.directory.Attributes attrs)
            throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.rebind(Name, Object, Attributes)

rebind

public void rebind(java.lang.String name,
                   java.lang.Object obj,
                   javax.naming.directory.Attributes attrs)
            throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.rebind(String, Object, Attributes)

createSubcontext

public javax.naming.directory.DirContext createSubcontext(javax.naming.Name name,
                                                          javax.naming.directory.Attributes attrs)
                                                   throws javax.naming.NamingException
Specified by:
createSubcontext in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.createSubcontext(Name, Attributes)

createSubcontext

public javax.naming.directory.DirContext createSubcontext(java.lang.String name,
                                                          javax.naming.directory.Attributes attrs)
                                                   throws javax.naming.NamingException
Specified by:
createSubcontext in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.createSubcontext(String, Attributes)

getSchema

public javax.naming.directory.DirContext getSchema(javax.naming.Name name)
                                            throws javax.naming.NamingException
Specified by:
getSchema in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.getSchema(Name)

getSchema

public javax.naming.directory.DirContext getSchema(java.lang.String name)
                                            throws javax.naming.NamingException
Specified by:
getSchema in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.getSchema(String)

getSchemaClassDefinition

public javax.naming.directory.DirContext getSchemaClassDefinition(javax.naming.Name name)
                                                           throws javax.naming.NamingException
Specified by:
getSchemaClassDefinition in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.getSchemaClassDefinition(Name)

getSchemaClassDefinition

public javax.naming.directory.DirContext getSchemaClassDefinition(java.lang.String name)
                                                           throws javax.naming.NamingException
Specified by:
getSchemaClassDefinition in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.getSchemaClassDefinition(String)

search

public javax.naming.NamingEnumeration search(javax.naming.Name name,
                                             javax.naming.directory.Attributes matchingAttributes,
                                             java.lang.String[] attributesToReturn)
                                      throws javax.naming.NamingException
Specified by:
search in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.search(Name, Attributes, String[])

search

public javax.naming.NamingEnumeration search(java.lang.String name,
                                             javax.naming.directory.Attributes matchingAttributes,
                                             java.lang.String[] attributesToReturn)
                                      throws javax.naming.NamingException
Specified by:
search in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.search(String, Attributes, String[])

search

public javax.naming.NamingEnumeration search(javax.naming.Name name,
                                             javax.naming.directory.Attributes matchingAttributes)
                                      throws javax.naming.NamingException
Specified by:
search in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.search(Name, Attributes)

search

public javax.naming.NamingEnumeration search(java.lang.String name,
                                             javax.naming.directory.Attributes matchingAttributes)
                                      throws javax.naming.NamingException
Specified by:
search in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.search(String, Attributes)

search

public javax.naming.NamingEnumeration search(javax.naming.Name name,
                                             java.lang.String filter,
                                             javax.naming.directory.SearchControls cons)
                                      throws javax.naming.NamingException
Specified by:
search in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.search(Name, String, SearchControls)

search

public javax.naming.NamingEnumeration search(java.lang.String name,
                                             java.lang.String filter,
                                             javax.naming.directory.SearchControls cons)
                                      throws javax.naming.NamingException
Specified by:
search in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.search(String, String, SearchControls)

search

public javax.naming.NamingEnumeration search(javax.naming.Name name,
                                             java.lang.String filterExpr,
                                             java.lang.Object[] filterArgs,
                                             javax.naming.directory.SearchControls cons)
                                      throws javax.naming.NamingException
Specified by:
search in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.search(Name, String, Object[], SearchControls)

search

public javax.naming.NamingEnumeration search(java.lang.String name,
                                             java.lang.String filterExpr,
                                             java.lang.Object[] filterArgs,
                                             javax.naming.directory.SearchControls cons)
                                      throws javax.naming.NamingException
Specified by:
search in interface javax.naming.directory.DirContext
Throws:
javax.naming.NamingException
See Also:
DirContext.search(String, String, Object[], SearchControls)

lookup

public java.lang.Object lookup(javax.naming.Name name)
                        throws javax.naming.NamingException
Specified by:
lookup in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.lookup(Name)

lookup

public java.lang.Object lookup(java.lang.String name)
                        throws javax.naming.NamingException
Specified by:
lookup in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.lookup(String)

bind

public void bind(javax.naming.Name name,
                 java.lang.Object obj)
          throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.bind(Name, Object)

bind

public void bind(java.lang.String name,
                 java.lang.Object obj)
          throws javax.naming.NamingException
Specified by:
bind in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.bind(String, Object)

rebind

public void rebind(javax.naming.Name name,
                   java.lang.Object obj)
            throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.rebind(Name, Object)

rebind

public void rebind(java.lang.String name,
                   java.lang.Object obj)
            throws javax.naming.NamingException
Specified by:
rebind in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.rebind(String, Object)

unbind

public void unbind(javax.naming.Name name)
            throws javax.naming.NamingException
Specified by:
unbind in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.unbind(Name)

unbind

public void unbind(java.lang.String name)
            throws javax.naming.NamingException
Specified by:
unbind in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.unbind(String)

rename

public void rename(javax.naming.Name oldName,
                   javax.naming.Name newName)
            throws javax.naming.NamingException
Specified by:
rename in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.rename(Name, Name)

rename

public void rename(java.lang.String oldName,
                   java.lang.String newName)
            throws javax.naming.NamingException
Specified by:
rename in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.rename(String, String)

list

public javax.naming.NamingEnumeration list(javax.naming.Name name)
                                    throws javax.naming.NamingException
Specified by:
list in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.list(Name)

list

public javax.naming.NamingEnumeration list(java.lang.String name)
                                    throws javax.naming.NamingException
Specified by:
list in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.list(String)

listBindings

public javax.naming.NamingEnumeration listBindings(javax.naming.Name name)
                                            throws javax.naming.NamingException
Specified by:
listBindings in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.listBindings(Name)

listBindings

public javax.naming.NamingEnumeration listBindings(java.lang.String name)
                                            throws javax.naming.NamingException
Specified by:
listBindings in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.listBindings(String)

destroySubcontext

public void destroySubcontext(javax.naming.Name name)
                       throws javax.naming.NamingException
Specified by:
destroySubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.destroySubcontext(Name)

destroySubcontext

public void destroySubcontext(java.lang.String name)
                       throws javax.naming.NamingException
Specified by:
destroySubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.destroySubcontext(String)

createSubcontext

public javax.naming.Context createSubcontext(javax.naming.Name name)
                                      throws javax.naming.NamingException
Specified by:
createSubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.createSubcontext(Name)

createSubcontext

public javax.naming.Context createSubcontext(java.lang.String name)
                                      throws javax.naming.NamingException
Specified by:
createSubcontext in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.createSubcontext(String)

lookupLink

public java.lang.Object lookupLink(javax.naming.Name name)
                            throws javax.naming.NamingException
Specified by:
lookupLink in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.lookupLink(Name)

lookupLink

public java.lang.Object lookupLink(java.lang.String name)
                            throws javax.naming.NamingException
Specified by:
lookupLink in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.lookupLink(String)

getNameParser

public javax.naming.NameParser getNameParser(javax.naming.Name name)
                                      throws javax.naming.NamingException
Specified by:
getNameParser in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.getNameParser(Name)

getNameParser

public javax.naming.NameParser getNameParser(java.lang.String name)
                                      throws javax.naming.NamingException
Specified by:
getNameParser in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.getNameParser(String)

composeName

public javax.naming.Name composeName(javax.naming.Name name,
                                     javax.naming.Name prefix)
                              throws javax.naming.NamingException
Specified by:
composeName in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.composeName(Name, Name)

composeName

public java.lang.String composeName(java.lang.String name,
                                    java.lang.String prefix)
                             throws javax.naming.NamingException
Specified by:
composeName in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.composeName(String, String)

addToEnvironment

public java.lang.Object addToEnvironment(java.lang.String propName,
                                         java.lang.Object propVal)
                                  throws javax.naming.NamingException
Specified by:
addToEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.addToEnvironment(String, Object)

removeFromEnvironment

public java.lang.Object removeFromEnvironment(java.lang.String propName)
                                       throws javax.naming.NamingException
Specified by:
removeFromEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.removeFromEnvironment(String)

getEnvironment

public java.util.Hashtable getEnvironment()
                                   throws javax.naming.NamingException
Specified by:
getEnvironment in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.getEnvironment()

close

public void close()
           throws javax.naming.NamingException
Specified by:
close in interface javax.naming.Context
Throws:
javax.naming.NamingException
See Also:
Context.close()

getNameInNamespace

public java.lang.String getNameInNamespace()
Specified by:
getNameInNamespace in interface javax.naming.Context
See Also:
Context.getNameInNamespace()

getDn

public javax.naming.Name getDn()
Description copied from interface: DirContextOperations
Returns DN, without the base path.

Specified by:
getDn in interface DirContextOperations
Returns:
The distinguished name of the current context.
See Also:
getNameInNamespace()

setDn

public final void setDn(javax.naming.Name dn)
Description copied from interface: DirContextOperations
Set the dn of this entry.

Specified by:
setDn in interface DirContextOperations
Parameters:
dn - the dn.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getExceptionTranslator

public NamingExceptionTranslator getExceptionTranslator()
Get the NamingExceptionTranslator.

Returns:
the NamingExceptionTranslator to use; if none is specified, DefaultNamingExceptionTranslator is used.

setExceptionTranslator

public void setExceptionTranslator(NamingExceptionTranslator exceptionTranslator)
Set the NamingExceptionTranslator to use.

Parameters:
exceptionTranslator - the NamingExceptionTranslator to use.


Copyright 2002-2006. All Rights Reserved.