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
RepositoryEvent
s and dispatches them to a specific method based on
the event type.- Author:
- Jon Brisbin, Oliver Gierke
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
onAfterCreate
(T entity) Override this method if you are interested in afterCreate events.protected void
onAfterDelete
(T entity) Override this method if you are interested in afterDelete events.protected void
onAfterLinkDelete
(T parent, Object linked) Override this method if you are interested in afterLinkDelete events.protected void
onAfterLinkSave
(T parent, Object linked) Override this method if you are interested in afterLinkSave events.protected void
onAfterSave
(T entity) Override this method if you are interested in afterSave events.final void
protected void
onBeforeCreate
(T entity) Override this method if you are interested in beforeCreate events.protected void
onBeforeDelete
(T entity) Override this method if you are interested in beforeDelete events.protected void
onBeforeLinkDelete
(T parent, Object linked) Override this method if you are interested in beforeLinkDelete events.protected void
onBeforeLinkSave
(T parent, Object linked) Override this method if you are interested in beforeLinkSave events.protected void
onBeforeSave
(T entity) Override this method if you are interested in beforeSave events.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
AbstractRepositoryEventListener
public AbstractRepositoryEventListener()
-
-
Method Details
-
onApplicationEvent
- Specified by:
onApplicationEvent
in interfaceApplicationListener<T>
-
onBeforeCreate
Override this method if you are interested in beforeCreate events.- Parameters:
entity
- The entity being created.
-
onAfterCreate
Override this method if you are interested in afterCreate events.- Parameters:
entity
- The entity that was created.
-
onBeforeSave
Override this method if you are interested in beforeSave events.- Parameters:
entity
- The entity being saved.
-
onAfterSave
Override this method if you are interested in afterSave events.- Parameters:
entity
- The entity that was just saved.
-
onBeforeLinkSave
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
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
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
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
Override this method if you are interested in beforeDelete events.- Parameters:
entity
- The entity that is being deleted.
-
onAfterDelete
Override this method if you are interested in afterDelete events.- Parameters:
entity
- The entity that was just deleted.
-