Search in sources :

Example 16 with TreeNode

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

the class GetManagerLogListTask method getLogContentV2.

private ManagerLogInfos getLogContentV2() {
    TreeNode response = getResponse();
    if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
        return null;
    }
    ManagerLogInfos managerLogInfos = new ManagerLogInfos();
    // for
    ManagerLogInfoList managerLogList = new ManagerLogInfoList();
    // for
    ManagerLogInfoList errorManagerLogList = new ManagerLogInfoList();
    String[] users = new String[response.childrenSize()];
    String[] tasknames = new String[response.childrenSize()];
    String[] times = new String[response.childrenSize()];
    String[] errorusers = new String[response.childrenSize()];
    String[] errortasknames = new String[response.childrenSize()];
    String[] errortimes = new String[response.childrenSize()];
    String[] errornotes = new String[response.childrenSize()];
    int j = 0, k = 0;
    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("accesslog")) {
            users[j] = node.getValue("user");
            tasknames[j] = node.getValue("taskname");
            times[j] = node.getValue("time");
            ++j;
        }
        if (node != null && node.getValue("open") != null && node.getValue("open").equals("errorlog")) {
            errorusers[k] = node.getValue("user");
            errortasknames[k] = node.getValue("taskname");
            errortimes[k] = node.getValue("time");
            errornotes[k] = node.getValue("errornote");
            ++k;
        }
    }
    addLogToManagerLogList(managerLogList, users, tasknames, times);
    managerLogInfos.setAccessLog(managerLogList);
    addLogToManagerLogList(errorManagerLogList, errorusers, errortasknames, errortimes, errornotes);
    managerLogInfos.setErrorLog(errorManagerLogList);
    return managerLogInfos;
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode) ManagerLogInfos(com.cubrid.cubridmanager.core.logs.model.ManagerLogInfos) ManagerLogInfoList(com.cubrid.cubridmanager.core.logs.model.ManagerLogInfoList)

Example 17 with TreeNode

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

the class SetCMConfParameterTaskTest method testReceive.

public void testReceive() throws Exception {
    if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
        return;
    String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/common/task/test.message/setcmconfpara_receive");
    String msg = Tool.getFileContent(filepath);
    TreeNode node = MessageUtil.parseResponse(msg);
    //compare 
    assertEquals("success", node.getValue("status"));
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 18 with TreeNode

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

the class SetHAConfParameterTaskTest method testReceive.

public void testReceive() throws Exception {
    if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
        return;
    String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/common/task/test.message/sethaconfpara_receive");
    String msg = Tool.getFileContent(filepath);
    TreeNode node = MessageUtil.parseResponse(msg);
    //compare 
    assertEquals("success", node.getValue("status"));
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 19 with TreeNode

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

the class UpdateCMUserTaskTest method testReceive.

public void testReceive() throws Exception {
    if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
        return;
    String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/common/task/test.message/updatecmuser_receive");
    String msg = Tool.getFileContent(filepath);
    TreeNode node = MessageUtil.parseResponse(msg);
    //compare 
    assertEquals("success", node.getValue("status"));
    UpdateCMUserTask task = new UpdateCMUserTask(serverInfo);
    task.setDbAuth(null, new String[] { "dba", "dba" }, new String[] { "", "" }, new String[] { "localhost,30000", "localhost,30000" });
    task.setDbAuth(new String[] {}, new String[] { "dba", "dba" }, new String[] { "", "" }, new String[] { "localhost,30000", "localhost,30000" });
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 20 with TreeNode

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

the class CreateDbTaskTest method testReceive.

public void testReceive() throws Exception {
    if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
        return;
    String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/cubrid/database/task/test.message/createdb_receive");
    String msg = Tool.getFileContent(filepath);
    TreeNode node = MessageUtil.parseResponse(msg);
    //compare 
    assertEquals("success", node.getValue("status"));
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

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