use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheMapUtil method get.
public static <T> T get(CacheConfigBean cacheConfigBean, String key, String field, Class<T> clazz) {
UnitResponse unitResponseObject = SyncXian.call(CacheService.CACHE_SERVICE, "cacheMapGet", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", key);
put("field", field);
}
});
unitResponseObject.throwExceptionIfNotSuccess();
return Reflection.toType(unitResponseObject.getData(), clazz);
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheMapUtil method remove.
public static boolean remove(CacheConfigBean cacheConfigBean, String key, String field) {
UnitResponse unitResponseObject = SyncXian.call(CacheService.CACHE_SERVICE, "cacheMapRemove", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", key);
put("field", field);
}
});
unitResponseObject.throwExceptionIfNotSuccess();
long result = (long) unitResponseObject.getData();
if (result > 0)
return true;
else
return false;
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheMapUtil method keys.
@Deprecated
public static Set<String> keys(CacheConfigBean cacheConfigBean, String key) {
UnitResponse unitResponseObject = SyncXian.call(CacheService.CACHE_SERVICE, "cacheMapKeys", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", key);
}
});
unitResponseObject.throwExceptionIfNotSuccess();
if (unitResponseObject.getData() != null)
return (Set<String>) unitResponseObject.getData();
else
return null;
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheMapUtil method values.
public static List<String> values(CacheConfigBean cacheConfigBean, String key) {
UnitResponse unitResponseObject = SyncXian.call(CacheService.CACHE_SERVICE, "cacheMapValues", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", key);
}
});
unitResponseObject.throwExceptionIfNotSuccess();
return unitResponseObject.getData();
}
use of info.xiancloud.core.message.UnitResponse in project xian by happyyangyuan.
the class CacheMapUtil method clear.
public static boolean clear(CacheConfigBean cacheConfigBean, String key) {
UnitResponse unitResponseObject = SyncXian.call(CacheService.CACHE_SERVICE, "cacheMapClear", new JSONObject() {
{
put("cacheConfig", cacheConfigBean);
put("key", key);
}
});
unitResponseObject.throwExceptionIfNotSuccess();
long result = (long) unitResponseObject.getData();
if (result > 0)
return true;
else
return false;
}
Aggregations