Search in sources :

Example 66 with TreeNode

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

the class StopReplServerTaskTest method testStopReplServerReceive.

public void testStopReplServerReceive() throws Exception {
    if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "y"))
        return;
    String filepath = this.getFilePathInPlugin("/com/cubrid/cubridmanager/core/replication/task/test.message/StopReplServer_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 67 with TreeNode

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

the class GetReplicatedTablesTask method isReplicateAll.

/**
	 * 
	 * Get whether replicate all
	 * 
	 * @return <code>true</code> if replicated all;<code>false</code>otherwise
	 */
public boolean isReplicateAll() {
    TreeNode response = getResponse();
    if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
        return false;
    }
    String isReplAll = response.getValue("all_repl");
    return isReplAll != null && isReplAll.equalsIgnoreCase("Y");
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 68 with TreeNode

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

the class GetReplicationInfoTask method getReplicationInfo.

/**
	 * 
	 * Get replication information
	 * 
	 * @return the ReplicationInfo obj
	 */
public ReplicationInfo getReplicationInfo() {
    TreeNode response = getResponse();
    if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
        return null;
    }
    ReplicationInfo replInfo = new ReplicationInfo();
    DistributorInfo distInfo = new DistributorInfo();
    String agentPort = response.getValue("agent_port");
    String copyLogPath = response.getValue("copy_log_path");
    String trailLogPath = response.getValue("trail_log_path");
    String errorLogPath = response.getValue("error_log_path");
    String delayTimeLogSize = response.getValue("delay_time_log_size");
    String retryConnect = response.getValue("retry_connect");
    distInfo.setDistDbName(distDbName);
    distInfo.setAgentPort(agentPort);
    distInfo.setCopyLogPath(copyLogPath);
    distInfo.setTrailLogPath(trailLogPath);
    distInfo.setErrorLogPath(errorLogPath);
    distInfo.setDelayTimeLogSize(delayTimeLogSize);
    distInfo.setRestartReplWhenError(retryConnect.equalsIgnoreCase("Y"));
    replInfo.setDistInfo(distInfo);
    MasterInfo masterInfo = new MasterInfo();
    String masterDbName = response.getValue("master_db_name");
    String masterIP = response.getValue("master_ip");
    String replServerPort = response.getValue("repl_server_port");
    masterInfo.setMasterDbName(masterDbName);
    masterInfo.setMasterIp(masterIP);
    masterInfo.setReplServerPort(replServerPort);
    replInfo.addMasterInfo(masterInfo);
    SlaveInfo slaveInfo = new SlaveInfo();
    String slaveName = response.getValue("slave_db_name");
    String slaveIP = response.getValue("slave_ip");
    String userId = response.getValue("slave_userid");
    String password = response.getValue("slave_pass");
    slaveInfo.setSlaveDbName(slaveName);
    slaveInfo.setSlaveIP(slaveIP);
    slaveInfo.setDbUser(userId);
    slaveInfo.setPassword(password);
    replInfo.addSlaveInfo(slaveInfo);
    return replInfo;
}
Also used : MasterInfo(com.cubrid.cubridmanager.core.replication.model.MasterInfo) TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode) DistributorInfo(com.cubrid.cubridmanager.core.replication.model.DistributorInfo) ReplicationInfo(com.cubrid.cubridmanager.core.replication.model.ReplicationInfo) SlaveInfo(com.cubrid.cubridmanager.core.replication.model.SlaveInfo)

Example 69 with TreeNode

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

the class GetReplicationParamTask method getReplicationParams.

/**
	 * get result from the response.
	 * 
	 * @return the ReplicationParamInfo obj
	 */
public ReplicationParamInfo getReplicationParams() {
    TreeNode response = getResponse();
    if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
        return null;
    }
    ReplicationParamInfo replicationParamInfo = new ReplicationParamInfo();
    Map<String, String> dataMap = new HashMap<String, String>();
    dataMap.put(ReplicationParamConstants.PERF_POLL_INTERVAL, response.getValue(ReplicationParamConstants.PERF_POLL_INTERVAL));
    dataMap.put(ReplicationParamConstants.SIZE_OF_LOG_BUFFER, response.getValue(ReplicationParamConstants.SIZE_OF_LOG_BUFFER));
    dataMap.put(ReplicationParamConstants.SIZE_OF_CACHE_BUFFER, response.getValue(ReplicationParamConstants.SIZE_OF_CACHE_BUFFER));
    dataMap.put(ReplicationParamConstants.SIZE_OF_COPYLOG, response.getValue(ReplicationParamConstants.SIZE_OF_COPYLOG));
    dataMap.put(ReplicationParamConstants.INDEX_REPLICATION, response.getValue(ReplicationParamConstants.INDEX_REPLICATION));
    dataMap.put(ReplicationParamConstants.FOR_RECOVERY, response.getValue(ReplicationParamConstants.FOR_RECOVERY));
    dataMap.put(ReplicationParamConstants.LOG_APPLY_INTERVAL, response.getValue(ReplicationParamConstants.LOG_APPLY_INTERVAL));
    dataMap.put(ReplicationParamConstants.RESTART_INTERVAL, response.getValue(ReplicationParamConstants.RESTART_INTERVAL));
    replicationParamInfo.setParamMap(dataMap);
    return replicationParamInfo;
}
Also used : ReplicationParamInfo(com.cubrid.cubridmanager.core.replication.model.ReplicationParamInfo) HashMap(java.util.HashMap) TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode)

Example 70 with TreeNode

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

the class GetShardStatusTask method getShardsStatus.

// TODO
public ShardsStatus getShardsStatus() {
    TreeNode node = (TreeNode) getResponse();
    ShardsStatus result = new ShardsStatus();
    setFieldValueNew(node, result);
    return result;
}
Also used : ShardsStatus(com.cubrid.cubridmanager.core.shard.model.ShardsStatus) 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