use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class GetHeartbeatNodeInfoTask method getCurrentHostName.
public String getCurrentHostName() {
TreeNode response = getResponse();
if (response == null || this.isSuccess() != true) {
return null;
}
String currentHostName = response.getValue("currentnode");
return currentHostName;
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class GetCMConfParameterTask method getConfParameters.
/**
*
* Get cm.conf parameters
*
* @return Map<String, String> The map that stored configure parameters
*/
public Map<String, String> getConfParameters() {
TreeNode response = getResponse();
if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
return null;
}
Map<String, String> confMap = new HashMap<String, String>();
for (int i = 0; i < response.childrenSize(); i++) {
TreeNode node = response.getChildren().get(i);
if (node != null && node.getValue("open").equals("conflist")) {
buildConf(confMap, node);
}
}
return confMap;
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class GetCMUserListTask method buildUserInfo.
/**
*
* Build user info
*
* @param serverUserInfoList List<ServerUserInfo> The given list that stored
* some instance of ServerUserInfo
* @param node TreeNode
*/
private void buildUserInfo(List<ServerUserInfo> serverUserInfoList, TreeNode node) {
for (int j = 0; j < node.childrenSize(); j++) {
TreeNode node1 = node.getChildren().get(j);
if (node1.getValue("open") == null || !node1.getValue("open").trim().equals("user")) {
continue;
}
String userId = node1.getValue("id");
if (userId == null) {
continue;
}
String password = node1.getValue("passwd");
String casAuthInfo = node1.getValue("casauth");
String dbCreater = node1.getValue("dbcreate");
String statusMonitorAuthInfo = node1.getValue("statusmonitorauth");
ServerUserInfo userInfo = new ServerUserInfo(userId, password);
CasAuthType casAuthType = CasAuthType.AUTH_NONE;
if (casAuthInfo != null && casAuthInfo.trim().equals(CasAuthType.AUTH_ADMIN.getText())) {
casAuthType = CasAuthType.AUTH_ADMIN;
} else if (casAuthInfo != null && casAuthInfo.trim().equals(CasAuthType.AUTH_MONITOR.getText())) {
casAuthType = CasAuthType.AUTH_MONITOR;
}
userInfo.setCasAuth(casAuthType);
StatusMonitorAuthType statusMonitorAuth = StatusMonitorAuthType.AUTH_NONE;
if (statusMonitorAuthInfo != null && statusMonitorAuthInfo.trim().equals(StatusMonitorAuthType.AUTH_ADMIN.getText())) {
statusMonitorAuth = StatusMonitorAuthType.AUTH_ADMIN;
} else if (statusMonitorAuthInfo != null && statusMonitorAuthInfo.trim().equals(StatusMonitorAuthType.AUTH_MONITOR.getText())) {
statusMonitorAuth = StatusMonitorAuthType.AUTH_MONITOR;
}
userInfo.setStatusMonitorAuth(statusMonitorAuth);
if (userInfo.isAdmin()) {
userInfo.setStatusMonitorAuth(StatusMonitorAuthType.AUTH_ADMIN);
}
if (dbCreater != null && dbCreater.equals(DbCreateAuthType.AUTH_ADMIN.getText())) {
userInfo.setDbCreateAuthType(DbCreateAuthType.AUTH_ADMIN);
} else {
userInfo.setDbCreateAuthType(DbCreateAuthType.AUTH_NONE);
}
if (userInfo.getUserName().equals(serverInfo.getUserName())) {
userInfo.setPassword(serverInfo.getUserPassword());
}
buildDbAuthInfo(node1, userInfo);
serverUserInfoList.add(userInfo);
}
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class GetCmsEnvTask method getCertStatus.
public CertStatus getCertStatus() {
TreeNode node = getResponse();
if (node == null || (getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
return CertStatus.UNKNOWN;
}
String status = node.getValue("is_default_cert");
if (StringUtil.isEmpty(status)) {
return CertStatus.UNKNOWN;
} else if (StringUtil.booleanValueWithYN(status)) {
return CertStatus.DEFAULT;
} else {
return CertStatus.CUSTOMIZED;
}
}
use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.
the class GetCubridConfParameterTask method getConfParameters.
/**
*
* Get cubrid.conf parameters map
*
* @return Map<String, Map<String, String>> The map that stored the
* configure parameters
*/
public Map<String, Map<String, String>> getConfParameters() {
TreeNode response = getResponse();
if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
return null;
}
Map<String, Map<String, String>> confMap = new HashMap<String, Map<String, String>>();
for (int i = 0; i < response.childrenSize(); i++) {
TreeNode node = response.getChildren().get(i);
if (node != null && node.getValue("open").equals("conflist")) {
String[] confData = node.getValues("confdata");
if (confData != null && confData.length > 0) {
buildConf(confMap, confData);
}
}
}
return confMap;
}
Aggregations