Search in sources :

Example 11 with TerminationPointKey

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey in project genius by opendaylight.

the class HwVTEPConfigRemoveHelper method removeTerminationEndPoint.

private static void removeTerminationEndPoint(WriteTransaction transaction, IfTunnel ifTunnel, InstanceIdentifier<Node> globalNodeId) {
    LOG.info("removing remote termination end point {}", ifTunnel.getTunnelDestination());
    TerminationPointKey tpKey = SouthboundUtils.getTerminationPointKey(ifTunnel.getTunnelDestination().getIpv4Address().getValue());
    InstanceIdentifier<TerminationPoint> tpPath = SouthboundUtils.createInstanceIdentifier(globalNodeId, tpKey);
    transaction.delete(LogicalDatastoreType.CONFIGURATION, tpPath);
}
Also used : TerminationPointKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey) TerminationPoint(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint)

Example 12 with TerminationPointKey

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey in project genius by opendaylight.

the class HwVTEPInterfaceConfigAddHelper method createRemotePhysicalLocatorEntry.

private static InstanceIdentifier<TerminationPoint> createRemotePhysicalLocatorEntry(WriteTransaction transaction, InstanceIdentifier<Node> nodeIid, IpAddress destIPAddress) {
    String remoteIp = destIPAddress.getIpv4Address().getValue();
    LOG.debug("creating remote physical locator entry {}", remoteIp);
    TerminationPointKey tpKey = SouthboundUtils.getTerminationPointKey(remoteIp);
    InstanceIdentifier<TerminationPoint> tpPath = SouthboundUtils.createInstanceIdentifier(nodeIid, tpKey);
    createPhysicalLocatorEntry(transaction, tpPath, tpKey, destIPAddress);
    return tpPath;
}
Also used : TerminationPointKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey) TerminationPoint(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint)

Example 13 with TerminationPointKey

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey in project genius by opendaylight.

the class SouthboundUtils method getTerminationPointKey.

public static TerminationPointKey getTerminationPointKey(String ipAddress) {
    TerminationPointKey tpKey = null;
    String tpKeyStr = getTerminationPointKeyString(ipAddress);
    if (tpKeyStr != null) {
        tpKey = new TerminationPointKey(new TpId(tpKeyStr));
    }
    return tpKey;
}
Also used : TpId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId) TerminationPointKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey)

Example 14 with TerminationPointKey

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey in project genius by opendaylight.

the class HwvtepSouthboundUtils method getTerminationPointKey.

/**
 * Gets the termination point key.
 *
 * @param phyLocator
 *            the phy locator
 * @return the termination point key
 */
public static TerminationPointKey getTerminationPointKey(HwvtepPhysicalLocatorAugmentation phyLocator) {
    TerminationPointKey tpKey = null;
    if (phyLocator.getEncapsulationType() != null && phyLocator.getDstIp() != null) {
        String encapType = HwvtepSouthboundConstants.ENCAPS_TYPE_MAP.get(phyLocator.getEncapsulationType());
        String tpKeyStr = encapType + ":" + String.valueOf(phyLocator.getDstIp().getValue());
        tpKey = new TerminationPointKey(new TpId(tpKeyStr));
    }
    return tpKey;
}
Also used : TpId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId) TerminationPointKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey)

Example 15 with TerminationPointKey

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey in project bgpcep by opendaylight.

the class TunnelProgrammingTest method createNode.

private static Node createNode(final NodeId nodeId, final TpId tpId, final String ipv4Address) {
    final TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
    tpBuilder.setTpId(tpId);
    tpBuilder.setKey(new TerminationPointKey(tpId));
    tpBuilder.addAugmentation(TerminationPoint1.class, new TerminationPoint1Builder().setIgpTerminationPointAttributes(new IgpTerminationPointAttributesBuilder().setTerminationPointType(new IpBuilder().setIpAddress(Collections.singletonList(new IpAddress(new Ipv4Address(ipv4Address)))).build()).build()).build());
    final NodeBuilder nodeBuilder = new NodeBuilder();
    nodeBuilder.setNodeId(nodeId);
    nodeBuilder.setKey(new NodeKey(nodeId));
    nodeBuilder.setTerminationPoint(Lists.newArrayList(tpBuilder.build()));
    final SupportingNode supportingNode = new SupportingNodeBuilder().setKey(new SupportingNodeKey(nodeId, new TopologyId("dummy"))).addAugmentation(SupportingNode1.class, new SupportingNode1Builder().setPathComputationClient(new PathComputationClientBuilder().setControlling(true).build()).build()).build();
    nodeBuilder.setSupportingNode(Lists.newArrayList(supportingNode));
    return nodeBuilder.build();
}
Also used : SupportingNodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNodeBuilder) TerminationPointKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey) PathComputationClientBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.tunnel.pcep.supporting.node.attributes.PathComputationClientBuilder) TerminationPointBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder) SupportingNode(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode) SupportingNode1(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.SupportingNode1) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder) SupportingNodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNodeBuilder) SupportingNode1Builder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.tunnel.pcep.rev130820.SupportingNode1Builder) IpBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.termination.point.attributes.igp.termination.point.attributes.termination.point.type.IpBuilder) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) SupportingNodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNodeKey) IgpTerminationPointAttributesBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.igp.termination.point.attributes.IgpTerminationPointAttributesBuilder) SupportingNodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNodeKey) NodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey) TerminationPoint1Builder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.nt.l3.unicast.igp.topology.rev131021.TerminationPoint1Builder) TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId) Ipv4Address(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)

Aggregations

TerminationPointKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey)26 TerminationPoint (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint)20 TpId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TpId)19 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)11 NodeKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey)8 TerminationPointBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder)7 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)6 CountDownLatch (java.util.concurrent.CountDownLatch)5 Test (org.junit.Test)5 Mockito.doReturn (org.mockito.Mockito.doReturn)5 DataTreeModification (org.opendaylight.controller.md.sal.binding.api.DataTreeModification)5 ReadWriteTransaction (org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction)5 TestUtils.newInvNodeKey (org.opendaylight.openflowplugin.applications.topology.manager.TestUtils.newInvNodeKey)5 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)5 Topology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology)4 TestUtils.newLink (org.opendaylight.openflowplugin.applications.topology.manager.TestUtils.newLink)3 NetworkTopology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology)3 TopologyBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder)3 TopologyKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey)3 NodeBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)3