public IncomingHostData(Map<Host, Long> hostData) { this.stats = new ArrayList<HostStatistics>(); for (Host h : hostData.keySet()) this.stats.add(new HostStatistics(h.getNetworkAddress(), hostData.get(h))); }
/** * Copy constructor * * @param h Host to copy values from * * @return constructed copy */ public Host(Host h) throws ConstructionException { if (h == null) { throw new ConstructionException("Passed null host"); } this.dataLayerAddress = h.getDataLayerAddress(); this.networkAddress = h.getNetworkAddress(); }
private Host handleHostAvailability(String containerName, String networkAddr) { IfIptoHost hostTracker = (IfIptoHost) ServiceHelper.getInstance(IfIptoHost.class, containerName, this); if (hostTracker == null) throw new ServiceUnavailableException("Host tracker " + RestMessages.SERVICEUNAVAILABLE.toString()); Set<HostNodeConnector> allHosts = hostTracker.getAllHosts(); if (allHosts == null) throw new ResourceNotFoundException(networkAddr + " : " + RestMessages.NOHOST.toString()); Host host = null; try { InetAddress networkAddress = InetAddress.getByName(networkAddr); for (Host h : allHosts) { if (h.getNetworkAddress().equals(networkAddress)) { host = h; break; } } } catch (UnknownHostException e) { } if (host == null) throw new ResourceNotFoundException(networkAddr + " : " + RestMessages.NOHOST.toString()); return host; } }
logger.debug("Notifying Topology Manager for Host {} Being {}", h.getNetworkAddress().getHostAddress(), add ? "Added" : "Deleted"); if (add == true) {