Class RedisKeyExpiredEvent<T>

All Implemented Interfaces:
Serializable

public class RedisKeyExpiredEvent<T> extends RedisKeyspaceEvent
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:
  • Constructor Details

    • RedisKeyExpiredEvent

      public RedisKeyExpiredEvent(byte[] key)
      Parameters:
      key - the expired key.
    • RedisKeyExpiredEvent

      public RedisKeyExpiredEvent(byte[] key, @Nullable Object value)
      Parameters:
      key - the expired key.
      value - the value of the expired key. Can be null.
    • RedisKeyExpiredEvent

      public RedisKeyExpiredEvent(@Nullable String channel, byte[] key, @Nullable Object value)
      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

      public String 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

      @Nullable public Object getValue()
      Get the expired Object
      Returns:
      null if not present.
    • toString

      public String toString()
      Overrides:
      toString in class EventObject