Search in sources :

Example 26 with EnvInfo

use of com.cubrid.cubridmanager.core.common.model.EnvInfo in project cubrid-manager by CUBRID.

the class FunctionsSupportedInfoProviderTest method testIsSupportCMServer.

/**
	 * Test method for
	 * {@link com.cubrid.common.core.util.CompatibleUtil#isSupportCMServer(com.cubrid.cubridmanager.core.common.model.ServerInfo, java.lang.String)}
	 * .
	 */
public void testIsSupportCMServer() {
    EnvInfo envInfo = new EnvInfo();
    envInfo.setServerVersion("CUBRID 2008 R2.0(8.2.2.1150)");
    ServerInfo serverInfo = new ServerInfo();
    serverInfo.setConnected(true);
    serverInfo.setEnvInfo(envInfo);
    boolean support = CompatibleUtil.isSupportCMServer(serverInfo, "8.2.0");
    assertFalse(support);
}
Also used : ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) EnvInfo(com.cubrid.cubridmanager.core.common.model.EnvInfo)

Example 27 with EnvInfo

use of com.cubrid.cubridmanager.core.common.model.EnvInfo in project cubrid-manager by CUBRID.

the class GetEnvInfoTask method loadEnvInfo.

/**
	 * 
	 * Load CUBRID Server environment information
	 * 
	 * @return EnvInfo The instance of EnvInfo
	 */
public EnvInfo loadEnvInfo() {
    TreeNode response = getResponse();
    if (response == null || (this.getErrorMsg() != null && getErrorMsg().trim().length() > 0)) {
        if (this.getErrorMsg() == null || getErrorMsg().trim().length() <= 0) {
            errorMsg = Messages.error_invalidRequest;
        }
        return null;
    }
    String rootDir = response.getValue("CUBRID");
    String databaseDir = response.getValue("CUBRID_DATABASES");
    String cmServerDir = response.getValue("CUBRID_DBMT");
    String serverVersion = response.getValue("CUBRIDVER");
    String brokerVersion = response.getValue("BROKERVER");
    int i = 0;
    List<String> hostMonTabStatusList = new ArrayList<String>();
    while (true) {
        String value = response.getValue("HOSTMONTAB" + i);
        if (value == null) {
            break;
        } else if (value.trim().equals("ON") || value.trim().equals("OFF")) {
            hostMonTabStatusList.add(value.trim());
        } else {
            break;
        }
        i++;
    }
    String osInfo = response.getValue("osinfo");
    EnvInfo envInfo = new EnvInfo();
    envInfo.setRootDir(rootDir);
    envInfo.setDatabaseDir(databaseDir);
    envInfo.setCmServerDir(cmServerDir);
    envInfo.setServerVersion(serverVersion);
    envInfo.setBrokerVersion(brokerVersion);
    envInfo.setOsInfo(osInfo);
    int size = hostMonTabStatusList.size();
    String[] hostMonTabArr = new String[size];
    envInfo.setHostMonTabStatus(hostMonTabStatusList.toArray(hostMonTabArr));
    return envInfo;
}
Also used : TreeNode(com.cubrid.cubridmanager.core.common.socket.TreeNode) ArrayList(java.util.ArrayList) EnvInfo(com.cubrid.cubridmanager.core.common.model.EnvInfo)

Example 28 with EnvInfo

use of com.cubrid.cubridmanager.core.common.model.EnvInfo in project cubrid-manager by CUBRID.

the class FunctionsSupportedInfoProviderTest method testgetHAModeValue.

/**
	 * Test method for
	 * {@link com.cubrid.common.core.util.CompatibleUtil#getHAModeValue(ServerInfo)
	 * )} .
	 */
public void testgetHAModeValue() {
    EnvInfo envInfo = new EnvInfo();
    envInfo.setServerVersion("CUBRID 2008 R2.0(8.3.0.1150)");
    ServerInfo serverInfo = new ServerInfo();
    serverInfo.setConnected(true);
    serverInfo.setEnvInfo(envInfo);
    String mode = CompatibleUtil.getHAModeValue(serverInfo);
    assertEquals(mode, "string(on|off|yes|no)");
    envInfo.setServerVersion("CUBRID 2008 R2.0(8.4.0.1150)");
    envInfo.setOsInfo(FileUtil.OsInfoType.LINUX.toString());
    mode = CompatibleUtil.getHAModeValue(serverInfo);
    assertEquals(mode, "string(on|off|yes|no|replica)");
}
Also used : ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) EnvInfo(com.cubrid.cubridmanager.core.common.model.EnvInfo)

