net.sf.ldaptemplate
Interface LdapOperations

All Known Implementing Classes:
LdapTemplate

public interface LdapOperations

Interface that specifies a basic set of LDAP operations. Implemented by LdapTemplate. Useful option to enhance testability.

Author:
Mattias Arthursson, Ulrik Sandberg

Method Summary
 void bind(javax.naming.Name dn, java.lang.Object obj, javax.naming.directory.Attributes attributes)
          Bind the supplied object together with the attributes to the specified dn.
 void bind(java.lang.String dn, java.lang.Object obj, javax.naming.directory.Attributes attributes)
          Bind the supplied object together with the attributes to the specified dn.
 java.lang.Object executeReadOnly(ContextExecutor ce)
          Perform an operation (or series of operations) on a read-only context.
 java.lang.Object executeReadWrite(ContextExecutor ce)
          Perform an operation (or series of operations) on a read-write context.
 java.lang.Object lookup(javax.naming.Name dn)
          Lookup the supplied DN and return the found object.
 java.lang.Object lookup(javax.naming.Name dn, AttributesMapper mapper)
          Convenience method to get the attributes of a specified DN and automatically pass them to an AttributesMapper.
 java.lang.Object lookup(javax.naming.Name dn, ContextMapper mapper)
          Convenience method to lookup a specified DN and automatically pass the found objectt to a ContextMapper.
 java.lang.Object lookup(java.lang.String dn)
          Lookup the supplied DN and return the found object.
 java.lang.Object lookup(java.lang.String dn, AttributesMapper mapper)
          Convenience method to get the attributes of a specified DN and automatically pass them to an AttributesMapper.
 java.lang.Object lookup(java.lang.String dn, ContextMapper mapper)
          Convenience method to lookup a specified DN and automatically pass the found objectt to a ContextMapper.
 void modifyAttributes(javax.naming.Name dn, javax.naming.directory.ModificationItem[] mods)
          Modify the distinguished name dn with the supplied ModificationItems.
 void modifyAttributes(java.lang.String dn, javax.naming.directory.ModificationItem[] mods)
          Modify the distinguished name dn with the supplied ModificationItems.
 void rebind(javax.naming.Name dn, java.lang.Object obj, javax.naming.directory.Attributes attributes)
          Rebind the name to the object along with the specified attributes, overwriting any previous values.
 void rebind(java.lang.String dn, java.lang.Object obj, javax.naming.directory.Attributes attributes)
          Rebind the name to the object along with the specified attributes, overwriting any previous values.
 void rename(javax.naming.Name oldDn, javax.naming.Name newDn)
          Binds a new name to the object bound to an old name, and unbinds the old name.
 void rename(java.lang.String oldDn, java.lang.String newDn)
          Binds a new name to the object bound to an old name, and unbinds the old name.
 java.util.List search(javax.naming.Name base, java.lang.String filter, AttributesMapper mapper)
          Search for all objects matching the supplied filter.
 java.util.List search(javax.naming.Name base, java.lang.String filter, ContextMapper mapper)
          Search for all objects matching the supplied filter.
 java.util.List search(javax.naming.Name base, java.lang.String filter, int searchScope, AttributesMapper mapper)
          Search for all objects matching the supplied filter.
 void search(javax.naming.Name base, java.lang.String filter, int searchScope, boolean returningObjFlag, SearchResultCallbackHandler handler)
          Search for all objects matching the supplied filter.
 java.util.List search(javax.naming.Name base, java.lang.String filter, int searchScope, ContextMapper mapper)
          Search for all objects matching the supplied filter.
 java.util.List search(javax.naming.Name base, java.lang.String filter, javax.naming.directory.SearchControls controls, AttributesMapper mapper)
          Search for all objects matching the supplied filter.
 java.util.List search(javax.naming.Name base, java.lang.String filter, javax.naming.directory.SearchControls controls, ContextMapper mapper)
          Search for all objects matching the supplied filter.
 void search(javax.naming.Name base, java.lang.String filter, javax.naming.directory.SearchControls controls, SearchResultCallbackHandler handler)
          Search for all objects matching the supplied filter.
 void search(javax.naming.Name base, java.lang.String filter, SearchResultCallbackHandler handler)
          Search for all objects matching the supplied filter.
 void search(SearchExecutor se, SearchResultCallbackHandler handler)
          Perform a search.
 java.util.List search(java.lang.String base, java.lang.String filter, AttributesMapper mapper)
          Search for all objects matching the supplied filter.
 java.util.List search(java.lang.String base, java.lang.String filter, ContextMapper mapper)
          Search for all objects matching the supplied filter.
 java.util.List search(java.lang.String base, java.lang.String filter, int searchScope, AttributesMapper mapper)
          Search for all objects matching the supplied filter.
 void search(java.lang.String base, java.lang.String filter, int searchScope, boolean returningObjFlag, SearchResultCallbackHandler handler)
          Search for all objects matching the supplied filter.
 java.util.List search(java.lang.String base, java.lang.String filter, int searchScope, ContextMapper mapper)
          Search for all objects matching the supplied filter.
 java.util.List search(java.lang.String base, java.lang.String filter, javax.naming.directory.SearchControls controls, AttributesMapper mapper)
          Search for all objects matching the supplied filter.
 java.util.List search(java.lang.String base, java.lang.String filter, javax.naming.directory.SearchControls controls, ContextMapper mapper)
          Search for all objects matching the supplied filter.
 void search(java.lang.String base, java.lang.String filter, javax.naming.directory.SearchControls controls, SearchResultCallbackHandler handler)
          Search for all objects matching the supplied filter.
 void search(java.lang.String base, java.lang.String filter, SearchResultCallbackHandler handler)
          Search for all objects matching the supplied filter.
 void unbind(javax.naming.Name dn)
          Unbind the specified distinguished name.
 void unbind(javax.naming.Name dn, boolean recursive)
          Unbind the specified distinguished name.
 void unbind(java.lang.String dn)
          Unbind the specified distinguished name.
 void unbind(java.lang.String dn, boolean recursive)
          Unbind the specified distinguished name.
 

