mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 5191: incremental checkin
This commit is contained in:
parent
4a305631f9
commit
72243c8382
@ -30,15 +30,21 @@ public class ConsoleProxyInfo {
|
||||
this.proxyUrlPort = proxyUrlPort;
|
||||
}
|
||||
|
||||
public ConsoleProxyInfo(boolean sslEnabled, String proxyIpAddress, int port, int proxyUrlPort) {
|
||||
public ConsoleProxyInfo(boolean sslEnabled, String proxyIpAddress, int port, int proxyUrlPort, String consoleProxyUrlDomain) {
|
||||
this.sslEnabled = sslEnabled;
|
||||
|
||||
if(sslEnabled) {
|
||||
StringBuffer sb = new StringBuffer(proxyIpAddress);
|
||||
for(int i = 0; i < sb.length(); i++)
|
||||
if(sb.charAt(i) == '.')
|
||||
sb.setCharAt(i, '-');
|
||||
sb.append(".realhostip.com");
|
||||
sb.setCharAt(i, '-');
|
||||
if(consoleProxyUrlDomain!=null && consoleProxyUrlDomain.length()>0)
|
||||
{
|
||||
sb.append(".");
|
||||
sb.append(consoleProxyUrlDomain);
|
||||
}
|
||||
else
|
||||
sb.append(".realhostip.com");
|
||||
proxyAddress = sb.toString();
|
||||
proxyPort = port;
|
||||
this.proxyUrlPort = proxyUrlPort;
|
||||
|
||||
@ -75,6 +75,7 @@ public enum Config {
|
||||
ConsoleProxyCapacityScanInterval("Console Proxy", AgentManager.class, String.class, "consoleproxy.capacityscan.interval", "30000", "The time interval(in millisecond) to scan whether or not system needs more console proxy to ensure minimal standby capacity", null),
|
||||
ConsoleProxyCmdPort("Console Proxy", AgentManager.class, Integer.class, "consoleproxy.cmd.port", "8001", "Console proxy command port that is used to communicate with management server", null),
|
||||
ConsoleProxyRestart("Console Proxy", AgentManager.class, Boolean.class, "consoleproxy.restart", "true", "Console proxy restart flag, defaulted to true", null),
|
||||
ConsoleProxyUrlDomain("Console Proxy", AgentManager.class, String.class, "consoleproxy.url.domain", "realhostip.com", "Console proxy url domain", null),
|
||||
|
||||
// obselete
|
||||
//ConsoleProxyDomPEnable("Console Proxy", ManagementServer.class, Boolean.class, "consoleproxy.domP.enable", null, null, null),
|
||||
|
||||
@ -68,6 +68,7 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
|
||||
@Inject
|
||||
protected UserVmDao _userVmDao;
|
||||
private String _instance;
|
||||
protected String _consoleProxyUrlDomain;
|
||||
@Inject
|
||||
private VMInstanceDao _instanceDao;
|
||||
private ConsoleProxyListener _listener;
|
||||
@ -115,6 +116,8 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
|
||||
|
||||
_instance = configs.get("instance.name");
|
||||
|
||||
_consoleProxyUrlDomain = configs.get("consoleproxy.url.domain");
|
||||
|
||||
_listener = new ConsoleProxyListener(this);
|
||||
_agentMgr.registerForHostEvents(_listener, true, true, false);
|
||||
|
||||
@ -169,7 +172,7 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
|
||||
if (host.getProxyPort() != null && host.getProxyPort().intValue() > 0)
|
||||
urlPort = host.getProxyPort().intValue();
|
||||
|
||||
return new ConsoleProxyInfo(_sslEnabled, publicIp, _consoleProxyPort, urlPort);
|
||||
return new ConsoleProxyInfo(_sslEnabled, publicIp, _consoleProxyPort, urlPort, _consoleProxyUrlDomain);
|
||||
} else {
|
||||
s_logger.warn("Host that VM is running is no longer available, console access to VM " + userVmId + " will be temporarily unavailable.");
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ AgentBasedConsoleProxyManager {
|
||||
if(allocatedHost.getProxyPort() != null && allocatedHost.getProxyPort().intValue() > 0)
|
||||
urlPort = allocatedHost.getProxyPort().intValue();
|
||||
|
||||
return new ConsoleProxyInfo(_sslEnabled, publicIp, _consoleProxyPort, urlPort);
|
||||
return new ConsoleProxyInfo(_sslEnabled, publicIp, _consoleProxyPort, urlPort, _consoleProxyUrlDomain);
|
||||
} else {
|
||||
s_logger.warn("Host that VM is running is no longer available, console access to VM " + userVmId + " will be temporarily unavailable.");
|
||||
}
|
||||
|
||||
@ -316,7 +316,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, VirtualMach
|
||||
if (proxy == null)
|
||||
return null;
|
||||
|
||||
return new ConsoleProxyInfo(proxy.isSslEnabled(), proxy.getPublicIpAddress(), _consoleProxyPort, proxy.getPort());
|
||||
return new ConsoleProxyInfo(proxy.isSslEnabled(), proxy.getPublicIpAddress(), _consoleProxyPort, proxy.getPort(), _configDao.getValue("consoleproxy.url.domain"));
|
||||
}
|
||||
|
||||
public ConsoleProxyVO doAssignProxy(long dataCenterId, long vmId) {
|
||||
|
||||
@ -48,7 +48,7 @@ public class StaticConsoleProxyManager extends AgentBasedConsoleProxyManager imp
|
||||
|
||||
@Override
|
||||
public ConsoleProxyInfo assignProxy(long dataCenterId, long userVmId) {
|
||||
return new ConsoleProxyInfo(false, _ip, _consoleProxyPort, _consoleProxyUrlPort);
|
||||
return new ConsoleProxyInfo(false, _ip, _consoleProxyPort, _consoleProxyUrlPort, _consoleProxyUrlDomain);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user