use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.BridgeEntryKey in project genius by opendaylight.
the class OvsInterfaceConfigRemoveHelper method removeTunnelConfiguration.
private void removeTunnelConfiguration(ParentRefs parentRefs, String interfaceName, IfTunnel ifTunnel, WriteTransaction defaultOperationalShardTransaction) {
LOG.info("removing tunnel configuration for interface {}", interfaceName);
BigInteger dpId = null;
if (parentRefs != null) {
dpId = parentRefs.getDatapathNodeIdentifier();
}
if (dpId == null) {
return;
}
OvsdbBridgeRef ovsdbBridgeRef = interfaceMetaUtils.getOvsdbBridgeRef(dpId);
BridgeEntryKey bridgeEntryKey = new BridgeEntryKey(dpId);
InstanceIdentifier<BridgeEntry> bridgeEntryIid = InterfaceMetaUtils.getBridgeEntryIdentifier(bridgeEntryKey);
BridgeEntry bridgeEntry = interfaceMetaUtils.getBridgeEntryFromConfigDS(bridgeEntryIid);
if (bridgeEntry == null) {
LOG.debug("Bridge Entry not present for dpn: {}", dpId);
return;
}
List<BridgeInterfaceEntry> bridgeInterfaceEntries = bridgeEntry.getBridgeInterfaceEntry();
if (bridgeInterfaceEntries == null) {
LOG.debug("Bridge Interface Entries not present for dpn : {}", dpId);
return;
}
String tunnelName = SouthboundUtils.isOfTunnel(ifTunnel) ? SouthboundUtils.generateOfTunnelName(dpId, ifTunnel) : interfaceName;
boolean deleteTunnel = canDeleteTunnelPort(bridgeInterfaceEntries, ifTunnel);
if (ovsdbBridgeRef != null && deleteTunnel) {
southboundUtils.removeTerminationEndPoint(ovsdbBridgeRef.getValue(), tunnelName);
}
if (SouthboundUtils.isOfTunnel(ifTunnel)) {
if (deleteTunnel) {
interfaceManagerCommonUtils.deleteParentInterfaceEntry(tunnelName);
} else {
interfaceManagerCommonUtils.deleteInterfaceChildEntry(tunnelName, interfaceName);
}
}
// delete tunnel ingress flow
removeTunnelIngressFlow(interfaceName, ifTunnel, dpId);
// delete bridge to tunnel interface mappings
interfaceMetaUtils.deleteBridgeInterfaceEntry(bridgeEntryKey, bridgeInterfaceEntries, bridgeEntryIid, interfaceName);
int lportTag = interfaceMetaUtils.removeLportTagInterfaceMap(defaultOperationalShardTransaction, interfaceName);
cleanUpInterfaceWithUnknownState(interfaceName, parentRefs, ifTunnel, defaultOperationalShardTransaction);
// stop LLDP monitoring for the tunnel interface
alivenessMonitorUtils.stopLLDPMonitoring(ifTunnel, interfaceName);
if (ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeVxlan.class)) {
removeMultipleVxlanTunnelsConfiguration(interfaceName, parentRefs);
} else if (ifTunnel.getTunnelInterfaceType().isAssignableFrom(TunnelTypeLogicalGroup.class)) {
removeLogicalTunnelGroup(dpId, interfaceName, lportTag, defaultOperationalShardTransaction);
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.BridgeEntryKey in project genius by opendaylight.
the class InterfaceMetaUtils method addBridgeRefToBridgeInterfaceEntry.
public static void addBridgeRefToBridgeInterfaceEntry(BigInteger dpId, OvsdbBridgeRef ovsdbBridgeRef, WriteTransaction tx) {
BridgeEntryKey bridgeEntryKey = new BridgeEntryKey(dpId);
InstanceIdentifier<BridgeEntry> bridgeEntryInstanceIdentifier = getBridgeEntryIdentifier(bridgeEntryKey);
BridgeEntryBuilder bridgeEntryBuilder = new BridgeEntryBuilder().setKey(bridgeEntryKey).setBridgeReference(ovsdbBridgeRef);
tx.merge(LogicalDatastoreType.CONFIGURATION, bridgeEntryInstanceIdentifier, bridgeEntryBuilder.build(), true);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.BridgeEntryKey in project genius by opendaylight.
the class InterfaceMetaUtils method createBridgeInterfaceEntryInConfigDS.
public void createBridgeInterfaceEntryInConfigDS(BigInteger dpId, String childInterface) {
BridgeEntryKey bridgeEntryKey = new BridgeEntryKey(dpId);
BridgeInterfaceEntryKey bridgeInterfaceEntryKey = new BridgeInterfaceEntryKey(childInterface);
InstanceIdentifier<BridgeInterfaceEntry> bridgeInterfaceEntryIid = InterfaceMetaUtils.getBridgeInterfaceEntryIdentifier(bridgeEntryKey, bridgeInterfaceEntryKey);
BridgeInterfaceEntryBuilder entryBuilder = new BridgeInterfaceEntryBuilder().setKey(bridgeInterfaceEntryKey).setInterfaceName(childInterface);
batchingUtils.write(bridgeInterfaceEntryIid, entryBuilder.build(), BatchingUtils.EntityType.DEFAULT_CONFIG);
}
Aggregations