Method Detail

search

public void search(SearchExecutor se,
                   SearchResultCallbackHandler handler)
            throws org.springframework.dao.DataAccessException
Perform a search. Use this method only if especially needed - for the most cases there is an overloaded convenience method which calls this one with suitable argments. This method handles all the plumbing; getting a readonly context; looping through the NamingEnumeration and closing the context and enumeration. The actual search is delegated to the SearchExecutor and each SearchResult is passed to the CallbackHandler. Any encountered NamingException will be translated using the NamingExceptionTranslator.

Parameters:
se - the SearchExecutor to use for performing the actual search.
handler - the SearchResultCallbackHandler to which each found entry will be passed.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

executeReadOnly

public java.lang.Object executeReadOnly(ContextExecutor ce)
                                 throws org.springframework.dao.DataAccessException
Perform an operation (or series of operations) on a read-only context. This method handles the plumbing - getting a DirContext, translating any exceptions and closing the context afterwards. This method is not intended for searches; use search(SearchExecutor, SearchResultCallbackHandler) or any of the overloaded search methods for this.

Parameters:
ce - the ContextExecutor to which the actual operation on the DirContext will be delegated.
Returns:
the result from the ContextExecutor's operation.
Throws:
org.springframework.dao.DataAccessException - if the operation resulted in a NamingException.

executeReadWrite

public java.lang.Object executeReadWrite(ContextExecutor ce)
                                  throws org.springframework.dao.DataAccessException
Perform an operation (or series of operations) on a read-write context. This method handles the plumbing - getting a DirContext, translating any exceptions and closing the context afterwards.

Parameters:
ce - the ContextExecutor to which the actual operation on the DirContext will be delegated.
Returns:
the result from the ContextExecutor's operation.
Throws:
org.springframework.dao.DataAccessException - if the operation resulted in a NamingException.

search

public void search(javax.naming.Name base,
                   java.lang.String filter,
                   javax.naming.directory.SearchControls controls,
                   SearchResultCallbackHandler handler)
Search for all objects matching the supplied filter. Each SearchResult is supplied to the specified SearchResultCallbackHandler. Use the specified SearchControls in the search. Note that if you are using a ContextMapper, the returningObjFlag needs to be set to true.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
controls - the SearchControls to use in the search.
handler - the SearchResultCallbackHandler to supply the SearchResults to.

search

public void search(java.lang.String base,
                   java.lang.String filter,
                   javax.naming.directory.SearchControls controls,
                   SearchResultCallbackHandler handler)
Search for all objects matching the supplied filter. Each SearchResult is supplied to the specified SearchResultCallbackHandler. Use the specified SearchControls in the search. Note that if you are using a ContextMapper, the returningObjFlag needs to be set to true.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
controls - the SearchControls to use in the search.
handler - the SearchResultCallbackHandler to supply the SearchResults to.

search

