public interface Command<R,T>
| Modifier and Type | Method and Description |
|---|---|
default String |
cacheKey(R request)
Get cache key, if
null this command result will not be cached |
default Collection<String> |
evictKeys(R request)
Get evict keys, if
null this command will not trigger evict in cache |
rx.Single<T> |
execute(R request)
Command logic implementation
|
default rx.Single<T> |
fallback(Throwable throwable,
R request)
If
execute(Object) produce error,
this method will executed as fallback method |
default String |
group()
Get group name
|
default String |
key()
Get command key
|
default Class<T> |
responseClass()
Get return class for cache serialization
|
default boolean |
validateRequest()
Is request need to be validated before execute command
|
rx.Single<T> execute(R request)
request - command requestdefault rx.Single<T> fallback(Throwable throwable, R request)
execute(Object) produce error,
this method will executed as fallback methodthrowable - error from execute(Object)request - command requestdefault String key()
default String group()
default String cacheKey(R request)
null this command result will not be cachedrequest - command requestdefault Collection<String> evictKeys(R request)
null this command will not trigger evict in cacherequest - command requestdefault Class<T> responseClass()
default boolean validateRequest()
Copyright © 2021 Pivotal Software, Inc.. All rights reserved.