Class AbstractRepositoryEventListener<T>

java.lang.Object
org.springframework.data.rest.core.event.AbstractRepositoryEventListener<T>
All Implemented Interfaces:
EventListener, ApplicationListener<RepositoryEvent>
Direct Known Subclasses:
ValidatingRepositoryEventListener

public abstract class AbstractRepositoryEventListener<T> extends Object implements ApplicationListener<RepositoryEvent>
Abstract class that listens for generic RepositoryEvents and dispatches them to a specific method based on the event type.
Author:
Jon Brisbin, Oliver Gierke
  • Constructor Details

    • AbstractRepositoryEventListener

      public AbstractRepositoryEventListener()
  • Method Details

    • onApplicationEvent

      public final void onApplicationEvent(RepositoryEvent event)
      Specified by:
      onApplicationEvent in interface ApplicationListener<T>
    • onBeforeCreate

      protected void onBeforeCreate(T entity)
      Override this method if you are interested in beforeCreate events.
      Parameters:
      entity - The entity being created.
    • onAfterCreate

      protected void onAfterCreate(T entity)
      Override this method if you are interested in afterCreate events.
      Parameters:
      entity - The entity that was created.
    • onBeforeSave

      protected void onBeforeSave(T entity)
      Override this method if you are interested in beforeSave events.
      Parameters:
      entity - The entity being saved.
    • onAfterSave

      protected void onAfterSave(T entity)
      Override this method if you are interested in afterSave events.
      Parameters:
      entity - The entity that was just saved.
    • onBeforeLinkSave

      protected void onBeforeLinkSave(T parent, Object linked)
      Override this method if you are interested in beforeLinkSave events.
      Parameters:
      parent - The parent entity to which the child object is linked.
      linked - The linked, child entity.
    • onAfterLinkSave

      protected void onAfterLinkSave(T parent, Object linked)
      Override this method if you are interested in afterLinkSave events.
      Parameters:
      parent - The parent entity to which the child object is linked.
      linked - The linked, child entity.
    • onBeforeLinkDelete

      protected void onBeforeLinkDelete(T parent, Object linked)
      Override this method if you are interested in beforeLinkDelete events.
      Parameters:
      parent - The parent entity to which the child object is linked.
      linked - The linked, child entity.
    • onAfterLinkDelete

      protected void onAfterLinkDelete(T parent, Object linked)
      Override this method if you are interested in afterLinkDelete events.
      Parameters:
      parent - The parent entity to which the child object is linked.
      linked - The linked, child entity.
    • onBeforeDelete

      protected void onBeforeDelete(T entity)
      Override this method if you are interested in beforeDelete events.
      Parameters:
      entity - The entity that is being deleted.
    • onAfterDelete

      protected void onAfterDelete(T entity)
      Override this method if you are interested in afterDelete events.
      Parameters:
      entity - The entity that was just deleted.