public void search(javax.naming.Name base,
                   java.lang.String filter,
                   int searchScope,
                   boolean returningObjFlag,
                   SearchResultCallbackHandler handler)
            throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. Each SearchResult is supplied to the specified SearchResultCallbackHandler. Use the specified search scope and return objects flag in search controls.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
searchScope - the search scope to set in SearchControls.
returningObjFlag - whether the bound object should be returned in search results.
handler - the SearchResultCallbackHandler to supply the SearchResults to.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public void search(java.lang.String base,
                   java.lang.String filter,
                   int searchScope,
                   boolean returningObjFlag,
                   SearchResultCallbackHandler handler)
            throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. Each SearchResult is supplied to the specified SearchResultCallbackHandler. Use the specified search scope and return objects flag in search controls.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
searchScope - the search scope to set in SearchControls.
returningObjFlag - whether the bound object should be returned in search results.
handler - the SearchResultCallbackHandler to supply the SearchResults to.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public void search(javax.naming.Name base,
                   java.lang.String filter,
                   SearchResultCallbackHandler handler)
            throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. Each SearchResult is supplied to the specified SearchResultCallbackHandler. The default Search scope (SearchControls.SUBTREE_SCOPE) will be used and the returnObjects flag will be set to false.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
handler - the SearchResultCallbackHandler to supply the SearchResults to.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public void search(java.lang.String base,
                   java.lang.String filter,
                   SearchResultCallbackHandler handler)
            throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. Each SearchResult is supplied to the specified SearchResultCallbackHandler. The default Search scope (SearchControls.SUBTREE_SCOPE) will be used and no the returnObjects will be set to false.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
handler - the SearchResultCallbackHandler to supply the SearchResults to.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(javax.naming.Name base,
                             java.lang.String filter,
                             int searchScope,
                             AttributesMapper mapper)
                      throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. The Attributes in each SearchResult is supplied to the specified AttributesMapper.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
searchScope - the search scope to set in SearchControls.
mapper - the AttributesMapper to use for translating each entry.
Returns:
a List containing all entries received from the AttributesMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(java.lang.String base,
                             java.lang.String filter,
                             int searchScope,
                             AttributesMapper mapper)
                      throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. The Attributes in each SearchResult is supplied to the specified AttributesMapper.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
searchScope - the search scope to set in SearchControls.
mapper - the AttributesMapper to use for translating each entry.
Returns:
a List containing all entries received from the AttributesMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(javax.naming.Name base,
                             java.lang.String filter,
                             AttributesMapper mapper)
                      throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. The Attributes in each SearchResult is supplied to the specified AttributesMapper. The default seach scope will be used.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
mapper - the AttributesMapper to use for translating each entry.
Returns:
a List containing all entries received from the AttributesMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(java.lang.String base,
                             java.lang.String filter,
                             AttributesMapper mapper)
                      throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. The Attributes in each SearchResult is supplied to the specified AttributesMapper. The default seach scope will be used.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
mapper - the AttributesMapper to use for translating each entry.
Returns:
a List containing all entries received from the AttributesMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(javax.naming.Name base,
                             java.lang.String filter,
                             int searchScope,
                             ContextMapper mapper)
                      throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. The Object returned in each SearchResult is supplied to the specified ContextMapper.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
searchScope - the search scope to set in SearchControls.
mapper - the ContextMapper to use for translating each entry.
Returns:
a List containing all entries received from the ContextMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(java.lang.String base,
                             java.lang.String filter,
                             int searchScope,
                             ContextMapper mapper)
                      throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. The Object returned in each SearchResult is supplied to the specified ContextMapper. The default search scope (SearchControls.SUBTREE_SCOPE) will be used.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
searchScope - the search scope to set in SearchControls.
mapper - the ContextMapper to use for translating each entry.
Returns:
a List containing all entries received from the ContextMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(javax.naming.Name base,
                             java.lang.String filter,
                             ContextMapper mapper)
                      throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. The Object returned in each SearchResult is supplied to the specified ContextMapper. The default search scope (SearchControls.SUBTREE_SCOPE) will be used.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
mapper - the ContextMapper to use for translating each entry.
Returns:
a List containing all entries received from the ContextMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(java.lang.String base,
                             java.lang.String filter,
                             ContextMapper mapper)
                      throws org.springframework.dao.DataAccessException
Search for all objects matching the supplied filter. The Object returned in each SearchResult is supplied to the specified ContextMapper. The default search scope (SearchControls.SUBTREE_SCOPE) will be used.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
mapper - the ContextMapper to use for translating each entry.
Returns:
a List containing all entries received from the ContextMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(java.lang.String base,
                             java.lang.String filter,
                             javax.naming.directory.SearchControls controls,
                             ContextMapper mapper)
