Package com.scaleout.client.caching
Class CacheResponse<K,V>
java.lang.Object
com.scaleout.client.caching.CacheResponse<K,V>
The
CacheResponse
provides details regarding the status of a caching request.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract K
getKey()
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
getValue()
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.
-
Constructor Details
-
CacheResponse
public CacheResponse()Default constructor.
-
-
Method Details
-
getStatus
Returns the status of a caching request.- Returns:
- the status of a caching request.
-
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
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
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
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
-