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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations