类 DefaultMagicResourceService
java.lang.Object
org.ssssssss.magicapi.core.service.impl.DefaultMagicResourceService
- 所有已实现的接口:
EventListener,org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationStartedEvent>,JsonCodeConstants,MagicResourceService
public class DefaultMagicResourceService
extends Object
implements MagicResourceService, JsonCodeConstants, org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationStartedEvent>
-
字段概要
字段修饰符和类型字段说明private final Map<String, MagicEntity> private final ReadWriteLockprivate final org.slf4j.Loggerprivate final org.springframework.context.ApplicationEventPublisherprivate final Resourceprivate final Map<String, MagicResourceStorage<? extends MagicEntity>> 从接口继承的字段 org.ssssssss.magicapi.core.config.JsonCodeConstants
API_NOT_FOUND, BACKUP_NOT_ENABLED, BODY_INVALID, CRON_ID_REQUIRED, DATASOURCE_KEY_INVALID, DS_KEY_CONFLICT, DS_KEY_REQUIRED, DS_URL_REQUIRED, FILE_IS_REQUIRED, FILE_NOT_FOUND, FILE_PATH_NOT_EXISTS, FILE_SAVE_FAILURE, FUNCTION_PATH_REQUIRED, GROUP_ID_REQUIRED, GROUP_NOT_FOUND, HEADER_INVALID, IS_READ_ONLY, MOVE_NAME_CONFLICT, MOVE_PATH_CONFLICT, NAME_INVALID, NAME_REQUIRED, NOT_SUPPORTED_GROUP_TYPE, PARAMETER_INVALID, PATH_CONFLICT, PATH_REQUIRED, PATH_VARIABLE_INVALID, PERMISSION_INVALID, REQUEST_METHOD_REQUIRED, REQUEST_PATH_CONFLICT, REQUEST_PATH_REQUIRED, RESOURCE_LOCKED, RESOURCE_PATH_CONFLICT, SAVE_GROUP_PATH_CONFLICT, SCRIPT_REQUIRED, SECRET_KEY_IS_REQUIRED, SIGN_IS_INVALID, SRC_GROUP_CONFLICT, SUCCESS, TARGET_IS_REQUIRED, TOPIC_ID_REQUIRED, TOPIC_TAG_REPEAT -
构造器概要
构造器构造器说明DefaultMagicResourceService(Resource resource, List<MagicResourceStorage<? extends MagicEntity>> storages, org.springframework.context.ApplicationEventPublisher publisher) -
方法概要
修饰符和类型方法说明convertToTree(List<Group> groups) private voidconvertToTree(List<Group> remains, TreeNode<Group> current) 复制分组boolean删除文件或文件夹private List<MagicEntity> deleteGroup(String id) private booleandoLockResource(String id, String lockState) voidexport(String groupId, List<SelectedResource> resources, OutputStream os) <T extends MagicEntity>
T获取文件详情<T extends MagicEntity>
List<T> 获取所有文件findGroups(String groupId) 获取分组详情getGroupName(String groupId) 获取完整分组名称getGroupPath(String groupId) 获取完整分组路径获取分组 Resourceprivate voidinit()<T extends MagicEntity>
List<T> 获取目录下的所有文件boolean锁定资源private StringmappingV1Type(String type) 兼容1.x版本boolean移动private <T extends MagicEntity>
boolean移动文件private boolean移动分组voidonApplicationEvent(org.springframework.boot.context.event.ApplicationStartedEvent applicationStartedEvent) private booleanprocessFileNotify(String id, EventAction action) private booleanprocessGroupNotify(String id, EventAction action) booleanprocessNotify(MagicNotify notify) private voidputFile(MagicResourceStorage<?> storage, MagicEntity entity, Resource resource) private voidprivate voidread(boolean triggerEvent) private voidreadAll()private voidreadAllResource(Resource root, Set<Group> groups, Set<MagicEntity> entities, boolean checked) private voidreadAllResource(Resource root, MagicResourceStorage<? extends MagicEntity> storage, Set<Group> groups, Set<MagicEntity> entities, Set<String> mappingKeys, String path, boolean checked) private <R> Rvoidrefresh()刷新缓存private voidrefreshGroup(Resource folder, MagicResourceStorage<? extends MagicEntity> storage) <T extends MagicEntity>
booleansaveFile(T entity) 保存文件boolean保存分组tree()全部分组全部分组boolean解锁资源booleanupload(InputStream inputStream, boolean full) private <R> R从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.springframework.context.ApplicationListener
supportsAsyncExecution从接口继承的方法 org.ssssssss.magicapi.core.config.JsonCodeConstants
isTrue, notBlank, notNull从接口继承的方法 org.ssssssss.magicapi.core.service.MagicResourceService
getScriptName
-
字段详细资料
-
root
-
groupMappings
-
groupCache
-
fileMappings
-
fileCache
-
pathCache
-
storages
-
lock
-
publisher
private final org.springframework.context.ApplicationEventPublisher publisher -
logger
private final org.slf4j.Logger logger
-
-
构造器详细资料
-
DefaultMagicResourceService
public DefaultMagicResourceService(Resource resource, List<MagicResourceStorage<? extends MagicEntity>> storages, org.springframework.context.ApplicationEventPublisher publisher)
-
-
方法详细资料
-
processNotify
- 指定者:
processNotify在接口中MagicResourceService
-
processGroupNotify
-
processFileNotify
-
init
private void init() -
read
private void read(boolean triggerEvent) -
readAll
private void readAll() -
refresh
public void refresh()从接口复制的说明:MagicResourceService刷新缓存- 指定者:
refresh在接口中MagicResourceService
-
getResource
- 指定者:
getResource在接口中MagicResourceService
-
refreshGroup
-
saveGroup
从接口复制的说明:MagicResourceService保存分组- 指定者:
saveGroup在接口中MagicResourceService
-
move
从接口复制的说明:MagicResourceService移动- 指定者:
move在接口中MagicResourceService- 参数:
src- 源IDgroupId- 目标分组
-
copyGroup
从接口复制的说明:MagicResourceService复制分组- 指定者:
copyGroup在接口中MagicResourceService- 参数:
src- 源IDgroupId- 目标分组
-
moveGroup
移动分组- 参数:
src- 分组信息target- 目标分组ID
-
moveFile
移动文件- 参数:
entity- 文件信息group- 目标分组
-
tree
从接口复制的说明:MagicResourceService全部分组- 指定者:
tree在接口中MagicResourceService
-
tree
从接口复制的说明:MagicResourceService全部分组- 指定者:
tree在接口中MagicResourceService
-
getGroupsByFileId
- 指定者:
getGroupsByFileId在接口中MagicResourceService
-
convertToTree
-
convertToTree
-
getGroupResource
从接口复制的说明:MagicResourceService获取分组 Resource- 指定者:
getGroupResource在接口中MagicResourceService- 参数:
id- 分组ID
-
saveFile
从接口复制的说明:MagicResourceService保存文件- 指定者:
saveFile在接口中MagicResourceService- 参数:
entity- 文件内容
-
deleteGroup
-
delete
从接口复制的说明:MagicResourceService删除文件或文件夹- 指定者:
delete在接口中MagicResourceService- 参数:
id- 文件或分组ID
-
listFiles
从接口复制的说明:MagicResourceService获取目录下的所有文件- 指定者:
listFiles在接口中MagicResourceService- 参数:
groupId- 分组ID
-
files
从接口复制的说明:MagicResourceService获取所有文件- 指定者:
files在接口中MagicResourceService- 参数:
type- 类型
-
file
从接口复制的说明:MagicResourceService获取文件详情- 指定者:
file在接口中MagicResourceService
-
getGroup
从接口复制的说明:MagicResourceService获取分组详情- 指定者:
getGroup在接口中MagicResourceService
-
export
public void export(String groupId, List<SelectedResource> resources, OutputStream os) throws IOException - 指定者:
export在接口中MagicResourceService- 抛出:
IOException
-
lock
从接口复制的说明:MagicResourceService锁定资源- 指定者:
lock在接口中MagicResourceService
-
doLockResource
-
unlock
从接口复制的说明:MagicResourceService解锁资源- 指定者:
unlock在接口中MagicResourceService
-
upload
- 指定者:
upload在接口中MagicResourceService- 抛出:
IOException
-
readAllResource
private void readAllResource(Resource root, Set<Group> groups, Set<MagicEntity> entities, boolean checked) -
readAllResource
private void readAllResource(Resource root, MagicResourceStorage<? extends MagicEntity> storage, Set<Group> groups, Set<MagicEntity> entities, Set<String> mappingKeys, String path, boolean checked) -
mappingV1Type
兼容1.x版本 -
getGroupName
从接口复制的说明:MagicResourceService获取完整分组名称- 指定者:
getGroupName在接口中MagicResourceService
-
getGroupPath
从接口复制的说明:MagicResourceService获取完整分组路径- 指定者:
getGroupPath在接口中MagicResourceService
-
findGroups
-
putGroup
-
putFile
-
readLock
-
writeLock
-
onApplicationEvent
public void onApplicationEvent(org.springframework.boot.context.event.ApplicationStartedEvent applicationStartedEvent) - 指定者:
onApplicationEvent在接口中org.springframework.context.ApplicationListener<org.springframework.boot.context.event.ApplicationStartedEvent>
-