Search in sources :

Example 46 with IfTunnel

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel in project genius by opendaylight.

the class HwVTEPConfigListener method add.

@Override
public void add(@Nonnull Interface newInterface) {
    // HwVTEPs support only VXLAN
    IfTunnel ifTunnel = newInterface.getAugmentation(IfTunnel.class);
    if (ifTunnel != null && ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
        ParentRefs parentRefs = newInterface.getAugmentation(ParentRefs.class);
        if (parentRefs != null && parentRefs.getNodeIdentifier() != null) {
            LOG.debug("Received HwVTEP Interface Add Event: {}", newInterface.getName());
            LOG.trace("Received HwVTEP Interface Add Event: {}", newInterface);
            for (NodeIdentifier nodeIdentifier : parentRefs.getNodeIdentifier()) {
                if (SouthboundUtils.HWVTEP_TOPOLOGY.equals(nodeIdentifier.getTopologyId())) {
                    coordinator.enqueueJob(newInterface.getName(), () -> HwVTEPInterfaceConfigAddHelper.addConfiguration(txRunner, createPhysicalSwitchInstanceIdentifier(nodeIdentifier.getNodeId()), createGlobalNodeInstanceIdentifier(nodeIdentifier.getNodeId()), newInterface, ifTunnel), IfmConstants.JOB_MAX_RETRIES);
                }
            }
        }
    }
}
Also used : ParentRefs(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefs) NodeIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.interfaces._interface.NodeIdentifier) IfTunnel(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel) TunnelTypeVxlan(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan)

Example 47 with IfTunnel

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel in project genius by opendaylight.

the class HwVTEPConfigListener method update.

@Override
public void update(@Nonnull Interface originalInterface, @Nonnull Interface updatedInterface) {
    // HwVTEPs support only VXLAN
    IfTunnel ifTunnel = originalInterface.getAugmentation(IfTunnel.class);
    if (ifTunnel != null && ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
        ParentRefs parentRefs = originalInterface.getAugmentation(ParentRefs.class);
        if (parentRefs != null && parentRefs.getNodeIdentifier() != null) {
            LOG.debug("Received HwVTEP Interface Update Event: {}", originalInterface.getName());
            LOG.trace("Received HwVTEP Interface Update Event: updatedInterface: {}, OriginalInterface: {}", updatedInterface, originalInterface);
            for (NodeIdentifier nodeIdentifier : parentRefs.getNodeIdentifier()) {
                if (SouthboundUtils.HWVTEP_TOPOLOGY.equals(nodeIdentifier.getTopologyId())) {
                    coordinator.enqueueJob(originalInterface.getName(), () -> HwVTEPInterfaceConfigUpdateHelper.updateConfiguration(txRunner, createPhysicalSwitchInstanceIdentifier(nodeIdentifier.getNodeId()), createGlobalNodeInstanceIdentifier(nodeIdentifier.getNodeId()), updatedInterface, ifTunnel), IfmConstants.JOB_MAX_RETRIES);
                }
            }
        }
    }
}
Also used : ParentRefs(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefs) NodeIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.interfaces._interface.NodeIdentifier) IfTunnel(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel) TunnelTypeVxlan(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan)

Example 48 with IfTunnel

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel in project genius by opendaylight.

the class HwVTEPConfigListener method remove.

@Override
public void remove(@Nonnull Interface removedInterface) {
    // HwVTEPs support only VXLAN
    IfTunnel ifTunnel = removedInterface.getAugmentation(IfTunnel.class);
    if (ifTunnel != null && ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
        ParentRefs parentRefs = removedInterface.getAugmentation(ParentRefs.class);
        if (parentRefs != null && parentRefs.getNodeIdentifier() != null) {
            LOG.debug("Received HwVTEP Interface Remove Event: {}", removedInterface.getName());
            LOG.trace("Received HwVTEP Interface Remove Event: {}", removedInterface);
            for (NodeIdentifier nodeIdentifier : parentRefs.getNodeIdentifier()) {
                if (SouthboundUtils.HWVTEP_TOPOLOGY.equals(nodeIdentifier.getTopologyId())) {
                    coordinator.enqueueJob(removedInterface.getName(), () -> HwVTEPConfigRemoveHelper.removeConfiguration(txRunner, removedInterface, createPhysicalSwitchInstanceIdentifier(nodeIdentifier.getNodeId()), createGlobalNodeInstanceIdentifier(nodeIdentifier.getNodeId())), IfmConstants.JOB_MAX_RETRIES);
                }
            }
        }
    }
}
Also used : ParentRefs(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefs) NodeIdentifier(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.interfaces._interface.NodeIdentifier) IfTunnel(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel) TunnelTypeVxlan(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan)

Aggregations

IfTunnel (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnel)38 ParentRefs (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefs)19 Interface (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface)14 ArrayList (java.util.ArrayList)13 InterfaceKey (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey)10 IfTunnelBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfTunnelBuilder)9 TunnelTypeVxlan (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan)9 BigInteger (java.math.BigInteger)8 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)8 List (java.util.List)7 ManagedNewTransactionRunner (org.opendaylight.genius.infra.ManagedNewTransactionRunner)7 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)7 InterfaceBuilder (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceBuilder)7 Logger (org.slf4j.Logger)7 LoggerFactory (org.slf4j.LoggerFactory)7 Collections (java.util.Collections)6 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)6 IfL2vlan (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlan)6 ParentRefsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.ParentRefsBuilder)6 TerminationPoint (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint)6