Search in sources :

Example 1 with AddL2GwDeviceOutput

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

the class ElanL2GatewayUtils method createItmTunnels.

public static void createItmTunnels(DataBroker dataBroker, ItmRpcService itmRpcService, String hwvtepId, String psName, IpAddress tunnelIp) {
    AddL2GwDeviceInputBuilder builder = new AddL2GwDeviceInputBuilder();
    builder.setTopologyId(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
    builder.setNodeId(HwvtepSouthboundUtils.createManagedNodeId(new NodeId(hwvtepId), psName).getValue());
    builder.setIpAddress(tunnelIp);
    try {
        deleteStaleTunnelsOfHwvtepInITM(dataBroker, itmRpcService, hwvtepId, psName, tunnelIp);
        RpcResult<AddL2GwDeviceOutput> rpcResult = itmRpcService.addL2GwDevice(builder.build()).get();
        if (rpcResult.isSuccessful()) {
            LOG.info("Created ITM tunnels for {}", hwvtepId);
        } else {
            LOG.error("Failed to create ITM Tunnels: {}", rpcResult.getErrors());
        }
    } catch (InterruptedException | ExecutionException e) {
        LOG.error("RPC to create ITM tunnels failed", e);
    }
}
Also used : AddL2GwDeviceInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.AddL2GwDeviceInputBuilder) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) ExecutionException(java.util.concurrent.ExecutionException) AddL2GwDeviceOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.AddL2GwDeviceOutput)

Example 2 with AddL2GwDeviceOutput

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

the class L2GatewayUtils method createItmTunnels.

protected static void createItmTunnels(ItmRpcService itmRpcService, String hwvtepId, String psName, IpAddress tunnelIp) {
    AddL2GwDeviceInputBuilder builder = new AddL2GwDeviceInputBuilder();
    builder.setTopologyId(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
    builder.setNodeId(HwvtepSouthboundUtils.createManagedNodeId(new NodeId(hwvtepId), psName).getValue());
    builder.setIpAddress(tunnelIp);
    try {
        RpcResult<AddL2GwDeviceOutput> rpcResult = itmRpcService.addL2GwDevice(builder.build()).get();
        if (rpcResult.isSuccessful()) {
            LOG.info("Created ITM tunnels for {}", hwvtepId);
        } else {
            LOG.error("Failed to create ITM Tunnels: {}", rpcResult.getErrors());
        }
    } catch (InterruptedException | ExecutionException e) {
        LOG.error("RPC to create ITM tunnels failed", e);
    }
}
Also used : AddL2GwDeviceInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.AddL2GwDeviceInputBuilder) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) ExecutionException(java.util.concurrent.ExecutionException) AddL2GwDeviceOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.AddL2GwDeviceOutput)

Example 3 with AddL2GwDeviceOutput

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

the class L2GatewayUtils method createItmTunnels.

public static void createItmTunnels(ItmRpcService itmRpcService, String hwvtepId, String psName, IpAddress tunnelIp) {
    AddL2GwDeviceInputBuilder builder = new AddL2GwDeviceInputBuilder();
    builder.setTopologyId(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID.getValue());
    builder.setNodeId(HwvtepSouthboundUtils.createManagedNodeId(new NodeId(hwvtepId), psName).getValue());
    builder.setIpAddress(tunnelIp);
    try {
        RpcResult<AddL2GwDeviceOutput> rpcResult = itmRpcService.addL2GwDevice(builder.build()).get();
        if (rpcResult.isSuccessful()) {
            LOG.info("Created ITM tunnels for {}", hwvtepId);
        } else {
            LOG.error("Failed to create ITM Tunnels: {}", rpcResult.getErrors());
        }
    } catch (InterruptedException | ExecutionException e) {
        LOG.error("RPC to create ITM tunnels failed", e);
    }
}
Also used : AddL2GwDeviceInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.AddL2GwDeviceInputBuilder) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) ExecutionException(java.util.concurrent.ExecutionException) AddL2GwDeviceOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.AddL2GwDeviceOutput)

Aggregations

ExecutionException (java.util.concurrent.ExecutionException)3 AddL2GwDeviceInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.AddL2GwDeviceInputBuilder)3 AddL2GwDeviceOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rpcs.rev160406.AddL2GwDeviceOutput)3 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)3