use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheObjectUtil method incrementByValue.
public static long incrementByValue(CacheConfigBean cacheConfigBean, String cacheKey, long value) {
UnitResponse unitResponseObject = SyncXian.call(CacheService.CACHE_SERVICE, "cacheIncrement", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
put("value", value);
}
});
unitResponseObject.throwExceptionIfNotSuccess();
return (long) unitResponseObject.getData();
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheObjectUtil method decrement.
public static long decrement(CacheConfigBean cacheConfigBean, String cacheKey) {
UnitResponse response = SyncXian.call(CacheService.CACHE_SERVICE, "cacheDecrement", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
}
});
response.throwExceptionIfNotSuccess();
return (long) response.getData();
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheObjectUtil method incrementByValue.
public static long incrementByValue(CacheConfigBean cacheConfigBean, String cacheKey, long value, int timeoutInSecond) {
UnitResponse response = SyncXian.call(CacheService.CACHE_SERVICE, "cacheIncrement", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
put("value", value);
put("timeout", timeoutInSecond);
}
});
response.throwExceptionIfNotSuccess();
return (long) response.getData();
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheObjectUtil method decrementByValue.
public static long decrementByValue(CacheConfigBean cacheConfigBean, String cacheKey, long value) {
UnitResponse unitResponseObject = SyncXian.call(CacheService.CACHE_SERVICE, "cacheDecrement", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
put("value", value);
}
});
unitResponseObject.throwExceptionIfNotSuccess();
return (long) unitResponseObject.getData();
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheObjectUtil method ttl.
public static long ttl(CacheConfigBean cacheConfigBean, String cacheKey) {
UnitResponse unitResponseObject = SyncXian.call(CacheService.CACHE_SERVICE, "cacheTtl", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
}
});
unitResponseObject.throwExceptionIfNotSuccess();
return (long) unitResponseObject.getData();
}
Aggregations