Search in sources :

Example 1 with GetExternalTunnelInterfaceNameOutputBuilder

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());
}
Also used : ExternalTunnelKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.external.tunnel.list.ExternalTunnelKey) ExternalTunnelList(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.ExternalTunnelList) ExternalTunnel(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.external.tunnel.list.ExternalTunnel) GetExternalTunnelInterfaceNameOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetExternalTunnelInterfaceNameOutput) GetExternalTunnelInterfaceNameOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetExternalTunnelInterfaceNameOutputBuilder)

Example 2 with GetExternalTunnelInterfaceNameOutputBuilder

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();
}
Also used : GetExternalTunnelInterfaceNameOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetExternalTunnelInterfaceNameOutput) BigInteger(java.math.BigInteger) GetExternalTunnelInterfaceNameOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetExternalTunnelInterfaceNameOutputBuilder)

Aggregations

GetExternalTunnelInterfaceNameOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetExternalTunnelInterfaceNameOutput)2 GetExternalTunnelInterfaceNameOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.GetExternalTunnelInterfaceNameOutputBuilder)2 BigInteger (java.math.BigInteger)1 ExternalTunnelList (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.ExternalTunnelList)1 ExternalTunnel (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.external.tunnel.list.ExternalTunnel)1 ExternalTunnelKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.external.tunnel.list.ExternalTunnelKey)1