|
@@ -69,37 +69,36 @@ public class ManagerFactory implements Manager, ApplicationListener<ClosedEvent>
|
|
private Map<String, Puller> map;
|
|
private Map<String, Puller> map;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public String addUserConfig(ConfigModel model) {
|
|
|
|
|
|
+ public String addConfigModel(ConfigModel model) {
|
|
return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_ADD));
|
|
return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_ADD));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public String editUserConfig(ConfigModel model) {
|
|
|
|
|
|
+ public String editConfigModel(ConfigModel model) {
|
|
return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_EDIT));
|
|
return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_EDIT));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public UserConfig getUserConfig(String id) {
|
|
|
|
- return operationTemplate.queryObject(UserConfig.class, id);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public List<UserConfig> getUserConfigAll() {
|
|
|
|
- UserConfig userConfig = new UserConfig();
|
|
|
|
- userConfig.setType(ConfigConstant.USER);
|
|
|
|
- QueryConfig<UserConfig> queryConfig = new QueryConfig<>(userConfig);
|
|
|
|
- List<UserConfig> userConfigs = operationTemplate.queryAll(queryConfig);
|
|
|
|
- return userConfigs;
|
|
|
|
|
|
+ public void removeConfigModel(String id) {
|
|
|
|
+ operationTemplate.remove(new OperationConfig(id));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public String addProjectGroup(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_ADD));
|
|
|
|
|
|
+ public SystemConfig getSystemConfig() {
|
|
|
|
+ SystemConfig systemConfig = new SystemConfig();
|
|
|
|
+ systemConfig.setType(ConfigConstant.SYSTEM);
|
|
|
|
+ QueryConfig<SystemConfig> queryConfig = new QueryConfig<>(systemConfig);
|
|
|
|
+ List<SystemConfig> list = operationTemplate.queryAll(queryConfig);
|
|
|
|
+ return CollectionUtils.isEmpty(list) ? null : list.get(0);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public String editProjectGroup(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_EDIT));
|
|
|
|
|
|
+ public UserConfig getUserConfig() {
|
|
|
|
+ UserConfig userConfig = new UserConfig();
|
|
|
|
+ userConfig.setType(ConfigConstant.USER);
|
|
|
|
+ QueryConfig<UserConfig> queryConfig = new QueryConfig<>(userConfig);
|
|
|
|
+ List<UserConfig> list = operationTemplate.queryAll(queryConfig);
|
|
|
|
+ return CollectionUtils.isEmpty(list) ? null : list.get(0);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -107,11 +106,6 @@ public class ManagerFactory implements Manager, ApplicationListener<ClosedEvent>
|
|
return operationTemplate.queryObject(ProjectGroup.class, id);
|
|
return operationTemplate.queryObject(ProjectGroup.class, id);
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public void removeProjectGroup(String id) {
|
|
|
|
- operationTemplate.remove(new OperationConfig(id));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public List<ProjectGroup> getProjectGroupAll() {
|
|
public List<ProjectGroup> getProjectGroupAll() {
|
|
ProjectGroup projectGroup = new ProjectGroup();
|
|
ProjectGroup projectGroup = new ProjectGroup();
|
|
@@ -146,21 +140,6 @@ public class ManagerFactory implements Manager, ApplicationListener<ClosedEvent>
|
|
return parser.getMetaInfo(connectorId, tableName);
|
|
return parser.getMetaInfo(connectorId, tableName);
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public String addConnector(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_ADD));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public String editConnector(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_EDIT));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void removeConnector(String connectorId) {
|
|
|
|
- operationTemplate.remove(new OperationConfig(connectorId));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public Connector getConnector(String connectorId) {
|
|
public Connector getConnector(String connectorId) {
|
|
return operationTemplate.queryObject(Connector.class, connectorId);
|
|
return operationTemplate.queryObject(Connector.class, connectorId);
|
|
@@ -190,21 +169,6 @@ public class ManagerFactory implements Manager, ApplicationListener<ClosedEvent>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public String addMapping(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_ADD));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public String editMapping(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_EDIT));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void removeMapping(String mappingId) {
|
|
|
|
- operationTemplate.remove(new OperationConfig(mappingId));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public Mapping getMapping(String mappingId) {
|
|
public Mapping getMapping(String mappingId) {
|
|
return operationTemplate.queryObject(Mapping.class, mappingId);
|
|
return operationTemplate.queryObject(Mapping.class, mappingId);
|
|
@@ -219,21 +183,6 @@ public class ManagerFactory implements Manager, ApplicationListener<ClosedEvent>
|
|
return mappings;
|
|
return mappings;
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public String addTableGroup(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_ADD, GroupStrategyEnum.TABLE));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public String editTableGroup(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_EDIT, GroupStrategyEnum.TABLE));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void removeTableGroup(String tableGroupId) {
|
|
|
|
- operationTemplate.remove(new OperationConfig(tableGroupId, GroupStrategyEnum.TABLE));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public TableGroup getTableGroup(String tableGroupId) {
|
|
public TableGroup getTableGroup(String tableGroupId) {
|
|
return operationTemplate.queryObject(TableGroup.class, tableGroupId);
|
|
return operationTemplate.queryObject(TableGroup.class, tableGroupId);
|
|
@@ -277,26 +226,11 @@ public class ManagerFactory implements Manager, ApplicationListener<ClosedEvent>
|
|
return parser.getCount(connectorId, command);
|
|
return parser.getCount(connectorId, command);
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public String addMeta(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_ADD));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public String editMeta(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_EDIT));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public Meta getMeta(String metaId) {
|
|
public Meta getMeta(String metaId) {
|
|
return operationTemplate.queryObject(Meta.class, metaId);
|
|
return operationTemplate.queryObject(Meta.class, metaId);
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public void removeMeta(String metaId) {
|
|
|
|
- operationTemplate.remove(new OperationConfig(metaId));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public List<Meta> getMetaAll() {
|
|
public List<Meta> getMetaAll() {
|
|
Meta meta = new Meta();
|
|
Meta meta = new Meta();
|
|
@@ -305,29 +239,6 @@ public class ManagerFactory implements Manager, ApplicationListener<ClosedEvent>
|
|
return operationTemplate.queryAll(queryConfig);
|
|
return operationTemplate.queryAll(queryConfig);
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public String addSystemConfig(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_ADD));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public String editSystemConfig(ConfigModel model) {
|
|
|
|
- return operationTemplate.execute(new OperationConfig(model, CommandEnum.OPR_EDIT));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public SystemConfig getSystemConfig(String configId) {
|
|
|
|
- return operationTemplate.queryObject(SystemConfig.class, configId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public List<SystemConfig> getSystemConfigAll() {
|
|
|
|
- SystemConfig systemConfig = new SystemConfig();
|
|
|
|
- systemConfig.setType(ConfigConstant.SYSTEM);
|
|
|
|
- QueryConfig<SystemConfig> queryConfig = new QueryConfig<>(systemConfig);
|
|
|
|
- return operationTemplate.queryAll(queryConfig);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public Paging queryData(Query query, String collectionId) {
|
|
public Paging queryData(Query query, String collectionId) {
|
|
query.setType(StorageEnum.DATA);
|
|
query.setType(StorageEnum.DATA);
|
|
@@ -434,7 +345,7 @@ public class ManagerFactory implements Manager, ApplicationListener<ClosedEvent>
|
|
if (null != meta && meta.getState() != code) {
|
|
if (null != meta && meta.getState() != code) {
|
|
meta.setState(code);
|
|
meta.setState(code);
|
|
meta.setUpdateTime(Instant.now().toEpochMilli());
|
|
meta.setUpdateTime(Instant.now().toEpochMilli());
|
|
- editMeta(meta);
|
|
|
|
|
|
+ editConfigModel(meta);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|