org.ldaptive.beans.persistence
Class DefaultLdapEntryManager<T>

java.lang.Object
  extended by org.ldaptive.beans.persistence.DefaultLdapEntryManager<T>
Type Parameters:
T - type of object to manage
All Implemented Interfaces:
LdapEntryManager<T>

public class DefaultLdapEntryManager<T>
extends Object
implements LdapEntryManager<T>

Default implementation of an ldap entry manager. Uses an LdapEntryMapper to convert objects to entries, then invokes LDAP operations with those objects.

Version:
$Revision: 3120 $ $Date: 2015-10-01 11:50:02 -0400 (Thu, 01 Oct 2015) $
Author:
Middleware Services

Field Summary
protected  org.slf4j.Logger logger
          Logger for this class.
 
Constructor Summary
DefaultLdapEntryManager(LdapEntryMapper<T> mapper, org.ldaptive.ConnectionFactory factory)
          Creates a new default ldap entry manager.
 
Method Summary
 org.ldaptive.Response<Void> add(T object)
          Adds the supplied annotated object to an LDAP.
 org.ldaptive.Response<Void> delete(T object)
          Deletes the supplied annotated object from an LDAP.
 T find(T object)
          Searches for the supplied annotated object in an LDAP and returns the object mapped with it's ldap attribute properties set.
 org.ldaptive.ConnectionFactory getConnectionFactory()
          Returns the connection factory.
 LdapEntryMapper<T> getLdapEntryMapper()
          Returns the ldap entry mapper.
 org.ldaptive.Response<Void> merge(T object)
          Merges the supplied annotated object in an LDAP.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger for this class.

Constructor Detail

DefaultLdapEntryManager

public DefaultLdapEntryManager(LdapEntryMapper<T> mapper,
                               org.ldaptive.ConnectionFactory factory)
Creates a new default ldap entry manager.

Parameters:
mapper - for object conversion
factory - for LDAP communication
Method Detail

getLdapEntryMapper

public LdapEntryMapper<T> getLdapEntryMapper()
Returns the ldap entry mapper.

Returns:
ldap entry mapper

getConnectionFactory

public org.ldaptive.ConnectionFactory getConnectionFactory()
Returns the connection factory.

Returns:
connection factory

find

public T find(T object)
       throws org.ldaptive.LdapException
Searches for the supplied annotated object in an LDAP and returns the object mapped with it's ldap attribute properties set.

Specified by:
find in interface LdapEntryManager<T>
Parameters:
object - to find
Returns:
mapped object
Throws:
org.ldaptive.LdapException - if the object cannot be found

add

public org.ldaptive.Response<Void> add(T object)
                                throws org.ldaptive.LdapException
Adds the supplied annotated object to an LDAP.

Specified by:
add in interface LdapEntryManager<T>
Parameters:
object - to add
Returns:
LDAP response from the add operation
Throws:
org.ldaptive.LdapException - if the add fails

merge

public org.ldaptive.Response<Void> merge(T object)
                                  throws org.ldaptive.LdapException
Merges the supplied annotated object in an LDAP. See MergeOperation.

Specified by:
merge in interface LdapEntryManager<T>
Parameters:
object - to merge
Returns:
LDAP response from the merge operation
Throws:
org.ldaptive.LdapException - if the merge fails

delete

public org.ldaptive.Response<Void> delete(T object)
                                   throws org.ldaptive.LdapException
Deletes the supplied annotated object from an LDAP.

Specified by:
delete in interface LdapEntryManager<T>
Parameters:
object - to delete
Returns:
LDAP response from the delete operation
Throws:
org.ldaptive.LdapException - if the delete fails


Copyright © 2003-2016 Virginia Tech. All Rights Reserved.