BatchingUtils.delete(intfId, BatchingUtils.EntityType.DEFAULT_CONFIG);
}
- public static org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
- .ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus updateStateEntry(
- Interface interfaceNew, DataBroker dataBroker, WriteTransaction transaction,
- org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
- .ietf.interfaces.rev140508.interfaces.state.Interface ifState) {
- org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
- .ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus operStatus;
+ public static OperStatus updateStateEntry(Interface interfaceNew, DataBroker dataBroker,
+ WriteTransaction transaction, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces
+ .rev140508.interfaces.state.Interface ifState) {
+ OperStatus operStatus = ifState.getOperStatus();
if (!interfaceNew.isEnabled()) {
operStatus = org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus.Down;
.getNodeConnectorFromInventoryOperDS(nodeConnectorId, dataBroker);
FlowCapableNodeConnector flowCapableNodeConnector = nodeConnector
.getAugmentation(FlowCapableNodeConnector.class);
- // State state = flowCapableNodeConnector.getState();
- operStatus = flowCapableNodeConnector == null
- ? org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
- .ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus.Down
- : org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
- .ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus.Up;
+ operStatus = getOpState(flowCapableNodeConnector);
}
- String ifName = interfaceNew.getName();
- InstanceIdentifier<org.opendaylight.yang.gen.v1.urn
- .ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface> ifStateId = IfmUtil
- .buildStateInterfaceId(interfaceNew.getName());
- InterfaceBuilder ifaceBuilder = new InterfaceBuilder();
- ifaceBuilder.setOperStatus(operStatus);
- ifaceBuilder.setKey(IfmUtil.getStateInterfaceKeyFromName(ifName));
- transaction.merge(LogicalDatastoreType.OPERATIONAL, ifStateId, ifaceBuilder.build());
+ updateOperStatus(interfaceNew.getName(), operStatus,transaction);
+ return operStatus;
+ }
+
+
+ public static OperStatus getOpState(FlowCapableNodeConnector flowCapableNodeConnector) {
+ OperStatus operStatus = flowCapableNodeConnector.getState().isLive()
+ && !flowCapableNodeConnector.getConfiguration().isPORTDOWN() ? OperStatus.Up : OperStatus.Down;
return operStatus;
}
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus operStatus,
WriteTransaction transaction) {
- LOG.debug("updating operational status for interface {}", interfaceName);
+ LOG.info("updating operational status {} for interface {}", interfaceName, operStatus);
InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
.ietf.interfaces.rev140508.interfaces.state.Interface> ifChildStateId = IfmUtil
.buildStateInterfaceId(interfaceName);
WriteTransaction transaction, Interface interfaceNew, DataBroker dataBroker,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
.ietf.interfaces.rev140508.interfaces.state.Interface ifState) {
- OperStatus operStatus = InterfaceManagerCommonUtils.updateStateEntry(interfaceNew, dataBroker, transaction,
- ifState);
-
IfL2vlan ifL2vlan = interfaceNew.getAugmentation(IfL2vlan.class);
if (ifL2vlan == null || IfL2vlan.L2vlanMode.Trunk != ifL2vlan.getL2vlanMode()
&& IfL2vlan.L2vlanMode.Transparent != ifL2vlan.getL2vlanMode()) {
return;
}
-
+ LOG.info("admin-state modified for interface {}", interfaceNew.getName());
+ OperStatus operStatus = InterfaceManagerCommonUtils.updateStateEntry(interfaceNew, dataBroker, transaction,
+ ifState);
InterfaceParentEntryKey interfaceParentEntryKey = new InterfaceParentEntryKey(interfaceNew.getName());
InterfaceParentEntry interfaceParentEntry = InterfaceMetaUtils
.getInterfaceParentEntryFromConfigDS(interfaceParentEntryKey, dataBroker);
AlivenessMonitorService alivenessMonitorService, ParentRefs parentRefsNew, Interface interfaceOld,
IfL2vlan ifL2vlanNew, Interface interfaceNew, IdManagerService idManager,
IMdsalApiManager mdsalApiManager) {
+ LOG.info("updating interface configuration for vlan memeber {} with parent-interface {}", interfaceNew
+ .getName(), parentRefsNew.getParentInterface());
List<ListenableFuture<Void>> futures = new ArrayList<>();
ParentRefs parentRefsOld = interfaceOld.getAugmentation(ParentRefs.class);
if (vlanIdModified(ifL2vlanOld.getVlanId(), ifL2vlanNew.getVlanId())
|| !parentRefsOld.getParentInterface().equals(parentRefsNew.getParentInterface())) {
+ LOG.info("vlan-id modified for interface {}", interfaceNew.getName());
futures.addAll(OvsVlanMemberConfigRemoveHelper.removeConfiguration(dataBroker, parentRefsOld, interfaceOld,
ifL2vlanOld, idManager));
futures.addAll(OvsVlanMemberConfigAddHelper.addConfiguration(dataBroker, parentRefsNew, interfaceNew,
if (interfaceNew.isEnabled()) {
operStatus = pifState.getOperStatus();
}
-
+ LOG.info("admin-state modified for interface {}", interfaceNew.getName());
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
InstanceIdentifier<org.opendaylight.yang.gen.v1.urn
.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface> ifStateId = IfmUtil
LOG.debug("Update of Interface State for port: {}", interfaceName);
List<ListenableFuture<Void>> futures = new ArrayList<>();
- Interface.OperStatus operStatusNew = getOpState(flowCapableNodeConnectorNew);
+ Interface.OperStatus operStatusNew = InterfaceManagerCommonUtils.getOpState(flowCapableNodeConnectorNew);
MacAddress macAddressNew = flowCapableNodeConnectorNew.getHardwareAddress();
- Interface.OperStatus operStatusOld = getOpState(flowCapableNodeConnectorOld);
+ Interface.OperStatus operStatusOld = InterfaceManagerCommonUtils.getOpState(flowCapableNodeConnectorOld);
MacAddress macAddressOld = flowCapableNodeConnectorOld.getHardwareAddress();
boolean opstateModified = false;
}
}
- public static Interface.OperStatus getOpState(FlowCapableNodeConnector flowCapableNodeConnector) {
- Interface.OperStatus operStatus = flowCapableNodeConnector.getState().isLive()
- && !flowCapableNodeConnector.getConfiguration().isPORTDOWN() ? Interface.OperStatus.Up
- : Interface.OperStatus.Down;
- return operStatus;
- }
-
public static void handleInterfaceStateUpdates(
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
.ietf.interfaces.rev140508.interfaces.Interface iface,