Class BinaryMetadataSyncListener

java.lang.Object
org.nuxeo.binary.metadata.internals.listeners.BinaryMetadataSyncListener
All Implemented Interfaces:
javax.transaction.Synchronization, EventListener

public class BinaryMetadataSyncListener extends Object implements EventListener, javax.transaction.Synchronization
Handle document and blob updates according to following rules in an event context:
  • Define if rule should be executed in async or sync mode.
  • If creation, write metadata from Blob to doc.
  • If Blob dirty and document metadata dirty, write metadata from doc to Blob.
  • If Blob dirty and document metadata not dirty, write metadata from Blob to doc.
  • If Blob not dirty and document metadata dirty, write metadata from doc to Blob.
Since:
7.1
  • Field Details

  • Constructor Details

    • BinaryMetadataSyncListener

      public BinaryMetadataSyncListener()
  • Method Details

    • handleEvent

      public void handleEvent(Event event)
      Description copied from interface: EventListener
      Handle the given event. The listener can cancel the event by calling Event.cancel()
      Specified by:
      handleEvent in interface EventListener
      Parameters:
      event - the event
    • beforeCompletion

      public void beforeCompletion()
      Specified by:
      beforeCompletion in interface javax.transaction.Synchronization
    • afterCompletion

      public void afterCompletion(int status)
      Specified by:
      afterCompletion in interface javax.transaction.Synchronization
    • registerSynchronization

      protected boolean registerSynchronization(javax.transaction.Synchronization sync)