Search for all objects matching the supplied filter. The Object returned in each SearchResult is supplied to the specified ContextMapper.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
controls - the SearchControls to use in the search. If the returnObjFlag is not set in the SearchControls, this method will set it automatically, as this is required for the ContextMapper to work.
mapper - the ContextMapper to use for translating each entry.
Returns:
a List containing all entries received from the ContextMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(javax.naming.Name base,
                             java.lang.String filter,
                             javax.naming.directory.SearchControls controls,
                             ContextMapper mapper)
Search for all objects matching the supplied filter. The Object returned in each SearchResult is supplied to the specified ContextMapper.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
controls - the SearchControls to use in the search. If the returnObjFlag is not set in the SearchControls, this method will set it automatically, as this is required for the ContextMapper to work.
mapper - the ContextMapper to use for translating each entry.
Returns:
a List containing all entries received from the ContextMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(java.lang.String base,
                             java.lang.String filter,
                             javax.naming.directory.SearchControls controls,
                             AttributesMapper mapper)
Search for all objects matching the supplied filter. The Object returned in each SearchResult is supplied to the specified AttributesMapper.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
controls - the SearchControls to use in the search.
mapper - the AttributesMapper to use for translating each entry.
Returns:
a List containing all entries received from the ContextMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

search

public java.util.List search(javax.naming.Name base,
                             java.lang.String filter,
                             javax.naming.directory.SearchControls controls,
                             AttributesMapper mapper)
Search for all objects matching the supplied filter. The Object returned in each SearchResult is supplied to the specified AttributesMapper.

Parameters:
base - The base DN where the search should begin.
filter - the filter to use in the search.
controls - the SearchControls to use in the search. If the returnObjFlag is not set in the SearchControls, this method will set it automatically, as this is required for the ContextMapper to work.
mapper - the AttributesMapper to use for translating each entry.
Returns:
a List containing all entries received from the ContextMapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs. Note that a NameNotFoundException will be ignored. Instead this is interpreted that no entries were found.

lookup

public java.lang.Object lookup(javax.naming.Name dn)
                        throws org.springframework.dao.DataAccessException
Lookup the supplied DN and return the found object. WARNING: This method should only be used if a DirObjectFactory has been specified on the ContextFactory. If this is not the case, you will get a new instance of the actual DirContext, which is probably not what you want. If, however this is what you want, be careful to close the context after you finished working with it.

Parameters:
dn - the distinguished name of the object to find.
Returns:
the found object.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

lookup

public java.lang.Object lookup(java.lang.String dn)
                        throws org.springframework.dao.DataAccessException
Lookup the supplied DN and return the found object. WARNING: This method should only be used if a DirObjectFactory has been specified on the ContextFactory. If this is not the case, you will get a new instance of the actual DirContext, which is probably not what you want. If, however this is what you want, be careful to close the context after you finished working with it.

Parameters:
dn - the distinguished name of the object to find.
Returns:
the found object.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

lookup

public java.lang.Object lookup(javax.naming.Name dn,
                               AttributesMapper mapper)
                        throws org.springframework.dao.DataAccessException
Convenience method to get the attributes of a specified DN and automatically pass them to an AttributesMapper.

Parameters:
dn - the distinguished name to find.
mapper - the AttributesMapper to use for mapping the found object.
Returns:
the object returned from the mapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

lookup

public java.lang.Object lookup(java.lang.String dn,
                               AttributesMapper mapper)
                        throws org.springframework.dao.DataAccessException
Convenience method to get the attributes of a specified DN and automatically pass them to an AttributesMapper.

Parameters:
dn - the distinguished name to find.
mapper - the AttributesMapper to use for mapping the found object.
Returns:
the object returned from the mapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

lookup

public java.lang.Object lookup(javax.naming.Name dn,
                               ContextMapper mapper)
                        throws org.springframework.dao.DataAccessException
Convenience method to lookup a specified DN and automatically pass the found objectt to a ContextMapper.

Parameters:
dn - the distinguished name to find.
mapper - the ContextMapper to use for mapping the found object.
Returns:
the object returned from the mapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

lookup

public java.lang.Object lookup(java.lang.String dn,
                               ContextMapper mapper)
                        throws org.springframework.dao.DataAccessException
Convenience method to lookup a specified DN and automatically pass the found objectt to a ContextMapper.

