Search in sources :

Example 11 with TreeNode

use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.

the class GetClassListTask method getDbClassInfo.

/**
	 * 
	 * Get the database class info
	 * 
	 * @return DBClasses
	 */
public DBClasses getDbClassInfo() {
    TreeNode node = (TreeNode) getResponse();
    DBClasses result = new DBClasses();
    setFieldValue(node, result);
    return result;
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode) DBClasses(com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses)

Example 12 with TreeNode

use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.

the class GetAnalyzeCasLogTask method getAnalyzeCasLogResultList.

/**
	 * <p>
	 * Get result from the response.
	 * </p>
	 * 
	 * @return {@link AnalyzeCasLogResultList}
	 */
public AnalyzeCasLogResultList getAnalyzeCasLogResultList() {
    TreeNode response = getResponse();
    if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
        return null;
    }
    AnalyzeCasLogResultList analyzeCasLogResultList = new AnalyzeCasLogResultList();
    String resultfile = response.getValue("resultfile");
    analyzeCasLogResultList.setResultfile(resultfile);
    // TOOLS-4132 CM can't make the broker_log_top result - fixed by cmserver https api bug
    if (response != null && response.getValue("resultlist") != null && response.getValues("result") != null) {
        String[] results = response.getValues("result");
        for (int i = 0; i < results.length / 2; i++) {
            AnalyzeCasLogResultInfo analyzeCasLogResultInfo = new AnalyzeCasLogResultInfo();
            analyzeCasLogResultInfo.setQindex((response.getValues("qindex"))[i]);
            if (response.getValue("max") == null) {
                analyzeCasLogResultInfo.setExecTime((response.getValues("exec_time"))[i]);
            } else {
                analyzeCasLogResultInfo.setMax((response.getValues("max"))[i]);
                analyzeCasLogResultInfo.setMin((response.getValues("min"))[i]);
                analyzeCasLogResultInfo.setAvg((response.getValues("avg"))[i]);
                analyzeCasLogResultInfo.setCnt((response.getValues("cnt"))[i]);
                analyzeCasLogResultInfo.setErr((response.getValues("err"))[i]);
            }
            analyzeCasLogResultList.addResultFile(analyzeCasLogResultInfo);
        }
    }
    return analyzeCasLogResultList;
}
Also used : AnalyzeCasLogResultList(com.cubrid.cubridmanager.core.logs.model.AnalyzeCasLogResultList) AnalyzeCasLogResultInfo(com.cubrid.cubridmanager.core.logs.model.AnalyzeCasLogResultInfo) TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 13 with TreeNode

use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.

the class GetCasLogTopResultTask method getAnalyzeCasLogTopResultList.

/**
	 * get result from the response
	 * 
	 * @return AnalyzeCasLogTopResultInfo
	 */
public AnalyzeCasLogTopResultInfo getAnalyzeCasLogTopResultList() {
    TreeNode response = getResponse();
    if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
        return null;
    }
    AnalyzeCasLogTopResultInfo analyzeCasLogTopResultList = new AnalyzeCasLogTopResultInfo();
    if (response != null && response.getValue("logstringlist") != null && response.getValue("logstringlist").equals("start")) {
        String[] results = response.getValues("logstring");
        for (int j = 0; j < results.length; j++) {
            String str = results[j];
            analyzeCasLogTopResultList.addLogString(str);
        }
    }
    return analyzeCasLogTopResultList;
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode) AnalyzeCasLogTopResultInfo(com.cubrid.cubridmanager.core.logs.model.AnalyzeCasLogTopResultInfo)

Example 14 with TreeNode

use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.

the class GetExecuteCasRunnerResultTask method getContent.

/**
	 * get result from the response.
	 * 
	 * @return GetExecuteCasRunnerResultInfo
	 */
public GetExecuteCasRunnerResultInfo getContent() {
    TreeNode response = getResponse();
    if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
        return null;
    }
    GetExecuteCasRunnerResultInfo getExecuteCasRunnerResultInfo = new GetExecuteCasRunnerResultInfo();
    String queryResultFile = response.getValue("query_result_file");
    String queryResultFileNum = response.getValue("query_result_file_num");
    getExecuteCasRunnerResultInfo.setQueryResultFile(queryResultFile);
    getExecuteCasRunnerResultInfo.setQueryResultFileNum(queryResultFileNum);
    if (response != null && response.getValue("result_list") != null && response.getValue("result_list").equals("start")) {
        String[] results = response.getValues("result");
        if (results == null) {
            return getExecuteCasRunnerResultInfo;
        }
        for (int j = 0; j < results.length; j++) {
            String str = results[j];
            if (str != null && str.trim().length() > 0) {
                getExecuteCasRunnerResultInfo.addResult(str);
            }
        }
    }
    return getExecuteCasRunnerResultInfo;
}
Also used : GetExecuteCasRunnerResultInfo(com.cubrid.cubridmanager.core.logs.model.GetExecuteCasRunnerResultInfo) TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 15 with TreeNode

use of com.cubrid.cubridmanager.core.common.socket.TreeNode in project cubrid-manager by CUBRID.

the class GetLogListTask method getLogContent.

/**
	 * get result from the response.
	 * 
	 * @return LogContentInfo
	 */
public LogContentInfo getLogContent() {
    TreeNode response = getResponse();
    if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
        return null;
    }
    LogContentInfo logContentInfo = new LogContentInfo();
    String path = response.getValue("path");
    String total = response.getValue("total");
    String start = response.getValue("start");
    String end = response.getValue("end");
    if (Integer.parseInt(total) == 0) {
        return null;
    }
    logContentInfo.setPath(path);
    logContentInfo.setTotal(total);
    for (int i = 0; i < response.childrenSize(); i++) {
        TreeNode node = response.getChildren().get(i);
        if (node != null && node.getValue("open") != null && node.getValue("open").equals("log")) {
            String[] lines = node.getValues("line");
            for (int j = 0; j < lines.length; j++) {
                String str = lines[j];
                // if (str != null && str.trim().length() > 0) {
                if (str != null) {
                    logContentInfo.addLine(str);
                }
            }
        } else {
            if (node != null) {
                if (null == start) {
                    start = node.getValue("start");
                    end = node.getValue("end");
                }
            }
        }
    }
    if (start != null && start.trim().length() > 0) {
        logContentInfo.setStart(start);
    }
    if (end != null && end.trim().length() > 0) {
        logContentInfo.setEnd(end);
    }
    return logContentInfo;
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode) LogContentInfo(com.cubrid.cubridmanager.core.logs.model.LogContentInfo)

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