use of com.emc.storageos.coordinator.client.service.impl.DualInetAddress in project coprhd-controller by CoprHD.
the class HealthMonitorService method getNodeIP.
/**
* Returns IP address of the node
*
* @param nodeId node id
* @return IP address
*/
private String getNodeIP(String nodeId) {
Map<String, DualInetAddress> ipLookupTable = _coordinatorClientExt.getCoordinatorClient().getInetAddessLookupMap().getControllerNodeIPLookupMap();
DualInetAddress ip = ipLookupTable.get(nodeId);
return ip.toString();
}
use of com.emc.storageos.coordinator.client.service.impl.DualInetAddress in project coprhd-controller by CoprHD.
the class TestCoordinatorService method createInetAddressLookup.
private CoordinatorClientInetAddressMap createInetAddressLookup() throws Exception {
CoordinatorClientInetAddressMap lookup = new CoordinatorClientInetAddressMap();
lookup.setNodeId("localhost");
lookup.setDualInetAddress(DualInetAddress.fromAddress("127.0.0.1"));
Map<String, DualInetAddress> addressMap = new HashMap<>();
addressMap.put(lookup.getNodeId(), lookup.getDualInetAddress());
lookup.setControllerNodeIPLookupMap(addressMap);
return lookup;
}
use of com.emc.storageos.coordinator.client.service.impl.DualInetAddress in project coprhd-controller by CoprHD.
the class StubCoordinatorClientImpl method createLocalAddressLookupMap.
/**
* Creates a local address lookup map for use in local tests.
*
* @return the lookup map.
*/
public static CoordinatorClientInetAddressMap createLocalAddressLookupMap() {
CoordinatorClientInetAddressMap addressMap = new CoordinatorClientInetAddressMap();
addressMap.setNodeId("localhost");
try {
addressMap.setDualInetAddress(DualInetAddress.fromAddress("127.0.0.1"));
} catch (UnknownHostException e) {
// Should never happen, ignore
}
Map<String, DualInetAddress> ips = new HashMap<>();
ips.put(addressMap.getNodeId(), addressMap.getDualInetAddress());
addressMap.setControllerNodeIPLookupMap(ips);
return addressMap;
}
use of com.emc.storageos.coordinator.client.service.impl.DualInetAddress in project coprhd-controller by CoprHD.
the class DisasterRecoveryService method checkNATForAttachStandby.
private void checkNATForAttachStandby(ViPRCoreClient viprCoreClient) {
DualInetAddress inetAddress = coordinator.getInetAddessLookupMap().getDualInetAddress();
String ipv4 = inetAddress.getInet4();
String ipv6 = inetAddress.getInet6();
log.info("Got local node's IP addresses, IPv4 = {}, IPv6 = {}", ipv4, ipv6);
DRNatCheckParam checkParam = new DRNatCheckParam();
checkParam.setIPv4Address(ipv4);
checkParam.setIPv6Address(ipv6);
DRNatCheckResponse resp = viprCoreClient.site().checkIfBehindNat(checkParam);
if (resp.isBehindNAT()) {
throw APIException.internalServerErrors.addStandbyPrecheckFailed(String.format("The remote site sees this node's IP as %s, which is different from the local addresses: %s or %s, it may be behind a NAT.", resp.getSeenIp(), ipv4, ipv6));
}
}
use of com.emc.storageos.coordinator.client.service.impl.DualInetAddress in project coprhd-controller by CoprHD.
the class CoordinatorTestBase method createLocalInetAddressLookupMap.
protected static CoordinatorClientInetAddressMap createLocalInetAddressLookupMap() throws UnknownHostException {
CoordinatorClientInetAddressMap lookup = new CoordinatorClientInetAddressMap();
lookup.setNodeId("localhost");
lookup.setDualInetAddress(DualInetAddress.fromAddress("127.0.0.1"));
Map<String, DualInetAddress> addressMap = new HashMap<>();
addressMap.put(lookup.getNodeId(), lookup.getDualInetAddress());
lookup.setControllerNodeIPLookupMap(addressMap);
return lookup;
}
Aggregations