Spring LDAP

org.springframework.ldap.core
Class DirContextAdapter

java.lang.Object
  extended by org.springframework.ldap.core.DirContextAdapter
All Implemented Interfaces:
Context, DirContext, AttributeModificationsAware, DirContextOperations

public class DirContextAdapter
extends Object
implements DirContextOperations

Adapter that 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 (which is the default) you will 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. When in update mode, an object of this class keeps track of the changes made to its attributes, making them available as an array of ModificationItem objects, suitable as input to LdapTemplate.modifyAttributes(DirContextOperations). Note that this is not a complete implementation of DirContext. Several methods are not relevant for the intended usage of this class, so they throw UnsupportOperationException.

Author:
Magnus Robertsson, Andreas Ronge, Adam Skogman, Mattias Hellborg Arthursson
See Also:
setAttributeValue(String, Object), setAttributeValues(String, Object[]), getStringAttribute(String), getStringAttributes(String), getObjectAttribute(String), addAttributeValue(String, Object), removeAttributeValue(String, Object), setUpdateMode(boolean), isUpdateMode()

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(Attributes attrs, Name dn)
          Create a new adapter from the supplied attributes and dn.
  DirContextAdapter(Attributes attrs, Name dn, Name base)
          Create a new adapter from the supplied attributes, dn, and base.
  DirContextAdapter(Attributes attrs, Name dn, Name base, String referralUrl)
          Create a new adapter from the supplied attributes, dn, base, and referral url.
protected DirContextAdapter(DirContextAdapter master)
          Constructor for cloning an existing adapter.
  DirContextAdapter(Name dn)
          Create a new adapter from the supplied dn.
  DirContextAdapter(String dnString)
          Create a new DirContextAdapter from the supplied DN String.
 
Method Summary
 void addAttributeValue(String name, Object value)
          Add a value to the Attribute with the specified name.
 void addAttributeValue(String name, Object value, boolean addIfDuplicateExists)
          Add a value to the Attribute with the specified name.
 Object addToEnvironment(String propName, Object propVal)
           
 boolean attributeExists(String name)
          Check if an Object attribute exists, regardless of whether it has a value or not.
 void bind(Name name, Object obj)
           
 void bind(Name name, Object obj, Attributes attrs)
           
 void bind(String name, Object obj)
           
 void bind(String name, Object obj, Attributes attrs)
           
 void close()
           
 Name composeName(Name name, Name prefix)
           
 String composeName(String name, String prefix)
           
 Context createSubcontext(Name name)
           
 DirContext createSubcontext(Name name, Attributes attrs)
           
 Context createSubcontext(String name)
           
 DirContext createSubcontext(String name, Attributes attrs)
           
 void destroySubcontext(Name name)
           
 void destroySubcontext(String name)
           
 boolean equals(Object obj)
           
protected  boolean exists(Attribute attr)
          Checks if an entry has a specific attribute.
