Class MergeOperation

    • Field Detail

      • logger

        private final Logger logger
        Logger for this class.
      • searchOperation

        private SearchOperation searchOperation
        Search operation used to find the entry.
      • addOperation

        private AddOperation addOperation
        Add operation used to add a new entry.
      • modifyOperation

        private ModifyOperation modifyOperation
        Modify operation used to update an entry.
      • deleteOperation

        private DeleteOperation deleteOperation
        Delete operation used to remove an entry.
      • throwCondition

        private ResultPredicate throwCondition
        Function to test results.
    • Constructor Detail

      • MergeOperation

        public MergeOperation()
        Default constructor.
      • MergeOperation

        public MergeOperation​(ConnectionFactory factory)
        Creates a new merge operation.
        Parameters:
        factory - connection factory
    • Method Detail

      • setConnectionFactory

        public void setConnectionFactory​(ConnectionFactory factory)
      • setSearchOperation

        public void setSearchOperation​(SearchOperation operation)
      • setAddOperation

        public void setAddOperation​(AddOperation operation)
      • setModifyOperation

        public void setModifyOperation​(ModifyOperation operation)
      • setDeleteOperation

        public void setDeleteOperation​(DeleteOperation operation)
      • setThrowCondition

        public void setThrowCondition​(ResultPredicate function)
      • modify

        protected Result 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 a null response if no operation is performed. If batching is enabled in the request, returns the response of the last operation performed
        Throws:
        LdapException - if an error occurs executing the modify operation
      • copy

        public static MergeOperation copy​(MergeOperation operation)
        Returns a new merge operation with the same properties as the supplied operation.
        Parameters:
        operation - to copy
        Returns:
        copy of the supplied merge operation
      • copy

        public static MergeOperation copy​(MergeOperation operation,
                                          boolean deep)
        Returns a new merge operation with the same properties as the supplied operation.
        Parameters:
        operation - to copy
        deep - whether to make a deep copy
        Returns:
        copy of the supplied merge operation