Revise method name
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/ConfigCenterServiceImpl.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/ConfigCenterServiceImpl.java
index f166be2..ac677ce 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/ConfigCenterServiceImpl.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/ConfigCenterServiceImpl.java
@@ -43,7 +43,7 @@
public ConfigurationRepository getActivatedConfigCenter() {
Optional<CenterConfig> optional = centerConfigService.loadActivated(OrchestrationType.CONFIG_CENTER.getValue());
if (optional.isPresent()) {
- return CenterRepositoryFactory.createConfigCenter(optional.get());
+ return CenterRepositoryFactory.createConfigurationRepository(optional.get());
}
throw new ShardingSphereUIException(ShardingSphereUIException.SERVER_ERROR, "No activated config center!");
}
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/RegistryCenterServiceImpl.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/RegistryCenterServiceImpl.java
index 588bc91..017e1b7 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/RegistryCenterServiceImpl.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/servcie/impl/RegistryCenterServiceImpl.java
@@ -43,7 +43,7 @@
public RegistryRepository getActivatedRegistryCenter() {
Optional<CenterConfig> optional = centerConfigService.loadActivated(OrchestrationType.REGISTRY_CENTER.getValue());
if (optional.isPresent()) {
- return CenterRepositoryFactory.createRegistryCenter(optional.get());
+ return CenterRepositoryFactory.createRegistryRepository(optional.get());
}
throw new ShardingSphereUIException(ShardingSphereUIException.SERVER_ERROR, "No activated registry center!");
}
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/CenterRepositoryFactory.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/CenterRepositoryFactory.java
index 4f79ca6..788b1da 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/CenterRepositoryFactory.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/util/CenterRepositoryFactory.java
@@ -36,18 +36,18 @@
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class CenterRepositoryFactory {
- private static final ConcurrentHashMap<String, RegistryRepository> REGISTRY_CENTER_MAP = new ConcurrentHashMap<>();
+ private static final ConcurrentHashMap<String, RegistryRepository> REGISTRY_REPOSITORY_MAP = new ConcurrentHashMap<>();
- private static final ConcurrentHashMap<String, ConfigurationRepository> CONFIG_CENTER_MAP = new ConcurrentHashMap<>();
+ private static final ConcurrentHashMap<String, ConfigurationRepository> CONFIG_REPOSITORY_MAP = new ConcurrentHashMap<>();
/**
- * Create registry center instance.
+ * Create registry repository.
*
- * @param config registry center config
- * @return registry center
+ * @param config center config
+ * @return registry repository
*/
- public static RegistryRepository createRegistryCenter(final CenterConfig config) {
- RegistryRepository result = REGISTRY_CENTER_MAP.get(config.getName());
+ public static RegistryRepository createRegistryRepository(final CenterConfig config) {
+ RegistryRepository result = REGISTRY_REPOSITORY_MAP.get(config.getName());
if (null != result) {
return result;
}
@@ -65,18 +65,18 @@
throw new UnsupportedOperationException(config.getName());
}
result.init(config.getName(), convert(config));
- REGISTRY_CENTER_MAP.put(config.getName(), result);
+ REGISTRY_REPOSITORY_MAP.put(config.getName(), result);
return result;
}
/**
- * Create config center instance.
+ * Create configuration repository.
*
- * @param config config center config
- * @return config center
+ * @param config center config
+ * @return configuration repository
*/
- public static ConfigurationRepository createConfigCenter(final CenterConfig config) {
- ConfigurationRepository result = CONFIG_CENTER_MAP.get(config.getName());
+ public static ConfigurationRepository createConfigurationRepository(final CenterConfig config) {
+ ConfigurationRepository result = CONFIG_REPOSITORY_MAP.get(config.getName());
if (null != result) {
return result;
}
@@ -94,7 +94,7 @@
throw new UnsupportedOperationException(config.getName());
}
result.init(config.getName(), convert(config));
- CONFIG_CENTER_MAP.put(config.getName(), result);
+ CONFIG_REPOSITORY_MAP.put(config.getName(), result);
return result;
}
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/ConfigCenterController.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/ConfigCenterController.java
index a656ddc..3c4be26 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/ConfigCenterController.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/ConfigCenterController.java
@@ -84,7 +84,7 @@
*/
@RequestMapping(value = "/connect", method = RequestMethod.POST)
public ResponseResult<Boolean> connect(@RequestBody final CenterConfig config) {
- CenterRepositoryFactory.createConfigCenter(centerConfigService.load(config.getName(), OrchestrationType.CONFIG_CENTER.getValue()));
+ CenterRepositoryFactory.createConfigurationRepository(centerConfigService.load(config.getName(), OrchestrationType.CONFIG_CENTER.getValue()));
centerConfigService.setActivated(config.getName(), OrchestrationType.CONFIG_CENTER.getValue());
return ResponseResultUtil.build(Boolean.TRUE);
}
diff --git a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/RegistryCenterController.java b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/RegistryCenterController.java
index c50c9ab..508f16d 100644
--- a/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/RegistryCenterController.java
+++ b/shardingsphere-ui-backend/src/main/java/org/apache/shardingsphere/ui/web/controller/RegistryCenterController.java
@@ -84,7 +84,7 @@
*/
@RequestMapping(value = "/connect", method = RequestMethod.POST)
public ResponseResult<Boolean> connect(@RequestBody final CenterConfig config) {
- CenterRepositoryFactory.createRegistryCenter(centerConfigService.load(config.getName(), OrchestrationType.REGISTRY_CENTER.getValue()));
+ CenterRepositoryFactory.createRegistryRepository(centerConfigService.load(config.getName(), OrchestrationType.REGISTRY_CENTER.getValue()));
centerConfigService.setActivated(config.getName(), OrchestrationType.REGISTRY_CENTER.getValue());
return ResponseResultUtil.build(Boolean.TRUE);
}