Search in sources :

Example 1 with IsTunnelInternalOrExternalInput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.IsTunnelInternalOrExternalInput in project genius by opendaylight.

the class ItmManagerRpcService method isTunnelInternalOrExternal.

@Override
public Future<RpcResult<IsTunnelInternalOrExternalOutput>> isTunnelInternalOrExternal(IsTunnelInternalOrExternalInput input) {
    RpcResultBuilder<IsTunnelInternalOrExternalOutput> resultBld;
    String tunIfName = input.getTunnelInterfaceName();
    long tunVal = 0;
    IsTunnelInternalOrExternalOutputBuilder output = new IsTunnelInternalOrExternalOutputBuilder().setTunnelType(tunVal);
    if (ItmUtils.ITM_CACHE.getInternalTunnel(tunIfName) != null) {
        tunVal = 1;
    } else if (ItmUtils.ITM_CACHE.getExternalTunnel(tunIfName) != null) {
        tunVal = 2;
    }
    output.setTunnelType(tunVal);
    resultBld = RpcResultBuilder.success();
    resultBld.withResult(output.build());
    return Futures.immediateFuture(resultBld.build());
}
Also used : IsTunnelInternalOrExternalOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.IsTunnelInternalOrExternalOutput) IsTunnelInternalOrExternalOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.IsTunnelInternalOrExternalOutputBuilder)

Aggregations

IsTunnelInternalOrExternalOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.IsTunnelInternalOrExternalOutput)1 IsTunnelInternalOrExternalOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.IsTunnelInternalOrExternalOutputBuilder)1