Example 29 with EnvInfo

use of com.cubrid.cubridmanager.core.common.model.EnvInfo in project cubrid-manager by CUBRID.

the class FunctionsSupportedInfoProviderTest method testIsQueryOrTransTimeUseMs.

/**
	 * Test method for
	 * {@link com.cubrid.common.core.util.CompatibleUtil#isQueryOrTransTimeUseMs(com.cubrid.cubridmanager.core.common.model.ServerInfo)}
	 * .
	 */
public void testIsQueryOrTransTimeUseMs() {
    EnvInfo envInfo = new EnvInfo();
    envInfo.setServerVersion("CUBRID 2008 R2.0(8.2.0.1150)");
    ServerInfo serverInfo = new ServerInfo();
    serverInfo.setConnected(true);
    serverInfo.setEnvInfo(envInfo);
    boolean support = CompatibleUtil.isQueryOrTransTimeUseMs(serverInfo);
    assertFalse(support);
    envInfo.setServerVersion("CUBRID 2008 R2.0(8.2.2.1150)");
    support = CompatibleUtil.isQueryOrTransTimeUseMs(serverInfo);
    assertTrue(support);
}
Also used : ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) EnvInfo(com.cubrid.cubridmanager.core.common.model.EnvInfo)

Example 30 with EnvInfo

use of com.cubrid.cubridmanager.core.common.model.EnvInfo in project cubrid-manager by CUBRID.

the class FunctionsSupportedInfoProviderTest method testIsSupportBrokerPort.

/**
	 * Test method for
	 * {@link com.cubrid.common.core.util.CompatibleUtil#isSupportBrokerPort(com.cubrid.cubridmanager.core.common.model.ServerInfo)}
	 * .
	 */
public void testIsSupportBrokerPort() {
    EnvInfo envInfo = new EnvInfo();
    envInfo.setServerVersion("CUBRID 2008 R2.0(8.2.0.1150)");
    ServerInfo serverInfo = new ServerInfo();
    serverInfo.setConnected(true);
    serverInfo.setEnvInfo(envInfo);
    boolean support = CompatibleUtil.isSupportBrokerPort(serverInfo);
    assertFalse(support);
    envInfo.setServerVersion("CUBRID 2008 R2.0(8.3.2.1150)");
    envInfo.setOsInfo(FileUtil.OsInfoType.NT.toString());
    support = CompatibleUtil.isSupportBrokerPort(serverInfo);
    assertTrue(support);
    support = CompatibleUtil.isSupportBrokerPort(null);
    assertFalse(support);
}
Also used : ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) EnvInfo(com.cubrid.cubridmanager.core.common.model.EnvInfo)

Aggregations

EnvInfo (com.cubrid.cubridmanager.core.common.model.EnvInfo)37 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)29 ITask (com.cubrid.common.core.task.ITask)5 GetEnvInfoTask (com.cubrid.cubridmanager.core.common.task.GetEnvInfoTask)5 ArrayList (java.util.ArrayList)5 Map (java.util.Map)4 BrokerInfos (com.cubrid.cubridmanager.core.broker.model.BrokerInfos)3 GetBrokerConfParameterTask (com.cubrid.cubridmanager.core.broker.task.GetBrokerConfParameterTask)3 ServerType (com.cubrid.cubridmanager.core.common.model.ServerType)3 ServerUserInfo (com.cubrid.cubridmanager.core.common.model.ServerUserInfo)3 CommonQueryTask (com.cubrid.cubridmanager.core.common.task.CommonQueryTask)3 GetCMConfParameterTask (com.cubrid.cubridmanager.core.common.task.GetCMConfParameterTask)3 GetCMUserListTask (com.cubrid.cubridmanager.core.common.task.GetCMUserListTask)3 GetCubridConfParameterTask (com.cubrid.cubridmanager.core.common.task.GetCubridConfParameterTask)3 MonitoringTask (com.cubrid.cubridmanager.core.common.task.MonitoringTask)3 UpdateCMUserTask (com.cubrid.cubridmanager.core.common.task.UpdateCMUserTask)3 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)3 GetDatabaseListTask (com.cubrid.cubridmanager.core.cubrid.database.task.GetDatabaseListTask)3 List (java.util.List)3 IStatus (org.eclipse.core.runtime.IStatus)3