Interface RejectedChangeRecordListener


  • public interface RejectedChangeRecordListener
    A listener interface which is notified whenever a change record cannot be applied to an entry. This may occur when an attempt is made to update a non-existent entry, or add an entry which already exists.

    By default the FAIL_FAST listener is used.

    • Field Detail

      • FAIL_FAST

        static final RejectedChangeRecordListener FAIL_FAST
        A handler which terminates processing by throwing a DecodeException as soon as a change is rejected.
      • OVERWRITE

        static final RejectedChangeRecordListener OVERWRITE
        The default handler which ignores changes applied to missing entries and tolerates duplicate entries by overwriting the existing entry with the new entry.
    • Method Detail

      • handleDuplicateEntry

        Entry handleDuplicateEntry​(AddRequest change,
                                   Entry existingEntry)
                            throws DecodeException
        Invoked when an attempt was made to add an entry which already exists.
        Parameters:
        change - The conflicting add request.
        existingEntry - The pre-existing entry.
        Returns:
        The entry which should be kept.
        Throws:
        DecodeException - If processing should terminate.
      • handleDuplicateEntry

        Entry handleDuplicateEntry​(ModifyDnRequest change,
                                   Entry existingEntry,
                                   Entry renamedEntry)
                            throws DecodeException
        Invoked when an attempt was made to rename an entry which already exists.
        Parameters:
        change - The conflicting add request.
        existingEntry - The pre-existing entry.
        renamedEntry - The renamed entry.
        Returns:
        The entry which should be kept.
        Throws:
        DecodeException - If processing should terminate.
      • handleRejectedChangeRecord

        void handleRejectedChangeRecord​(AddRequest change,
                                        LocalizableMessage reason)
                                 throws DecodeException
        Invoked when an attempt to add an entry was rejected. This may be because the target parent entry was not found, or controls provided with the request are not supported. This method will not be called when the entry to be added already exists, since this is handled by handleDuplicateEntry(AddRequest, Entry).
        Parameters:
        change - The rejected add request.
        reason - The reason why the record was rejected.
        Throws:
        DecodeException - If processing should terminate.
      • handleRejectedChangeRecord

        void handleRejectedChangeRecord​(DeleteRequest change,
                                        LocalizableMessage reason)
                                 throws DecodeException
        Invoked when an attempt to delete an entry was rejected. This may be because the target entry was not found, or controls provided with the request are not supported.
        Parameters:
        change - The rejected delete request.
        reason - The reason why the record was rejected.
        Throws:
        DecodeException - If processing should terminate.
      • handleRejectedChangeRecord

        void handleRejectedChangeRecord​(ModifyRequest change,
                                        LocalizableMessage reason)
                                 throws DecodeException
        Invoked when an attempt to modify an entry was rejected. This may be because the target entry was not found, or controls provided with the request are not supported.
        Parameters:
        change - The rejected modify request.
        reason - The reason why the record was rejected.
        Throws:
        DecodeException - If processing should terminate.
      • handleRejectedChangeRecord

        void handleRejectedChangeRecord​(ModifyDnRequest change,
                                        LocalizableMessage reason)
                                 throws DecodeException
        Invoked when an attempt to rename an entry was rejected. This may be because the target entry was not found, or controls provided with the request are not supported. This method will not be called when a renamed entry already exists, since this is handled by handleDuplicateEntry(ModifyDnRequest, Entry, Entry).
        Parameters:
        change - The rejected modify DN request.
        reason - The reason why the record was rejected.
        Throws:
        DecodeException - If processing should terminate.