Class CacheResponse<K,V>

java.lang.Object
com.scaleout.client.caching.CacheResponse<K,V>

public abstract class CacheResponse<K,V> extends Object
The CacheResponse provides details regarding the status of a caching request.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract K
    Returns the key for the request or null if no key is used.
    abstract LockToken
    If the caching request successfully completed and performed a locking operation then a lock token will be returned.
    abstract RequestStatus
    Returns the status of a caching request.
    abstract V
    Returns the value for the request or null if no value is available.
    abstract VersionToken
    If the caching request successfully completed a key/value operation and the object has a version then a version token will be returned.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CacheResponse

      public CacheResponse()
      Default constructor.
  • Method Details

    • getStatus

      public abstract RequestStatus getStatus()
      Returns the status of a caching request.
      Returns:
      the status of a caching request.
    • getKey

      public abstract K getKey()
      Returns the key for the request or null if no key is used.
      Returns:
      the key for the request or null if no key is used.
    • getValue

      public abstract V getValue()

      Returns the value for the request or null if no value is available.

      Examples:

      If a read request returns RequestStatus.ObjectNotFound then getValue will return null.

      An add request, regardless of RequestStatus will return the supplied value.

      Returns:
      the value for the request or null if no value
    • getLockToken

      public abstract LockToken getLockToken()

      If the caching request successfully completed and performed a locking operation then a lock token will be returned.

      Note, to check the validity of a lock token, check LockToken.hasValue().

      Returns:
      the lock token for this request
    • getVersionToken

      public abstract VersionToken getVersionToken()

      If the caching request successfully completed a key/value operation and the object has a version then a version token will be returned.

      Note, to check the validity of a version token, execute VersionToken.hasValue().

      Returns:
      the version token for this request