use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheObjectUtil method keys.
public static Set<String> keys(CacheConfigBean cacheConfigBean, String pattern) {
UnitResponse response = SyncXian.call(CacheService.CACHE_SERVICE, "cacheKeys", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("pattern", pattern);
}
});
response.throwExceptionIfNotSuccess();
return response.getData();
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheObjectUtil method exists.
public static boolean exists(CacheConfigBean cacheConfigBean, String cacheKey) {
UnitResponse unitResponseObject = SyncXian.call(CacheService.CACHE_SERVICE, "cacheExists", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
}
});
unitResponseObject.throwExceptionIfNotSuccess();
return (boolean) unitResponseObject.getData();
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheObjectUtil method remove.
public static boolean remove(CacheConfigBean cacheConfigBean, String cacheKey) {
UnitResponse unitResponseObject = SyncXian.call(CacheService.CACHE_SERVICE, "cacheObjectRemove", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
}
});
unitResponseObject.throwExceptionIfNotSuccess();
return unitResponseObject.succeeded();
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheObjectUtil method set.
public static boolean set(CacheConfigBean cacheConfigBean, String cacheKey, Object value, int timeoutInSecond) {
UnitResponse response = SyncXian.call(CacheService.CACHE_SERVICE, "cacheObject", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", cacheKey);
put("value", value);
put("timeout", timeoutInSecond);
}
});
response.throwExceptionIfNotSuccess();
return response.succeeded();
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheObjectUtil method scan.
/**
* @param cacheConfigBean cacheConfigBean
* @param pattern pattern
* @param count count
* @param cursor cursor
* @return ScanVo
* @deprecated 不建议使用该 API, 各种不稳定
*/
public static ScanVo scan(CacheConfigBean cacheConfigBean, String pattern, int count, String cursor) {
UnitResponse unitResponseObject = SyncXian.call(CacheService.CACHE_SERVICE, "cacheScan", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("pattern", pattern);
put("count", count);
put("cursor", cursor);
}
});
unitResponseObject.throwExceptionIfNotSuccess();
JSONObject jsonObject = unitResponseObject.getData();
return new ScanVo(jsonObject);
}
Aggregations