public abstract class StoreServiceProvider<T extends MagicEntity> extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected Class<T> |
clazz |
protected GroupServiceProvider |
groupServiceProvider |
protected Map<String,T> |
infos |
protected Map<String,Resource> |
mappings |
protected Resource |
workspace |
| 构造器和说明 |
|---|
StoreServiceProvider(Class<T> clazz,
Resource workspace,
GroupServiceProvider groupServiceProvider) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
allowMove(String id,
String groupId)
判断是否允许移动
|
List<T> |
cachedList() |
boolean |
delete(String id)
删除
|
boolean |
deleteGroup(String rootId,
List<String> groupIds)
根据组ID删除
|
T |
deserialize(byte[] data) |
T |
get(String id)
查询详情(主要给页面使用)
|
List<String> |
getIdsWithoutIds(List<String> idList) |
boolean |
insert(T info)
添加
|
List<T> |
list()
查询所有(提供给页面,无需带script)
|
List<T> |
listWithScript()
查询所有(内部使用,需要带Script)
|
boolean |
lock(String id) |
boolean |
move(String id,
String groupId)
移动
|
boolean |
reload(String groupId)
重新加载分组
|
byte[] |
serialize(T info) |
boolean |
unlock(String id) |
void |
unwrap(T info)
解除包装信息(可用于解密)
|
boolean |
update(T info)
修改
|
void |
wrap(T info)
包装信息(可用于加密)
|
protected Resource workspace
protected Map<String,T extends MagicEntity> infos
protected GroupServiceProvider groupServiceProvider
protected Class<T extends MagicEntity> clazz
public StoreServiceProvider(Class<T> clazz, Resource workspace, GroupServiceProvider groupServiceProvider)
public boolean insert(T info)
public boolean update(T info)
public boolean delete(String id)
public boolean lock(String id)
public boolean unlock(String id)
public boolean reload(String groupId)
public void wrap(T info)
public void unwrap(T info)
public byte[] serialize(T info)
public T deserialize(byte[] data)
Copyright © 2020–2021. All rights reserved.