Class KeyValueEvent<T>
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.data.keyvalue.core.event.KeyValueEvent<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
KeyValueEvent.AfterDeleteEvent
,KeyValueEvent.AfterDropKeySpaceEvent
,KeyValueEvent.AfterGetEvent
,KeyValueEvent.AfterInsertEvent
,KeyValueEvent.AfterUpdateEvent
,KeyValueEvent.BeforeDeleteEvent
,KeyValueEvent.BeforeDropKeySpaceEvent
,KeyValueEvent.BeforeGetEvent
,KeyValueEvent.BeforeInsertEvent
,KeyValueEvent.BeforeUpdateEvent
KeyValueEvent
gets published for operations executed by eg.
KeyValueTemplate
.
Use the KeyValueEvent.KeyBasedEvent.getType()
to determine which event has been emitted.- Author:
- Christoph Strobl, Thomas Darimont, Mark Paluch
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
KeyValueEvent
after removing an object by with a given key.static class
KeyValueEvent
after removing all elements in a given keyspace.static class
KeyValueEvent
after loading an object by its key.static class
KeyValueEvent
after inserting an object by with a given key.static class
KeyValueEvent
after updating an object by with a given key.static class
KeyValueEvent
before removing an object by with a given key.static class
KeyValueEvent
before removing all elements in a given keyspace.static class
KeyValueEvent
raised before loading an object by its key.static class
KeyValueEvent
before inserting an object by with a given key.static class
KeyValueEvent
before updating an object by with a given key. -
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> KeyValueEvent.AfterDeleteEvent<T>
afterDelete
(Object id, String keyspace, Class<? extends T> type, T value) Create newKeyValueEvent.AfterDeleteEvent
.static <T> KeyValueEvent.AfterDropKeySpaceEvent<T>
afterDropKeySpace
(String keyspace, Class<? extends T> type) Create newKeyValueEvent.AfterDropKeySpaceEvent
.static <T> KeyValueEvent.AfterGetEvent<T>
Create newKeyValueEvent.AfterGetEvent
.static <T> KeyValueEvent.AfterInsertEvent<T>
afterInsert
(Object id, String keyspace, Class<? extends T> type, T value) Create newKeyValueEvent.AfterInsertEvent
.static <T> KeyValueEvent.AfterUpdateEvent<T>
afterUpdate
(Object id, String keyspace, Class<? extends T> type, T actualValue, Object previousValue) Create newKeyValueEvent.AfterUpdateEvent
.static <T> KeyValueEvent.BeforeDeleteEvent<T>
beforeDelete
(Object id, String keyspace, Class<? extends T> type) Create newKeyValueEvent.BeforeDeleteEvent
.static <T> KeyValueEvent.BeforeDropKeySpaceEvent<T>
beforeDropKeySpace
(String keyspace, Class<? extends T> type) Create newKeyValueEvent.BeforeDropKeySpaceEvent
.static <T> KeyValueEvent.BeforeGetEvent<T>
Create newKeyValueEvent.BeforeGetEvent
.static <T> KeyValueEvent.BeforeInsertEvent<T>
beforeInsert
(Object id, String keyspace, Class<? extends T> type, T value) Create newKeyValueEvent.BeforeInsertEvent
.static <T> KeyValueEvent.BeforeUpdateEvent<T>
beforeUpdate
(Object id, String keyspace, Class<? extends T> type, T value) Create newKeyValueEvent.BeforeUpdateEvent
.toString()
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource
-
Constructor Details
-
KeyValueEvent
-
-
Method Details
-
getKeyspace
- Returns:
- affected keyspace. Never null.
-
toString
- Overrides:
toString
in classEventObject
-
beforeGet
public static <T> KeyValueEvent.BeforeGetEvent<T> beforeGet(Object id, String keyspace, Class<T> type) Create newKeyValueEvent.BeforeGetEvent
.- Parameters:
id
-keyspace
-type
-- Returns:
-
afterGet
public static <T> KeyValueEvent.AfterGetEvent<T> afterGet(Object id, String keyspace, Class<T> type, @Nullable T value) Create newKeyValueEvent.AfterGetEvent
.- Parameters:
id
-keyspace
-type
-value
-- Returns:
-
beforeInsert
public static <T> KeyValueEvent.BeforeInsertEvent<T> beforeInsert(Object id, String keyspace, Class<? extends T> type, T value) Create newKeyValueEvent.BeforeInsertEvent
.- Parameters:
id
-keyspace
-type
-value
-- Returns:
-
afterInsert
public static <T> KeyValueEvent.AfterInsertEvent<T> afterInsert(Object id, String keyspace, Class<? extends T> type, T value) Create newKeyValueEvent.AfterInsertEvent
.- Parameters:
id
-keyspace
-type
-value
-- Returns:
-
beforeUpdate
public static <T> KeyValueEvent.BeforeUpdateEvent<T> beforeUpdate(Object id, String keyspace, Class<? extends T> type, T value) Create newKeyValueEvent.BeforeUpdateEvent
.- Parameters:
id
-keyspace
-type
-value
-- Returns:
-
afterUpdate
public static <T> KeyValueEvent.AfterUpdateEvent<T> afterUpdate(Object id, String keyspace, Class<? extends T> type, T actualValue, @Nullable Object previousValue) Create newKeyValueEvent.AfterUpdateEvent
.- Parameters:
id
-keyspace
-type
-actualValue
-previousValue
-- Returns:
-
beforeDropKeySpace
public static <T> KeyValueEvent.BeforeDropKeySpaceEvent<T> beforeDropKeySpace(String keyspace, Class<? extends T> type) Create newKeyValueEvent.BeforeDropKeySpaceEvent
.- Parameters:
keyspace
-type
-- Returns:
-
afterDropKeySpace
public static <T> KeyValueEvent.AfterDropKeySpaceEvent<T> afterDropKeySpace(String keyspace, Class<? extends T> type) Create newKeyValueEvent.AfterDropKeySpaceEvent
.- Parameters:
keyspace
-type
-- Returns:
-
beforeDelete
public static <T> KeyValueEvent.BeforeDeleteEvent<T> beforeDelete(Object id, String keyspace, Class<? extends T> type) Create newKeyValueEvent.BeforeDeleteEvent
.- Parameters:
id
-keyspace
-type
-- Returns:
-
afterDelete
public static <T> KeyValueEvent.AfterDeleteEvent<T> afterDelete(Object id, String keyspace, Class<? extends T> type, @Nullable T value) Create newKeyValueEvent.AfterDeleteEvent
.- Parameters:
id
-keyspace
-type
-value
-- Returns:
-