s_logger.info("Start configuring console proxy manager : " + name);
}
_name = name;
ComponentLocator locator = ComponentLocator.getCurrentLocator();
ConfigurationDao configDao = locator.getDao(ConfigurationDao.class);
if (configDao == null) {
throw new ConfigurationException("Unable to get the configuration dao.");
}
Map<String, String> configs = configDao.getConfiguration("management-server", params);
String value = configs.get(Config.ConsoleProxyCmdPort.key());
value = configs.get("consoleproxy.sslEnabled");
if (value != null && value.equalsIgnoreCase("true")) {
_sslEnabled = true;
}
value = configs.get(Config.ConsoleProxyCapacityScanInterval.key());
_capacityScanInterval = NumbersUtil.parseLong(value, DEFAULT_CAPACITY_SCAN_INTERVAL);
_capacityPerProxy = NumbersUtil.parseInt(configs.get("consoleproxy.session.max"), DEFAULT_PROXY_CAPACITY);
_standbyCapacity = NumbersUtil.parseInt(configs.get("consoleproxy.capacity.standby"), DEFAULT_STANDBY_CAPACITY);
_proxySessionTimeoutValue = NumbersUtil.parseInt(configs.get("consoleproxy.session.timeout"), DEFAULT_PROXY_SESSION_TIMEOUT);
value = configs.get("consoleproxy.port");
if (value != null) {
_consoleProxyPort = NumbersUtil.parseInt(value, ConsoleProxyManager.DEFAULT_PROXY_VNC_PORT);
}
value = configs.get(Config.ConsoleProxyDisableRpFilter.key());
if (value != null && value.equalsIgnoreCase("true")) {
_disable_rp_filter = true;
}
value = configs.get(Config.SystemVMUseLocalStorage.key());
if (value != null && value.equalsIgnoreCase("true")) {
_use_lvm = true;
}
value = configs.get("secondary.storage.vm");
if (value != null && value.equalsIgnoreCase("true")) {
_use_storage_vm = true;
}
if (s_logger.isInfoEnabled()) {
s_logger.info("Console proxy max session soft limit : " + _capacityPerProxy);
s_logger.info("Console proxy standby capacity : " + _standbyCapacity);
}
_instance = configs.get("instance.name");
if (_instance == null) {
_instance = "DEFAULT";
}
prepareDefaultCertificate();
Map<String, String> agentMgrConfigs = configDao.getConfiguration("AgentManager", params);
_mgmt_host = agentMgrConfigs.get("host");
if (_mgmt_host == null) {
s_logger.warn("Critical warning! Please configure your management server host address right after you have started your management server and then restart it, otherwise you won't be able to do console access");
}
value = agentMgrConfigs.get("port");
_mgmt_port = NumbersUtil.parseInt(value, 8250);
_consoleProxyAllocators = locator.getAdapters(ConsoleProxyAllocator.class);
if (_consoleProxyAllocators == null || !_consoleProxyAllocators.isSet()) {
throw new ConfigurationException("Unable to get proxy allocators");
}
_listener = new ConsoleProxyListener(this);