use of com.cloud.agent.api.FindL2GatewayServiceCommand in project cloudstack by apache.
the class NiciraNvpGuestNetworkGuru method checkL2GatewayServiceSharedNetwork.
private void checkL2GatewayServiceSharedNetwork(HostVO niciraNvpHost) throws Exception {
String l2GatewayServiceUuid = niciraNvpHost.getDetail("l2gatewayserviceuuid");
if (l2GatewayServiceUuid == null) {
throw new Exception("No L2 Gateway Service found");
} else {
final FindL2GatewayServiceCommand cmdL2GWService = new FindL2GatewayServiceCommand(new L2GatewayServiceConfig(l2GatewayServiceUuid));
final FindL2GatewayServiceAnswer answerL2GWService = (FindL2GatewayServiceAnswer) agentMgr.easySend(niciraNvpHost.getId(), cmdL2GWService);
if (answerL2GWService == null || !answerL2GWService.getResult()) {
throw new Exception("No L2 Gateway Service found with uuid " + l2GatewayServiceUuid);
} else {
String uuidFound = answerL2GWService.getGatewayServiceUuid();
if (!uuidFound.equals(l2GatewayServiceUuid)) {
throw new Exception("Found L2 Gateway Service " + uuidFound + " instead of " + l2GatewayServiceUuid);
}
}
}
}
Aggregations