protected  boolean exists(String attrId)
          Checks if the attribute exists in this entry, either it was read or it has been added and update() has been called.
 Attributes getAttributes()
          Get all attributes.
 Attributes getAttributes(Name name)
           
 Attributes getAttributes(Name name, String[] attrIds)
           
 Attributes getAttributes(String name)
           
 Attributes getAttributes(String name, String[] attrIds)
           
 SortedSet getAttributeSortedStringSet(String name)
          Get all String values of the attribute as a SortedSet.
 Name getDn()
          Returns the DN relative to the base path.
 Hashtable getEnvironment()
           
 ModificationItem[] getModificationItems()
          Creates an array of which attributes have been changed, added or removed since the initialization of this object.
 String getNameInNamespace()
           
 NameParser getNameParser(Name name)
           
 NameParser getNameParser(String name)
           
 String[] getNamesOfModifiedAttributes()
          Creates a String array of the names of the attributes which have been changed.
 Object getObjectAttribute(String name)
          Get the value of an Object attribute.
 Object[] getObjectAttributes(String name)
          Get all values of an Object attribute.
 String getReferralUrl()
          If this instance results from a referral, this method returns the url of the referred server.
 DirContext getSchema(Name name)
           
 DirContext getSchema(String name)
           
 DirContext getSchemaClassDefinition(Name name)
           
 DirContext getSchemaClassDefinition(String name)
           
 String getStringAttribute(String name)
          Get the value of a String attribute.
 String[] getStringAttributes(String name)
          Get all values of a String attribute.
 int hashCode()
           
 boolean isReferral()
          Checks whether this instance results from a referral.
 boolean isUpdateMode()
          Gets the update mode.
 NamingEnumeration list(Name name)
           
 NamingEnumeration list(String name)
           
 NamingEnumeration listBindings(Name name)
           
 NamingEnumeration listBindings(String name)
           
 Object lookup(Name name)
           
 Object lookup(String name)
           
 Object lookupLink(Name name)
           
 Object lookupLink(String name)
           
 void modifyAttributes(Name name, int modOp, Attributes attrs)
           
 void modifyAttributes(Name name, ModificationItem[] mods)
           
 void modifyAttributes(String name, int modOp, Attributes attrs)
           
 void modifyAttributes(String name, ModificationItem[] mods)
           
 void rebind(Name name, Object obj)
           
 void rebind(Name name, Object obj, Attributes attrs)
           
 void rebind(String name, Object obj)
           
 void rebind(String name, Object obj, Attributes attrs)
           
 void removeAttributeValue(String name, Object value)
          Remove a value from the Attribute with the specified name.
 Object removeFromEnvironment(String propName)
           
 void rename(Name oldName, Name newName)
           
 void rename(String oldName, String newName)
           
 NamingEnumeration search(Name name, Attributes matchingAttributes)
           
 NamingEnumeration search(Name name, Attributes matchingAttributes, String[] attributesToReturn)
           
 NamingEnumeration search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons)
           
 NamingEnumeration search(Name name, String filter, SearchControls cons)
           
 NamingEnumeration search(String name, Attributes matchingAttributes)
           
 NamingEnumeration search(String name, Attributes matchingAttributes, String[] attributesToReturn)
           
 NamingEnumeration search(String name, String filterExpr, Object[] filterArgs, SearchControls cons)
           
 NamingEnumeration search(String name, String filter, SearchControls cons)
           
 void setAttribute(Attribute attribute)
          Set the supplied attribute.
 void setAttributeValue(String name, Object value)
          Set the with the name name to the value.
 void setAttributeValues(String name, Object[] values)
          Sets a multivalue attribute, disregarding the order of the values.
 void setAttributeValues(String name, Object[] values, boolean orderMatters)
          Sets a multivalue attribute.
 void setDn(Name dn)
          Set the dn of this entry.
 void setUpdateMode(boolean mode)
          Sets the update mode.
 String toString()
           
 void unbind(Name name)
           
 void unbind(String name)
           
 void update()
          Update the attributes.This will mean that the getters ( getStringAttribute methods) will return the updated values, and the modifications will be forgotten (i.e.
 
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(String dnString)
Create a new DirContextAdapter from the supplied DN String.

Parameters:
dnString - the DN string. Must be syntactically correct, or an exception will be thrown.

DirContextAdapter

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

Parameters:
dn - the dn.

DirContextAdapter

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

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

DirContextAdapter

public DirContextAdapter(Attributes attrs,
                         Name dn,
                         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

public DirContextAdapter(Attributes attrs,
                         Name dn,
                         Name base,
                         String referralUrl)
Create a new adapter from the supplied attributes, dn, base, and referral url.

Parameters:
attrs - the attributes.
dn - the dn.
base - the base.
referralUrl - the referral url (if this instance results from a referral).

DirContextAdapter

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

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

setUpdateMode

public 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. An entry in update mode will keep track of its modifications so that they can be retrieved using AttributeModificationsAware.getModificationItems(). 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 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 ModificationItem[] getModificationItems()
Description copied from interface: AttributeModificationsAware
Creates an array of which attributes have been changed, added or removed since the initialization of this object.

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

exists

protected final boolean exists(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(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 String getStringAttribute(String name)
Description copied from interface: DirContextOperations
Get the value of a String attribute. If more than one attribute value exists for the specified attribute, only the first one will be returned. If an attribute has no value, null will be returned.

Specified by:
getStringAttribute in interface DirContextOperations
Parameters:
name - name of the attribute.
Returns:
the value of the attribute if it exists, or null if the attribute doesn't exist or if it exists but with no value.

getObjectAttribute

public Object getObjectAttribute(String name)
Description copied from interface: DirContextOperations
Get the value of an Object attribute. If more than one attribute value exists for the specified attribute, only the first one will be returned. If an attribute has no value, null will be returned.

Specified by:
getObjectAttribute in interface DirContextOperations
Parameters:
name - name of the attribute.
Returns:
the attribute value as an object if it exists, or null if the attribute doesn't exist or if it exists but with no value.

attributeExists

public boolean attributeExists(String name)
Description copied from interface: DirContextOperations
Check if an Object attribute exists, regardless of whether it has a value or not.

Specified by:
attributeExists in interface DirContextOperations
Parameters:
name - name of the attribute
Returns:
true if the attribute exists, false otherwise

setAttributeValue

public void setAttributeValue(String name,
                              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.

addAttributeValue

public void addAttributeValue(String name,
                              Object value)
Description copied from interface: DirContextOperations
Add a value to the Attribute with the specified name. If the Attribute doesn't exist it will be created. This method makes sure that the there will be no duplicates of an added value - it the value exists it will not be added again.

Specified by:
addAttributeValue in interface DirContextOperations
Parameters:
name - the name of the Attribute to which the specified value should be added.
value - the Attribute value to add.

addAttributeValue

public void addAttributeValue(String name,
                              Object value,
                              boolean addIfDuplicateExists)
Description copied from interface: DirContextOperations
Add a value to the Attribute with the specified name. If the Attribute doesn't exist it will be created. The addIfDuplicateExists parameter controls the handling of duplicates. It false, this method makes sure that the there will be no duplicates of an added value - it the value exists it will not be added again.

Specified by:
addAttributeValue in interface DirContextOperations
Parameters:
name - the name of the Attribute to which the specified value should be added.
value - the Attribute value to add.
addIfDuplicateExists - true will add the value regardless of whether there is an identical value already, allowing for duplicate attribute values; false will not add the value if it already exists.

removeAttributeValue

public void removeAttributeValue(String name,
                                 Object value)
Description copied from interface: DirContextOperations
Remove a value from the Attribute with the specified name. If the Attribute doesn't exist, do nothing.

Specified by:
removeAttributeValue in interface DirContextOperations
Parameters:
name - the name of the Attribute from which the specified value should be removed.
value - the value to remove.

setAttributeValues

public void setAttributeValues(String name,
                               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(String name,
                               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, and the modifications will be forgotten (i.e. AttributeModificationsAware.getModificationItems() will return an empty array.

Specified by:
update in interface DirContextOperations

getStringAttributes

public String[] getStringAttributes(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:
a (possibly empty) array containing all registered values of the attribute as Strings if the attribute is defined or null otherwise.

getObjectAttributes

public Object[] getObjectAttributes(String name)
Description copied from interface: DirContextOperations
Get all values of an Object attribute.

Specified by:
getObjectAttributes in interface DirContextOperations
Parameters:
name - name of the attribute.
Returns:
a (possibly empty) array containing all registered values of the attribute if the attribute is defined or null otherwise.

getAttributeSortedStringSet

public SortedSet getAttributeSortedStringSet(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, or null if the attribute does not exist.

setAttribute

public void setAttribute(Attribute attribute)
Set the supplied attribute.

Parameters:
attribute - the attribute to set.

getAttributes

public Attributes getAttributes()
Get all attributes.

Specified by:
getAttributes in interface DirContextOperations
Returns:
all attributes.

getAttributes

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

getAttributes

public Attributes getAttributes(String name)
                         throws NamingException
Specified by:
getAttributes in interface DirContext
Throws:
NamingException
See Also:
DirContext.getAttributes(String)

getAttributes

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

getAttributes

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

modifyAttributes

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

modifyAttributes

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

modifyAttributes

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

modifyAttributes

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

bind

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

bind

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

rebind

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

rebind

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

createSubcontext

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

createSubcontext

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

getSchema

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

getSchema

public DirContext getSchema(String name)
                     throws NamingException
Specified by:
getSchema in interface DirContext
Throws:
NamingException
See Also:
DirContext.getSchema(String)

getSchemaClassDefinition

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

getSchemaClassDefinition

public DirContext getSchemaClassDefinition(String name)
                                    throws NamingException
Specified by:
getSchemaClassDefinition in interface DirContext
Throws:
NamingException
See Also:
DirContext.getSchemaClassDefinition(String)

search

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

search

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

search

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

search

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

search

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

search

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

search

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

search

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

lookup

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

lookup

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

bind

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

bind

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

rebind

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

rebind

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

unbind

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

unbind

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

rename

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

rename

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

list

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

list

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

listBindings

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

listBindings

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

destroySubcontext

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

destroySubcontext

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

createSubcontext

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

createSubcontext

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

lookupLink

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

lookupLink

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

getNameParser

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

getNameParser

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

composeName

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

composeName

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

addToEnvironment

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

removeFromEnvironment

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

getEnvironment

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

close

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

getNameInNamespace

public String getNameInNamespace()
Specified by:
getNameInNamespace in interface Context
Specified by:
getNameInNamespace in interface DirContextOperations
See Also:
Context.getNameInNamespace()

getDn

public Name getDn()
Description copied from interface: DirContextOperations
Returns the DN relative to 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(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(Object obj)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

hashCode

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

toString

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

getReferralUrl

public String getReferralUrl()
Description copied from interface: DirContextOperations
If this instance results from a referral, this method returns the url of the referred server.

Specified by:
getReferralUrl in interface DirContextOperations
Returns:
The url of the referred server, e.g. ldap://localhost:389, or the empty string if this is not a referral.

isReferral

public boolean isReferral()
Description copied from interface: DirContextOperations
Checks whether this instance results from a referral.

Specified by:
isReferral in interface DirContextOperations
Returns:
true if this instance results from a referral, false otherwise.

Spring LDAP