use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetExternalTunnelInterfaceNameOutputBuilder in project genius by opendaylight.
the class ItmManagerRpcService method getExternalTunnelInterfaceName.
@Override
public Future<RpcResult<GetExternalTunnelInterfaceNameOutput>> getExternalTunnelInterfaceName(GetExternalTunnelInterfaceNameInput input) {
SettableFuture.create();
RpcResultBuilder<GetExternalTunnelInterfaceNameOutput> resultBld;
String sourceNode = input.getSourceNode();
String dstNode = input.getDestinationNode();
ExternalTunnelKey externalTunnelKey = new ExternalTunnelKey(dstNode, sourceNode, input.getTunnelType());
InstanceIdentifier<ExternalTunnel> path = InstanceIdentifier.create(ExternalTunnelList.class).child(ExternalTunnel.class, externalTunnelKey);
ExternalTunnel exTunnel = ItmUtils.getExternalTunnelbyExternalTunnelKey(externalTunnelKey, path, this.dataBroker);
if (exTunnel != null) {
GetExternalTunnelInterfaceNameOutputBuilder output = new GetExternalTunnelInterfaceNameOutputBuilder();
output.setInterfaceName(exTunnel.getTunnelInterfaceName());
resultBld = RpcResultBuilder.success();
resultBld.withResult(output.build());
} else {
resultBld = RpcResultBuilder.failed();
}
return Futures.immediateFuture(resultBld.build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetExternalTunnelInterfaceNameOutputBuilder in project genius by opendaylight.
the class ItmRpcTestImpl method getExternalTunnelInterfaceName.
@Override
public synchronized Future<RpcResult<GetExternalTunnelInterfaceNameOutput>> getExternalTunnelInterfaceName(GetExternalTunnelInterfaceNameInput input) {
String interfaceName = externalInterfaceNames.get(new BigInteger(input.getSourceNode(), 10)).get(input.getDestinationNode());
GetExternalTunnelInterfaceNameOutput output = new GetExternalTunnelInterfaceNameOutputBuilder().setInterfaceName(interfaceName).build();
return RpcResultBuilder.success(output).buildFuture();
}
Aggregations