Class RedisKeyExpiredEvent<T>
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.data.redis.core.RedisKeyspaceEvent
org.springframework.data.redis.core.RedisKeyExpiredEvent<T>
- All Implemented Interfaces:
Serializable
RedisKeyExpiredEvent
is a Redis specific ApplicationEvent
published when a particular key in Redis
expires. It can hold the value of the expired key next to the key, but is not required to do so.- Since:
- 1.7
- Author:
- Christoph Strobl, Mark Paluch
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionRedisKeyExpiredEvent
(byte[] key) Creates newRedisKeyExpiredEvent
.RedisKeyExpiredEvent
(byte[] key, Object value) Creates newRedisKeyExpiredEvent
RedisKeyExpiredEvent
(String channel, byte[] key, Object value) Creates newRedisKeyExpiredEvent
-
Method Summary
Methods inherited from class org.springframework.data.redis.core.RedisKeyspaceEvent
getChannel, getSource
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
-
Constructor Details
-
RedisKeyExpiredEvent
public RedisKeyExpiredEvent(byte[] key) Creates newRedisKeyExpiredEvent
.- Parameters:
key
- the expired key.
-
RedisKeyExpiredEvent
Creates newRedisKeyExpiredEvent
- Parameters:
key
- the expired key.value
- the value of the expired key. Can be null.
-
RedisKeyExpiredEvent
Creates newRedisKeyExpiredEvent
- Parameters:
channel
- the Pub/Sub channel through which this event was received.key
- the expired key.value
- the value of the expired key. Can be null.- Since:
- 1.8
-
-
Method Details
-
getKeyspace
Gets the keyspace in which the expiration occured.- Returns:
- null if it could not be determined.
-
getId
public byte[] getId()Get the expired objects id.- Returns:
- the expired objects id.
-
getValue
Get the expired Object- Returns:
- null if not present.
-
toString
- Overrides:
toString
in classEventObject
-