org.ldaptive.ext
Class MergeOperation

java.lang.Object
  extended by org.ldaptive.AbstractOperation<MergeRequest,Void>
      extended by org.ldaptive.ext.MergeOperation
All Implemented Interfaces:
Operation<MergeRequest,Void>

public class MergeOperation
extends AbstractOperation<MergeRequest,Void>

The merge operation performs the LDAP operations necessary to synchronize the data in an LdapEntry with it's corresponding entry in the LDAP. The following logic is executed:

LdapEntry.computeModifications(LdapEntry, LdapEntry) is used to determine the list of attribute modifications that are necessary to perform the merge. Either MergeRequest.getIncludeAttributes() or MergeRequest.getExcludeAttributes() will be used, but not both.

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ldaptive.AbstractOperation
AbstractOperation.ReopenOperationExceptionHandler
 
Field Summary
 
Fields inherited from class org.ldaptive.AbstractOperation
logger
 
Constructor Summary
MergeOperation(Connection conn)
          Creates a new merge operation.
 
Method Summary
protected  Response<Void> add(MergeRequest request, LdapEntry entry)
          Executes an AddOperation for the supplied entry.
protected  Response<Void> delete(MergeRequest request, LdapEntry entry)
          Executes a DeleteOperation for the supplied entry.
protected  Response<Void> invoke(MergeRequest request)
          Executes the ldap operation necessary to perform a merge.
protected  Response<Void> modify(MergeRequest request, LdapEntry source, LdapEntry target)
          Retrieves the attribute modifications from LdapEntry.computeModifications(LdapEntry, LdapEntry) and executes a ModifyOperation with those results.
 
Methods inherited from class org.ldaptive.AbstractOperation
execute, executeHandlers, getConnection, getOperationExceptionHandler, getOperationResponseHandlers, setOperationExceptionHandler, setOperationResponseHandlers, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MergeOperation

public MergeOperation(Connection conn)
Creates a new merge operation.

Parameters:
conn - connection
Method Detail

invoke

protected Response<Void> invoke(MergeRequest request)
                         throws LdapException
Executes the ldap operation necessary to perform a merge. One of AddOperation, ModifyOperation, or DeleteOperation.

Specified by:
invoke in class AbstractOperation<MergeRequest,Void>
Parameters:
request - merge request
Returns:
response associated with whatever underlying operation was performed by the merge or an empty response if no operation was performed
Throws:
LdapException - if the invocation fails

modify

protected Response<Void> modify(MergeRequest request,
                                LdapEntry source,
                                LdapEntry target)
                         throws LdapException
Retrieves the attribute modifications from LdapEntry.computeModifications(LdapEntry, LdapEntry) and executes a ModifyOperation with those results. If no modifications are necessary, no operation is performed.

Parameters:
request - merge request
source - ldap entry to merge into the LDAP
target - ldap entry that exists in the LDAP
Returns:
response of the modify operation or an empty response if no operation is performed
Throws:
LdapException - if an error occurs executing the modify operation

add

protected Response<Void> add(MergeRequest request,
                             LdapEntry entry)
                      throws LdapException
Executes an AddOperation for the supplied entry.

Parameters:
request - merge request
entry - to add to the LDAP
Returns:
response of the add operation
Throws:
LdapException - if an error occurs executing the add operation

delete

protected Response<Void> delete(MergeRequest request,
                                LdapEntry entry)
                         throws LdapException
Executes a DeleteOperation for the supplied entry.

Parameters:
request - merge request
entry - to delete from the LDAP
Returns:
response of the delete operation
Throws:
LdapException - if an error occurs executing the deleting operation


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