Class CreatedEventImpl<K>

java.lang.Object
org.infinispan.hotrod.event.impl.AbstractClientEvent
org.infinispan.hotrod.event.impl.CreatedEventImpl<K>
All Implemented Interfaces:
ClientCacheEntryCreatedEvent<K>, ClientEvent

public class CreatedEventImpl<K> extends AbstractClientEvent implements ClientCacheEntryCreatedEvent<K>
  • Constructor Details

    • CreatedEventImpl

      public CreatedEventImpl(byte[] listenerId, K key, long version, boolean retried)
  • Method Details

    • getKey

      public K getKey()
      Description copied from interface: ClientCacheEntryCreatedEvent
      Created cache entry's key.
      Specified by:
      getKey in interface ClientCacheEntryCreatedEvent<K>
      Returns:
      an instance of the key with which a cache entry has been created in the remote server(s).
    • getVersion

      public long getVersion()
      Description copied from interface: ClientCacheEntryCreatedEvent
      Provides access to the version of the created cache entry. This version can be used to invoke conditional operations on the server, such as
      invalid reference
      RemoteCache#replaceWithVersion(Object, Object, long)
      or
      invalid reference
      RemoteCache#removeWithVersion(Object, long)
      Specified by:
      getVersion in interface ClientCacheEntryCreatedEvent<K>
      Returns:
      a long containing the version of the created cache entry.
    • isCommandRetried

      public boolean isCommandRetried()
      Description copied from interface: ClientCacheEntryCreatedEvent
      This will be true if the write command that caused this had to be retried again due to a topology change. This could be a sign that this event has been duplicated or another event was dropped and replaced (eg: ModifiedEvent replaced CreateEvent)
      Specified by:
      isCommandRetried in interface ClientCacheEntryCreatedEvent<K>
      Returns:
      Whether the command that caused this event was retried
    • getType

      public ClientEvent.Type getType()
      Specified by:
      getType in interface ClientEvent
    • toString

      public String toString()
      Overrides:
      toString in class Object