org.hibernate.search.event.impl

## Class FullTextIndexEventListener

- java.lang.Object
- - org.hibernate.search.event.impl.FullTextIndexEventListener

- All Implemented Interfaces:
    Serializable, FlushEventListener, PostCollectionRecreateEventListener, PostCollectionRemoveEventListener, PostCollectionUpdateEventListener, PostDeleteEventListener, PostInsertEventListener, PostUpdateEventListener

      public final class FullTextIndexEventListener
      extends Object
      implements PostDeleteEventListener, PostInsertEventListener, PostUpdateEventListener, PostCollectionRecreateEventListener, PostCollectionRemoveEventListener, PostCollectionUpdateEventListener, FlushEventListener

  Hibernate ORM event listener called by various ORM life cycle events. This listener must be registered in order to enable automatic index updates.
  Author:
    Gavin King, Emmanuel Bernard, Mattias Arbin, Sanne Grinovero, Hardy Ferentschik
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FullTextIndexEventListener()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSynchronization(EventSource eventSource, Synchronization synchronization)` Adds a synchronization to be performed in the onFlush method; should only be used as workaround for the case a flush is happening out of transaction.
    `static boolean` | `eventsDisabled(ExtendedSearchIntegrator extendedIntegrator)`
    `String[]` | `getDirtyPropertyNames(PostUpdateEvent event)`
    `protected AbstractDocumentBuilder` | `getDocumentBuilder(Object instance)` It is not suggested to extend FullTextIndexEventListener, but when needed to implement special use cases implementors might need this method.
    `ExtendedSearchIntegrator` | `getExtendedSearchFactoryIntegrator()`
    `void` | `initialize(CompletableFuture<ExtendedSearchIntegrator> extendedIntegratorFuture)` Initialize method called by Hibernate Core when the SessionFactory starts.
    `void` | `onFlush(FlushEvent event)` Make sure the indexes are updated right after the hibernate flush, avoiding object loading during a flush.
    `void` | `onPostDelete(PostDeleteEvent event)`
    `void` | `onPostInsert(PostInsertEvent event)`
    `void` | `onPostRecreateCollection(PostCollectionRecreateEvent event)`
    `void` | `onPostRemoveCollection(PostCollectionRemoveEvent event)`
    `void` | `onPostUpdate(PostUpdateEvent event)`
    `void` | `onPostUpdateCollection(PostCollectionUpdateEvent event)`
    `protected void` | `processCollectionEvent(AbstractCollectionEvent event)`
    `protected void` | `processWork(String tenantIdentifier, Object entity, Serializable id, WorkType workType, AbstractEvent event, boolean identifierRollbackEnabled)`
    `boolean` | `requiresPostCommitHanding(EntityPersister persister)` Required since Hibernate ORM 4.3
    `default boolean` | `requiresPostCommitHandling(EntityPersister arg0)`
    `static boolean` | `skipDirtyChecks(ExtendedSearchIntegrator extendedIntegrator)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FullTextIndexEventListener

          public FullTextIndexEventListener()

  - ### Method Detail

    - #### onPostDelete

          public void onPostDelete(PostDeleteEvent event)

      Specified by:
        `onPostDelete` in interface `PostDeleteEventListener`

    - #### onPostInsert

          public void onPostInsert(PostInsertEvent event)

      Specified by:
        `onPostInsert` in interface `PostInsertEventListener`

    - #### onPostUpdate

          public void onPostUpdate(PostUpdateEvent event)

      Specified by:
        `onPostUpdate` in interface `PostUpdateEventListener`

    - #### onPostRecreateCollection

          public void onPostRecreateCollection(PostCollectionRecreateEvent event)

      Specified by:
        `onPostRecreateCollection` in interface `PostCollectionRecreateEventListener`

    - #### onPostRemoveCollection

          public void onPostRemoveCollection(PostCollectionRemoveEvent event)

      Specified by:
        `onPostRemoveCollection` in interface `PostCollectionRemoveEventListener`

    - #### onPostUpdateCollection

          public void onPostUpdateCollection(PostCollectionUpdateEvent event)

      Specified by:
        `onPostUpdateCollection` in interface `PostCollectionUpdateEventListener`

    - #### onFlush

          public void onFlush(FlushEvent event)

      Make sure the indexes are updated right after the hibernate flush, avoiding object loading during a flush. Not needed during transactions.
      Specified by:
        `onFlush` in interface `FlushEventListener`

    - #### getExtendedSearchFactoryIntegrator

          public ExtendedSearchIntegrator getExtendedSearchFactoryIntegrator()

    - #### getDirtyPropertyNames

          public String[] getDirtyPropertyNames(PostUpdateEvent event)

    - #### initialize

          public void initialize(CompletableFuture<ExtendedSearchIntegrator> extendedIntegratorFuture)

      Initialize method called by Hibernate Core when the SessionFactory starts.
      Parameters:
        `extendedIntegratorFuture` - a completable future that will eventually hold the `ExtendedSearchIntegrator`

    - #### addSynchronization

          public void addSynchronization(EventSource eventSource,
                                         Synchronization synchronization)

      Adds a synchronization to be performed in the onFlush method; should only be used as workaround for the case a flush is happening out of transaction. Warning: if the synchronization contains a hard reference to the Session proper cleanup is not guaranteed and memory leaks will happen.
      Parameters:
        `eventSource` - should be the Session doing the flush
        `synchronization` - the synchronisation instance

    - #### processWork

          protected void processWork(String tenantIdentifier,
                                     Object entity,
                                     Serializable id,
                                     WorkType workType,
                                     AbstractEvent event,
                                     boolean identifierRollbackEnabled)

    - #### processCollectionEvent

          protected void processCollectionEvent(AbstractCollectionEvent event)

    - #### getDocumentBuilder

          protected AbstractDocumentBuilder getDocumentBuilder(Object instance)

      It is not suggested to extend FullTextIndexEventListener, but when needed to implement special use cases implementors might need this method. If you have to extent this, please report your use case so that better long term solutions can be discussed.
      Parameters:
        `instance` - the object instance for which to retrieve the document builder
      Returns:
        the `DocumentBuilder` for the specified object

    - #### requiresPostCommitHanding

          public boolean requiresPostCommitHanding(EntityPersister persister)

      Required since Hibernate ORM 4.3

    - #### skipDirtyChecks

          public static boolean skipDirtyChecks(ExtendedSearchIntegrator extendedIntegrator)

    - #### eventsDisabled

          public static boolean eventsDisabled(ExtendedSearchIntegrator extendedIntegrator)

    - #### requiresPostCommitHandling

          public boolean requiresPostCommitHandling(EntityPersister arg0)

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved