use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetTunnelInterfaceNameOutputBuilder in project genius by opendaylight.
the class ItmRpcTestImpl method getTunnelInterfaceName.
@Override
public synchronized Future<RpcResult<GetTunnelInterfaceNameOutput>> getTunnelInterfaceName(GetTunnelInterfaceNameInput input) {
String interfaceName = interfaceNames.get(input.getSourceDpid()).get(new String(tepIps.get(input.getDestinationDpid()).getValue()));
GetTunnelInterfaceNameOutput output = new GetTunnelInterfaceNameOutputBuilder().setInterfaceName(interfaceName).build();
return RpcResultBuilder.success(output).buildFuture();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetTunnelInterfaceNameOutputBuilder in project genius by opendaylight.
the class ItmManagerRpcService method getTunnelInterfaceName.
@Override
public Future<RpcResult<GetTunnelInterfaceNameOutput>> getTunnelInterfaceName(GetTunnelInterfaceNameInput input) {
RpcResultBuilder<GetTunnelInterfaceNameOutput> resultBld = null;
BigInteger sourceDpn = input.getSourceDpid();
BigInteger destinationDpn = input.getDestinationDpid();
Optional<InternalTunnel> optTunnel = Optional.absent();
if (ItmUtils.isTunnelAggregationUsed(input.getTunnelType())) {
optTunnel = ItmUtils.getInternalTunnelFromDS(sourceDpn, destinationDpn, TunnelTypeLogicalGroup.class, dataBroker);
LOG.debug("MULTIPLE_VxLAN_TUNNELS: getTunnelInterfaceName {}", optTunnel);
}
if (!optTunnel.isPresent()) {
optTunnel = ItmUtils.getInternalTunnelFromDS(sourceDpn, destinationDpn, input.getTunnelType(), dataBroker);
}
if (optTunnel.isPresent()) {
InternalTunnel tunnel = optTunnel.get();
GetTunnelInterfaceNameOutputBuilder output = new GetTunnelInterfaceNameOutputBuilder();
List<String> tunnelInterfaces = tunnel.getTunnelInterfaceNames();
if (tunnelInterfaces != null && !tunnelInterfaces.isEmpty()) {
output.setInterfaceName(tunnelInterfaces.get(0));
resultBld = RpcResultBuilder.success();
resultBld.withResult(output.build());
} else {
resultBld = RpcResultBuilder.failed();
}
} else {
resultBld = RpcResultBuilder.failed();
}
return Futures.immediateFuture(resultBld.build());
}
Aggregations