Search in sources :

Example 76 with TreeNode

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;
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 77 with TreeNode

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;
}
Also used : HashMap(java.util.HashMap) TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 78 with TreeNode

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);
    }
}
Also used : CasAuthType(com.cubrid.cubridmanager.core.common.model.CasAuthType) StatusMonitorAuthType(com.cubrid.cubridmanager.core.common.model.StatusMonitorAuthType) TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode) ServerUserInfo(com.cubrid.cubridmanager.core.common.model.ServerUserInfo)

Example 79 with TreeNode

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;
    }
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 80 with TreeNode

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;
}
Also used : HashMap(java.util.HashMap) TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

TreeNode (com.cubrid.cubridmanager.core.common.socket.TreeNode)142 ArrayList (java.util.ArrayList)20 HashMap (java.util.HashMap)7 Map (java.util.Map)6 Trigger (com.cubrid.common.core.common.model.Trigger)2 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)2 ServerUserInfo (com.cubrid.cubridmanager.core.common.model.ServerUserInfo)2 DbBackupInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DbBackupInfo)2 DbUnloadInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DbUnloadInfo)2 DbUserInfo (com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo)2 GetExecuteCasRunnerResultInfo (com.cubrid.cubridmanager.core.logs.model.GetExecuteCasRunnerResultInfo)2 ManagerLogInfoList (com.cubrid.cubridmanager.core.logs.model.ManagerLogInfoList)2 ManagerLogInfos (com.cubrid.cubridmanager.core.logs.model.ManagerLogInfos)2 DbProcessStatusInfo (com.cubrid.cubridmanager.core.mondashboard.model.DbProcessStatusInfo)2 HADatabaseStatusInfo (com.cubrid.cubridmanager.core.mondashboard.model.HADatabaseStatusInfo)2 HAHostStatusInfo (com.cubrid.cubridmanager.core.mondashboard.model.HAHostStatusInfo)2 ReplicationInfo (com.cubrid.cubridmanager.core.replication.model.ReplicationInfo)2 ReplicationParamInfo (com.cubrid.cubridmanager.core.replication.model.ReplicationParamInfo)2 TransFileProgressInfo (com.cubrid.cubridmanager.core.replication.model.TransFileProgressInfo)2 CasAuthType (com.cubrid.cubridmanager.core.common.model.CasAuthType)1