use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetExternalTunnelInterfaceNameOutput in project netvirt by opendaylight.
the class ElanItmUtils method getExternalTunnelInterfaceName.
/**
* Gets the external tunnel interface name.
*
* @param sourceNode
* the source node
* @param dstNode
* the dst node
* @return the external tunnel interface name
*/
public String getExternalTunnelInterfaceName(String sourceNode, String dstNode) {
Class<? extends TunnelTypeBase> tunType = TunnelTypeVxlan.class;
String tunnelInterfaceName = null;
try {
Future<RpcResult<GetExternalTunnelInterfaceNameOutput>> output = itmRpcService.getExternalTunnelInterfaceName(new GetExternalTunnelInterfaceNameInputBuilder().setSourceNode(sourceNode).setDestinationNode(dstNode).setTunnelType(tunType).build());
RpcResult<GetExternalTunnelInterfaceNameOutput> rpcResult = output.get();
if (rpcResult.isSuccessful()) {
tunnelInterfaceName = rpcResult.getResult().getInterfaceName();
LOG.debug("Tunnel interface name: {} for sourceNode: {} and dstNode: {}", tunnelInterfaceName, sourceNode, dstNode);
} else {
LOG.warn("RPC call to ITM.GetExternalTunnelInterfaceName failed with error: {}", rpcResult.getErrors());
}
} catch (NullPointerException | InterruptedException | ExecutionException e) {
LOG.error("Failed to get external tunnel interface name for sourceNode: {} and dstNode: {}", sourceNode, dstNode, e);
}
return tunnelInterfaceName;
}
Aggregations