You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package com.fanruan.api.cluster.state;
|
|
|
|
|
|
|
|
import com.fr.config.Configuration;
|
|
|
|
import com.fr.store.StateServerConfig;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 状态服务器配置
|
|
|
|
* @author Dylan.Liu
|
|
|
|
* @version 10.0
|
|
|
|
* Created by Dylan.Liu on 2019/12/3
|
|
|
|
*/
|
|
|
|
public class StateServerConfigKit {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取当前状态服务器类型
|
|
|
|
* @return 当前状态服务器类型
|
|
|
|
*/
|
|
|
|
public static String getType() {
|
|
|
|
|
|
|
|
return StateServerConfig.getInstance().getType();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取当前是否开启状态服务器
|
|
|
|
* @param isShareMode 当前是否开启状态服务器
|
|
|
|
*/
|
|
|
|
public static void setShareMode(boolean isShareMode) {
|
|
|
|
|
|
|
|
StateServerConfig.getInstance().setShareMode(isShareMode);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 是否是共享仓库
|
|
|
|
* @return 是否是共享仓库
|
|
|
|
*/
|
|
|
|
public static boolean isShareMode() {
|
|
|
|
|
|
|
|
return StateServerConfig.getInstance().isShareMode();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 设置状态服务器类型
|
|
|
|
* @param type 状态服务器类型
|
|
|
|
*/
|
|
|
|
public static void setType(String type) {
|
|
|
|
|
|
|
|
StateServerConfig.getInstance().setType(type);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取 StateServerConfig 类对象
|
|
|
|
* @return StateServerConfig 类对象
|
|
|
|
*/
|
|
|
|
public static Class<? extends Configuration> getConfigClass() {
|
|
|
|
|
|
|
|
return StateServerConfig.class;
|
|
|
|
}
|
|
|
|
}
|