use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406._interface.child.info.InterfaceParentEntry in project genius by opendaylight.
the class OvsInterfaceConfigRemoveHelper method removeVlanConfiguration.
private void removeVlanConfiguration(ParentRefs parentRefs, String interfaceName, IfL2vlan ifL2vlan, WriteTransaction tx, List<ListenableFuture<Void>> futures) {
if (parentRefs == null || ifL2vlan == null || IfL2vlan.L2vlanMode.Trunk != ifL2vlan.getL2vlanMode() && IfL2vlan.L2vlanMode.Transparent != ifL2vlan.getL2vlanMode()) {
return;
}
LOG.info("removing vlan configuration for interface {}", interfaceName);
interfaceManagerCommonUtils.deleteInterfaceStateInformation(interfaceName, tx);
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState = interfaceManagerCommonUtils.getInterfaceState(interfaceName);
if (ifState == null) {
LOG.debug("could not fetch interface state corresponding to {}, probably already removed as part of port " + "removal event, proceeding with remaining config cleanups", interfaceName);
}
cleanUpInterfaceWithUnknownState(interfaceName, parentRefs, null, tx);
BigInteger dpId = IfmUtil.getDpnFromInterface(ifState);
FlowBasedServicesUtils.removeIngressFlow(interfaceName, dpId, txRunner, futures);
interfaceManagerCommonUtils.deleteParentInterfaceEntry(parentRefs.getParentInterface());
// For Vlan-Trunk Interface, remove the trunk-member operstates as
// well...
InterfaceParentEntry interfaceParentEntry = interfaceMetaUtils.getInterfaceParentEntryFromConfigDS(interfaceName);
if (interfaceParentEntry == null || interfaceParentEntry.getInterfaceChildEntry() == null) {
return;
}
VlanMemberStateRemoveWorker vlanMemberStateRemoveWorker = new VlanMemberStateRemoveWorker(txRunner, interfaceManagerCommonUtils, dpId, interfaceName, interfaceParentEntry);
coordinator.enqueueJob(interfaceName, vlanMemberStateRemoveWorker, IfmConstants.JOB_MAX_RETRIES);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406._interface.child.info.InterfaceParentEntry in project genius by opendaylight.
the class InterfaceManagerCommonUtils method createInterfaceChildEntryIfNotPresent.
// For trunk interfaces, binding to a parent interface which is already
// bound to another trunk interface should not
// be allowed
public boolean createInterfaceChildEntryIfNotPresent(WriteTransaction tx, String parentInterface, String childInterface, IfL2vlan.L2vlanMode l2vlanMode) {
InterfaceParentEntryKey interfaceParentEntryKey = new InterfaceParentEntryKey(parentInterface);
InstanceIdentifier<InterfaceParentEntry> interfaceParentEntryIdentifier = InterfaceMetaUtils.getInterfaceParentEntryIdentifier(interfaceParentEntryKey);
InterfaceParentEntry interfaceParentEntry = interfaceMetaUtils.getInterfaceParentEntryFromConfigDS(interfaceParentEntryIdentifier);
if (interfaceParentEntry != null) {
List<InterfaceChildEntry> interfaceChildEntries = interfaceParentEntry.getInterfaceChildEntry();
if (interfaceChildEntries != null) {
for (InterfaceChildEntry interfaceChildEntry : interfaceChildEntries) {
String curChildInterface = interfaceChildEntry.getChildInterface();
if (childInterface.equals(curChildInterface)) {
LOG.trace("Child entry for interface {} already exists", childInterface);
return false;
}
Interface iface = getInterfaceFromConfigDS(curChildInterface);
if (l2vlanMode == IfL2vlan.L2vlanMode.Trunk && isTrunkInterface(iface)) {
LOG.error("Trying to bind child interface {} of type Trunk to parent interface {}," + "but it is already bound to a trunk interface {}", childInterface, parentInterface, curChildInterface);
return false;
}
}
}
}
LOG.info("Creating child interface {} of type {} bound on parent-interface {}", childInterface, l2vlanMode, parentInterface);
createInterfaceChildEntry(parentInterface, childInterface, tx);
return true;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406._interface.child.info.InterfaceParentEntry in project genius by opendaylight.
the class InterfaceMetaUtils method getInterfaceParentEntryFromConfigDS.
@Deprecated
public InterfaceParentEntry getInterfaceParentEntryFromConfigDS(String interfaceName) {
InterfaceParentEntryKey interfaceParentEntryKey = new InterfaceParentEntryKey(interfaceName);
InterfaceParentEntry interfaceParentEntry = getInterfaceParentEntryFromConfigDS(interfaceParentEntryKey);
return interfaceParentEntry;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406._interface.child.info.InterfaceParentEntry in project genius by opendaylight.
the class InterfaceMetaUtils method getInterfaceParentEntryFromConfigDS.
public InterfaceParentEntry getInterfaceParentEntryFromConfigDS(ReadTransaction tx, String interfaceName) throws ReadFailedException {
InterfaceParentEntryKey interfaceParentEntryKey = new InterfaceParentEntryKey(interfaceName);
InterfaceParentEntry interfaceParentEntry = getInterfaceParentEntryFromConfigDS(tx, interfaceParentEntryKey);
return interfaceParentEntry;
}
Aggregations