Parameters:
dn - the distinguished name to find.
mapper - the ContextMapper to use for mapping the found object.
Returns:
the object returned from the mapper.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

modifyAttributes

public void modifyAttributes(javax.naming.Name dn,
                             javax.naming.directory.ModificationItem[] mods)
                      throws org.springframework.dao.DataAccessException
Modify the distinguished name dn with the supplied ModificationItems.

Parameters:
dn - The distinguished name of the node to modify.
mods - the modifications to perform.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

modifyAttributes

public void modifyAttributes(java.lang.String dn,
                             javax.naming.directory.ModificationItem[] mods)
                      throws org.springframework.dao.DataAccessException
Modify the distinguished name dn with the supplied ModificationItems.

Parameters:
dn - The distinguished name of the node to modify.
mods - the modifications to perform.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

bind

public void bind(javax.naming.Name dn,
                 java.lang.Object obj,
                 javax.naming.directory.Attributes attributes)
          throws org.springframework.dao.DataAccessException
Bind the supplied object together with the attributes to the specified dn.

Parameters:
dn - the distinguished name to bind the object and attributes to.
obj - the object to bind, may be null.
attributes - the attributes to bind.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

bind

public void bind(java.lang.String dn,
                 java.lang.Object obj,
                 javax.naming.directory.Attributes attributes)
          throws org.springframework.dao.DataAccessException
Bind the supplied object together with the attributes to the specified dn.

Parameters:
dn - the distinguished name to bind the object and attributes to.
obj - the object to bind, may be null.
attributes - the attributes to bind.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

unbind

public void unbind(javax.naming.Name dn)
            throws org.springframework.dao.DataAccessException
Unbind the specified distinguished name.

Parameters:
dn - the distinguished name to unbind.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

unbind

public void unbind(java.lang.String dn)
            throws org.springframework.dao.DataAccessException
Unbind the specified distinguished name.

Parameters:
dn - the distinguished name to unbind.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

unbind

public void unbind(javax.naming.Name dn,
                   boolean recursive)
            throws org.springframework.dao.DataAccessException
Unbind the specified distinguished name.

Parameters:
dn - the distinguished name to unbind.
recursive - whether to unbind all subcontexts as well.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

unbind

public void unbind(java.lang.String dn,
                   boolean recursive)
            throws org.springframework.dao.DataAccessException
Unbind the specified distinguished name.

Parameters:
dn - the distinguished name to unbind.
recursive - whether to unbind all subcontexts as well.
Throws:
org.springframework.dao.DataAccessException - if any error occurs.

rebind

public void rebind(javax.naming.Name dn,
                   java.lang.Object obj,
                   javax.naming.directory.Attributes attributes)
            throws org.springframework.dao.DataAccessException
Rebind the name to the object along with the specified attributes, overwriting any previous values. This method assumes that the specified context already exists.

Parameters:
dn - the distinguished name to rebind.
obj - the object to bind to the DN.
attributes - the attributes to bind.
Throws:
org.springframework.dao.DataAccessException

rebind

public void rebind(java.lang.String dn,
                   java.lang.Object obj,
                   javax.naming.directory.Attributes attributes)
            throws org.springframework.dao.DataAccessException
Rebind the name to the object along with the specified attributes, overwriting any previous values. This method assumes that the specified context already exists.

Parameters:
dn - the distinguished name to rebind.
obj - the object to bind to the DN.
attributes - the attributes to bind.
Throws:
org.springframework.dao.DataAccessException

rename

public void rename(javax.naming.Name oldDn,
                   javax.naming.Name newDn)
            throws org.springframework.dao.DataAccessException
Binds a new name to the object bound to an old name, and unbinds the old name. Both names are relative to this context. Any attributes associated with the old name become associated with the new name. Intermediate contexts of the old name are not changed.

Parameters:
oldDn - the name of the existing binding; may not be empty
newDn - the name of the new binding; may not be empty
Throws:
org.springframework.dao.DataIntegrityViolationException - if newDn is already bound
org.springframework.dao.DataAccessException

rename

public void rename(java.lang.String oldDn,
                   java.lang.String newDn)
            throws org.springframework.dao.DataAccessException
Binds a new name to the object bound to an old name, and unbinds the old name. See rename(Name, Name) for details.

Parameters:
oldDn - the name of the existing binding; may not be empty
newDn - the name of the new binding; may not be empty
Throws:
org.springframework.dao.DataIntegrityViolationException - if newDn is already bound
org.springframework.dao.DataAccessException


Copyright © 2006 Jayway AB. All Rights Reserved.