this.notificationService = notificationService;
}
+ public DataBroker getDataBroker(){
+ return this.dataBroker;
+ }
+
@Override
public void onSessionInitiated(ProviderContext session) {
LOG.info("InterfacemgrProvider Session Initiated");
terminationPointStateListener = new TerminationPointStateListener(dataBroker);
terminationPointStateListener.registerListener(LogicalDatastoreType.OPERATIONAL, dataBroker);
- flowBasedServicesConfigListener = new FlowBasedServicesConfigListener(dataBroker);
+ flowBasedServicesConfigListener = new FlowBasedServicesConfigListener(this);
flowBasedServicesConfigListener.registerListener(LogicalDatastoreType.CONFIGURATION, dataBroker);
flowBasedServicesInterfaceStateListener =
@Override
public InterfaceInfo getInterfaceInfo(String interfaceName) {
- //FIXME [ELANBE] This is not working yet, fix this
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface
ifState = InterfaceManagerCommonUtils.getInterfaceStateFromOperDS(interfaceName, dataBroker);
NodeConnectorId ncId = IfmUtil.getNodeConnectorIdFromInterface(intf.getName(), dataBroker);
InterfaceInfo.InterfaceType interfaceType = IfmUtil.getInterfaceType(intf);
- InterfaceInfo interfaceInfo = null;
+ InterfaceInfo interfaceInfo = new InterfaceInfo(interfaceName);
BigInteger dpId = org.opendaylight.genius.interfacemanager.globals.IfmConstants.INVALID_DPID;
Integer portNo = org.opendaylight.genius.interfacemanager.globals.IfmConstants.INVALID_PORT_NO;
if (ncId != null) {
dpId = new BigInteger(IfmUtil.getDpnFromNodeConnectorId(ncId));
portNo = Integer.parseInt(IfmUtil.getPortNoFromNodeConnectorId(ncId));
}
-
if (interfaceType == InterfaceInfo.InterfaceType.VLAN_INTERFACE) {
interfaceInfo = IfmUtil.getVlanInterfaceInfo(interfaceName, intf, dpId);
- } else if (interfaceType == InterfaceInfo.InterfaceType.VXLAN_TRUNK_INTERFACE || interfaceType == InterfaceInfo.InterfaceType.GRE_TRUNK_INTERFACE) {/*
- trunkInterfaceInfo trunkInterfaceInfo = (TrunkInterfaceInfo) ConfigIfmUtil.getTrunkInterfaceInfo(ifName, ConfigIfmUtil.getInterfaceByIfName(dataBroker, ifName));
- String higherLayerIf = inf.getHigherLayerIf().get(0);
- Interface vlanInterface = ConfigIfmUtil.getInterfaceByIfName(dataBroker, higherLayerIf);
- trunkInterfaceInfo.setPortName(vlanInterface.getAugmentation(BaseConfig.class).getParentInterface());
- trunkInterfaceManager.updateTargetMacAddressInInterfaceInfo(trunkInterfaceInfo, trunkInterface);
- if (trunkInterface.getPhysAddress() != null) {
- trunkInterfaceInfo.setLocalMacAddress(trunkInterface.getPhysAddress().getValue());
- }
- interfaceInfo = trunkInterfaceInfo;
- interfaceInfo.setL2domainGroupId(IfmUtil.getGroupId(OperationalIfmUtil.getInterfaceStateByIfName(dataBroker, higherLayerIf).getIfIndex(), InterfaceType.VLAN_INTERFACE));
- */
+ } else if (interfaceType == InterfaceInfo.InterfaceType.VXLAN_TRUNK_INTERFACE ||
+ interfaceType == InterfaceInfo.InterfaceType.GRE_TRUNK_INTERFACE) {
+ // TODO : since there is no logical grouping for tunnel interfaces, there is no need
+ // for this code as of now. will be revisited once the support comes
+
} else {
LOG.error("Type of Interface {} is unknown", interfaceName);
return null;
public static void addStateEntry(String interfaceName, WriteTransaction transaction, DataBroker dataBroker, IdManagerService idManager,
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState) {
+ // allocate lport tag and create interface-if-index map.
+ // This is done even if interface-state is not present, so that there is no throttling
+ // on id allocation even when multiple southbound port_up events come in one shot
+ Integer ifIndex = IfmUtil.allocateId(idManager, IfmConstants.IFM_IDPOOL_NAME, interfaceName);
+ InterfaceMetaUtils.createLportTagInterfaceMap(transaction, interfaceName, ifIndex);
+ if(ifState == null){
+ LOG.debug("could not retrieve interface state corresponding to {}",interfaceName);
+ return;
+ }
LOG.debug("adding interface state for {}",interfaceName);
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus operStatus = ifState.getOperStatus();
PhysAddress physAddress = ifState.getPhysAddress();
childLowerLayerIfList.add(0, nodeConnectorId.getValue());
InterfaceBuilder ifaceBuilder = new InterfaceBuilder().setAdminStatus(adminStatus)
.setOperStatus(operStatus).setPhysAddress(physAddress).setLowerLayerIf(childLowerLayerIfList);
-
- Integer ifIndex = IfmUtil.allocateId(idManager, IfmConstants.IFM_IDPOOL_NAME, interfaceName);
ifaceBuilder.setIfIndex(ifIndex);
if(interfaceInfo != null){
ifaceBuilder.setKey(IfmUtil.getStateInterfaceKeyFromName(interfaceName));
transaction.put(LogicalDatastoreType.OPERATIONAL, ifStateId, ifaceBuilder.build(), true);
- // create lportTag Interface Map
- InterfaceMetaUtils.createLportTagInterfaceMap(transaction, interfaceName, ifIndex);
-
// install ingress flow
BigInteger dpId = new BigInteger(IfmUtil.getDpnFromNodeConnectorId(nodeConnectorId));
long portNo = Long.valueOf(IfmUtil.getPortNoFromNodeConnectorId(nodeConnectorId));
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.AdminStatus adminStatus,
NodeConnectorId nodeConnectorId) {
LOG.debug("adding interface state for {}",portName);
- if (interfaceInfo != null && !interfaceInfo.isEnabled()) {
- operStatus = org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus.Down;
+ InterfaceBuilder ifaceBuilder = new InterfaceBuilder();
+ Integer ifIndex = null;
+ if (interfaceInfo != null){
+ if(!interfaceInfo.isEnabled()){
+ operStatus = org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus.Down;
+ }
+
+ ifaceBuilder.setType(interfaceInfo.getType());
+ // retrieve if-index only for northbound configured interfaces
+ ifIndex = IfmUtil.allocateId(idManager, IfmConstants.IFM_IDPOOL_NAME, portName);
+ ifaceBuilder.setIfIndex(ifIndex);
}
InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface> ifStateId =
IfmUtil.buildStateInterfaceId(portName);
List<String> childLowerLayerIfList = new ArrayList<>();
childLowerLayerIfList.add(0, nodeConnectorId.getValue());
- InterfaceBuilder ifaceBuilder = new InterfaceBuilder().setAdminStatus(adminStatus)
+ ifaceBuilder.setAdminStatus(adminStatus)
.setOperStatus(operStatus).setPhysAddress(physAddress).setLowerLayerIf(childLowerLayerIfList);
-
- Integer ifIndex = IfmUtil.allocateId(idManager, IfmConstants.IFM_IDPOOL_NAME, portName);
- ifaceBuilder.setIfIndex(ifIndex);
-
- if(interfaceInfo != null){
- ifaceBuilder.setType(interfaceInfo.getType());
- }
ifaceBuilder.setKey(IfmUtil.getStateInterfaceKeyFromName(portName));
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState = ifaceBuilder.build();
transaction.put(LogicalDatastoreType.OPERATIONAL, ifStateId, ifState , true);
-
- // allocate lport tag and set in if-index
- InterfaceMetaUtils.createLportTagInterfaceMap(transaction, portName, ifIndex);
-
- // install ingress flow if this is an l2vlan interface
- if(InterfaceManagerCommonUtils.isVlanInterface(interfaceInfo) && interfaceInfo.isEnabled() &&
- ifState.getOperStatus() == org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus.Up) {
- BigInteger dpId = new BigInteger(IfmUtil.getDpnFromNodeConnectorId(nodeConnectorId));
- long portNo = Long.valueOf(IfmUtil.getPortNoFromNodeConnectorId(nodeConnectorId));
- List<MatchInfo> matches = FlowBasedServicesUtils.getMatchInfoForVlanPortAtIngressTable(dpId, portNo, interfaceInfo);
- FlowBasedServicesUtils.installVlanFlow(dpId, portNo, interfaceInfo, transaction, matches, ifIndex);
- }
return ifState;
}
return false;
}
-}
-
+}
\ No newline at end of file
// bridge ref entry will be null if the bridge is disconnected from controller.
// In that case, fetch bridge reference from bridge interface entry config DS
BridgeEntry bridgeEntry = getBridgeEntryFromConfigDS(dpId, dataBroker);
+ if(bridgeEntry == null){
+ return null;
+ }
return bridgeEntry.getBridgeReference();
}
return bridgeRefEntry.getBridgeReference();
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState =
InterfaceManagerCommonUtils.getInterfaceStateFromOperDS(parentRefs.getParentInterface(), dataBroker);
- if (ifState == null) {
- LOG.debug("could not retrieve interface state corresponding to {}",interfaceNew.getName());
- futures.add(transaction.submit());
- return;
- }
-
InterfaceManagerCommonUtils.addStateEntry(interfaceNew.getName(), transaction, dataBroker, idManager, ifState);
InterfaceParentEntryKey interfaceParentEntryKey = new InterfaceParentEntryKey(interfaceNew.getName());
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState =
InterfaceManagerCommonUtils.getInterfaceStateFromOperDS(parentRefs.getParentInterface(), dataBroker);
- if (ifState != null) {
- LOG.debug("add interface state info for vlan member {}",interfaceNew.getName());
- InterfaceManagerCommonUtils.addStateEntry(interfaceNew.getName(), t, dataBroker, idManager, ifState);
- }
+ LOG.debug("add interface state info for vlan member {}",interfaceNew.getName());
+ InterfaceManagerCommonUtils.addStateEntry(interfaceNew.getName(), t, dataBroker, idManager, ifState);
futures.add(t.submit());
return futures;
import org.opendaylight.genius.interfacemanager.commons.AlivenessMonitorUtils;
import org.opendaylight.genius.interfacemanager.commons.InterfaceManagerCommonUtils;
import org.opendaylight.genius.interfacemanager.commons.InterfaceMetaUtils;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesUtils;
+import org.opendaylight.genius.mdsalutil.MatchInfo;
import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey;
return futures;
}
+ // install ingress flow if this is an l2vlan interface
+ if(InterfaceManagerCommonUtils.isVlanInterface(iface) && iface.isEnabled() &&
+ ifState.getOperStatus() == org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus.Up) {
+ BigInteger dpId = new BigInteger(IfmUtil.getDpnFromNodeConnectorId(nodeConnectorId));
+ long portNo = Long.valueOf(IfmUtil.getPortNoFromNodeConnectorId(nodeConnectorId));
+ List<MatchInfo> matches = FlowBasedServicesUtils.getMatchInfoForVlanPortAtIngressTable(dpId, portNo, iface);
+ FlowBasedServicesUtils.installVlanFlow(dpId, portNo, iface, transaction, matches, ifState.getIfIndex());
+ }
+
futures.add(transaction.submit());
return futures;
}
return futures;
}
}
- FlowBasedServicesUtils.removeIngressFlow(interfaceName, dpId, transaction);
+ // remove ingress flow only for northbound configured interfaces
+ if(iface != null || (iface == null && interfaceName != fcNodeConnectorOld.getName())) {
+ FlowBasedServicesUtils.removeIngressFlow(interfaceName, dpId, transaction);
+ }
}
futures.add(transaction.submit());
return futures;
LOG.debug("updating interface oper status as {} for {}", opState.name(), interfaceName);
ifaceBuilder.setOperStatus(opState);
}
- transaction.merge(LogicalDatastoreType.OPERATIONAL, ifStateId, ifaceBuilder.build());
+ transaction.merge(LogicalDatastoreType.OPERATIONAL, ifStateId, ifaceBuilder.build(), false);
return iface;
}
}
+ private static String getBfdParamMinRx(IfTunnel ifTunnel){
+ if(ifTunnel != null && ifTunnel.getMonitorInterval() != null) {
+ return String.valueOf(Math.min(Long.valueOf(BFD_MIN_RX_VAL), ifTunnel.getMonitorInterval()));
+ }
+ return BFD_MIN_RX_VAL;
+ }
+
private static List<InterfaceBfd> getBfdParams(IfTunnel ifTunnel) {
List<InterfaceBfd> bfdParams = new ArrayList<>();
bfdParams.add(getIfBfdObj(BFD_PARAM_ENABLE,ifTunnel != null ? ifTunnel.isMonitorEnabled().toString() :"false"));
- bfdParams.add(getIfBfdObj(BFD_PARAM_MIN_TX, ifTunnel != null ? ifTunnel.getMonitorInterval().toString() : BFD_MIN_TX_VAL));
- bfdParams.add(getIfBfdObj(BFD_PARAM_MIN_RX, BFD_MIN_RX_VAL));
+ bfdParams.add(getIfBfdObj(BFD_PARAM_MIN_TX, ifTunnel != null && ifTunnel.getMonitorInterval() != null ?
+ ifTunnel.getMonitorInterval().toString() : BFD_MIN_TX_VAL));
+ bfdParams.add(getIfBfdObj(BFD_PARAM_MIN_RX, getBfdParamMinRx(ifTunnel)));
bfdParams.add(getIfBfdObj(BFD_PARAM_DECAY_MIN_RX, BFD_DECAY_MIN_RX_VAL));
bfdParams.add(getIfBfdObj(BFD_PARAM_FORWARDING_IF_RX, BFD_FORWARDING_IF_RX_VAL));
bfdParams.add(getIfBfdObj(BFD_PARAM_CPATH_DOWN, BFD_CPATH_DOWN_VAL));
--- /dev/null
+/*
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.genius.interfacemanager.IfmConstants;
+import org.opendaylight.genius.interfacemanager.IfmUtil;
+import org.opendaylight.genius.interfacemanager.InterfacemgrProvider;
+import org.opendaylight.genius.interfacemanager.commons.InterfaceManagerCommonUtils;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesAddable;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesUtils;
+import org.opendaylight.genius.mdsalutil.MatchInfo;
+import org.opendaylight.genius.mdsalutil.NwConstants;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class FlowBasedEgressServicesConfigBindHelper implements FlowBasedServicesAddable{
+ private static final Logger LOG = LoggerFactory.getLogger(FlowBasedEgressServicesConfigBindHelper.class);
+
+ private InterfacemgrProvider interfaceMgrProvider;
+ private static volatile FlowBasedServicesAddable flowBasedEgressServicesAddable;
+
+ private FlowBasedEgressServicesConfigBindHelper(InterfacemgrProvider interfaceMgrProvider) {
+ this.interfaceMgrProvider = interfaceMgrProvider;
+ }
+
+ public static void intitializeFlowBasedEgressServicesConfigAddHelper(InterfacemgrProvider interfaceMgrProvider) {
+ if (flowBasedEgressServicesAddable == null) {
+ synchronized (FlowBasedEgressServicesConfigBindHelper.class) {
+ if (flowBasedEgressServicesAddable == null) {
+ flowBasedEgressServicesAddable = new FlowBasedEgressServicesConfigBindHelper(interfaceMgrProvider);
+ }
+ }
+ }
+ }
+
+ public static FlowBasedServicesAddable getFlowBasedEgressServicesAddHelper() {
+ if (flowBasedEgressServicesAddable == null) {
+ LOG.error("OvsInterfaceConfigAdd Renderer is not initialized");
+ }
+ return flowBasedEgressServicesAddable;
+ }
+
+ public List<ListenableFuture<Void>> bindService(InstanceIdentifier<BoundServices> instanceIdentifier,
+ BoundServices boundServiceNew) {
+ List<ListenableFuture<Void>> futures = new ArrayList<>();
+ //TODO
+ return futures;
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.genius.interfacemanager.IfmConstants;
+import org.opendaylight.genius.interfacemanager.IfmUtil;
+import org.opendaylight.genius.interfacemanager.InterfacemgrProvider;
+import org.opendaylight.genius.interfacemanager.commons.InterfaceManagerCommonUtils;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesRemovable;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesUtils;
+import org.opendaylight.genius.mdsalutil.MatchInfo;
+import org.opendaylight.genius.mdsalutil.NwConstants;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+public class FlowBasedEgressServicesConfigUnbindHelper implements FlowBasedServicesRemovable{
+ private static final Logger LOG = LoggerFactory.getLogger(FlowBasedEgressServicesConfigUnbindHelper.class);
+
+ private InterfacemgrProvider interfaceMgrProvider;
+ private static volatile FlowBasedServicesRemovable flowBasedEgressServicesRemovable;
+
+ private FlowBasedEgressServicesConfigUnbindHelper(InterfacemgrProvider interfaceMgrProvider) {
+ this.interfaceMgrProvider = interfaceMgrProvider;
+ }
+
+ public static void intitializeFlowBasedEgressServicesConfigRemoveHelper(InterfacemgrProvider interfaceMgrProvider) {
+ if (flowBasedEgressServicesRemovable == null) {
+ synchronized (FlowBasedEgressServicesConfigUnbindHelper.class) {
+ if (flowBasedEgressServicesRemovable == null) {
+ flowBasedEgressServicesRemovable = new FlowBasedEgressServicesConfigUnbindHelper(interfaceMgrProvider);
+ }
+ }
+ }
+ }
+
+ public static FlowBasedServicesRemovable getFlowBasedEgressServicesRemoveHelper() {
+ if (flowBasedEgressServicesRemovable == null) {
+ LOG.error("FlowBasedIngressBindHelper`` is not initialized");
+ }
+ return flowBasedEgressServicesRemovable;
+ }
+
+ public List<ListenableFuture<Void>> unbindService(InstanceIdentifier<BoundServices> instanceIdentifier,
+ BoundServices boundServiceOld) {
+ List<ListenableFuture<Void>> futures = new ArrayList<>();
+ //TODO
+ return futures;
+ }
+
+}
\ No newline at end of file
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.genius.interfacemanager.IfmConstants;
import org.opendaylight.genius.interfacemanager.IfmUtil;
+import org.opendaylight.genius.interfacemanager.InterfacemgrProvider;
import org.opendaylight.genius.interfacemanager.commons.InterfaceManagerCommonUtils;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesAddable;
import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesUtils;
import org.opendaylight.genius.mdsalutil.MatchInfo;
import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-public class FlowBasedServicesConfigBindHelper {
- private static final Logger LOG = LoggerFactory.getLogger(FlowBasedServicesConfigBindHelper.class);
+public class FlowBasedIngressServicesConfigBindHelper implements FlowBasedServicesAddable{
+ private static final Logger LOG = LoggerFactory.getLogger(FlowBasedIngressServicesConfigBindHelper.class);
- public static List<ListenableFuture<Void>> bindService(InstanceIdentifier<BoundServices> instanceIdentifier,
- BoundServices boundServiceNew, DataBroker dataBroker) {
+ private InterfacemgrProvider interfaceMgrProvider;
+ private static volatile FlowBasedServicesAddable flowBasedIngressServicesAddable;
+
+ private FlowBasedIngressServicesConfigBindHelper(InterfacemgrProvider interfaceMgrProvider) {
+ this.interfaceMgrProvider = interfaceMgrProvider;
+ }
+
+ public static void intitializeFlowBasedIngressServicesConfigAddHelper(InterfacemgrProvider interfaceMgrProvider) {
+ if (flowBasedIngressServicesAddable == null) {
+ synchronized (FlowBasedIngressServicesConfigBindHelper.class) {
+ if (flowBasedIngressServicesAddable == null) {
+ flowBasedIngressServicesAddable = new FlowBasedIngressServicesConfigBindHelper(interfaceMgrProvider);
+ }
+ }
+ }
+ }
+
+ public static void clearFlowBasedIngressServicesConfigAddHelper() {
+ flowBasedIngressServicesAddable = null;
+ }
+
+ public static FlowBasedServicesAddable getFlowBasedIngressServicesAddHelper() {
+ if (flowBasedIngressServicesAddable == null) {
+ LOG.error("OvsInterfaceConfigAdd Renderer is not initialized");
+ }
+ return flowBasedIngressServicesAddable;
+ }
+
+ public List<ListenableFuture<Void>> bindService(InstanceIdentifier<BoundServices> instanceIdentifier,
+ BoundServices boundServiceNew) {
List<ListenableFuture<Void>> futures = new ArrayList<>();
+ DataBroker dataBroker = interfaceMgrProvider.getDataBroker();
String interfaceName =
InstanceIdentifier.keyOf(instanceIdentifier.firstIdentifierOf(ServicesInfo.class)).getInterfaceName();
Class<? extends ServiceModeBase> serviceMode = InstanceIdentifier.keyOf(instanceIdentifier.firstIdentifierOf(ServicesInfo.class)).getServiceMode();
List<ListenableFuture<Void>> futures = new ArrayList<>();
BigInteger dpId = FlowBasedServicesUtils.getDpnIdFromInterface(ifState);
WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
- LOG.warn("binding service for vlan port: {}", ifState.getName());
+ LOG.info("binding service for vlan port: {}", ifState.getName());
if (allServices.size() == 1) {
//calling LportDispatcherTableForService with current service index as 0 and next service index as some value since this is the only service bound.
FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, boundServiceNew, ifState.getName(),
//In this case the match criteria of existing service should be changed.
BoundServices lower = FlowBasedServicesUtils.getHighAndLowPriorityService(allServices, low)[0];
short lowerServiceIndex = (short) ((lower!=null) ? lower.getServicePriority() : low.getServicePriority() + 1);
- LOG.trace("Installing table 30 entry for existing service {} service match on service index {} update with service index {}", low, low.getServicePriority(), lowerServiceIndex);
+ LOG.trace("Installing table 17 entry for existing service {} service match on service index {} update with service index {}", low, low.getServicePriority(), lowerServiceIndex);
FlowBasedServicesUtils.installLPortDispatcherFlow(dpId,low, ifState.getName(), transaction, ifState.getIfIndex(),low.getServicePriority(), lowerServiceIndex);
} else {
currentServiceIndex = boundServiceNew.getServicePriority();
if (high != null) {
currentServiceIndex = boundServiceNew.getServicePriority();
if (high.equals(highest)) {
- LOG.trace("Installing table 30 entry for existing service {} service match on service index {} update with service index {}", high, IfmConstants.DEFAULT_SERVICE_INDEX, currentServiceIndex);
+ LOG.trace("Installing table 17 entry for existing service {} service match on service index {} update with service index {}", high, IfmConstants.DEFAULT_SERVICE_INDEX, currentServiceIndex);
FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, high, ifState.getName(), transaction, ifState.getIfIndex(), IfmConstants.DEFAULT_SERVICE_INDEX, currentServiceIndex);
} else {
- LOG.trace("Installing table 30 entry for existing service {} service match on service index {} update with service index {}", high, high.getServicePriority(), currentServiceIndex);
+ LOG.trace("Installing table 17 entry for existing service {} service match on service index {} update with service index {}", high, high.getServicePriority(), currentServiceIndex);
FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, high, ifState.getName(), transaction, ifState.getIfIndex(), high.getServicePriority(), currentServiceIndex);
}
}
- LOG.trace("Installing table 30 entry for new service match on service index {} update with service index {}", currentServiceIndex, nextServiceIndex);
+ LOG.trace("Installing table 17 entry for new service match on service index {} update with service index {}", currentServiceIndex, nextServiceIndex);
FlowBasedServicesUtils.installLPortDispatcherFlow(dpId, boundServiceNew, ifState.getName(), transaction, ifState.getIfIndex(), currentServiceIndex, nextServiceIndex);
futures.add(transaction.submit());
return futures;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.genius.interfacemanager.IfmConstants;
import org.opendaylight.genius.interfacemanager.IfmUtil;
+import org.opendaylight.genius.interfacemanager.InterfacemgrProvider;
import org.opendaylight.genius.interfacemanager.commons.InterfaceManagerCommonUtils;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesRemovable;
import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesUtils;
import org.opendaylight.genius.mdsalutil.MatchInfo;
import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceKey;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface.OperStatus;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-public class FlowBasedServicesConfigUnbindHelper {
- private static final Logger LOG = LoggerFactory.getLogger(FlowBasedServicesConfigUnbindHelper.class);
+public class FlowBasedIngressServicesConfigUnbindHelper implements FlowBasedServicesRemovable{
+ private static final Logger LOG = LoggerFactory.getLogger(FlowBasedIngressServicesConfigUnbindHelper.class);
- public static List<ListenableFuture<Void>> unbindService(InstanceIdentifier<BoundServices> instanceIdentifier,
- BoundServices boundServiceOld, DataBroker dataBroker) {
+ private InterfacemgrProvider interfaceMgrProvider;
+ private static volatile FlowBasedServicesRemovable flowBasedIngressServicesRemovable;
+
+ private FlowBasedIngressServicesConfigUnbindHelper(InterfacemgrProvider interfaceMgrProvider) {
+ this.interfaceMgrProvider = interfaceMgrProvider;
+ }
+
+ public static void intitializeFlowBasedIngressServicesConfigRemoveHelper(InterfacemgrProvider interfaceMgrProvider) {
+ if (flowBasedIngressServicesRemovable == null) {
+ synchronized (FlowBasedIngressServicesConfigUnbindHelper.class) {
+ if (flowBasedIngressServicesRemovable == null) {
+ flowBasedIngressServicesRemovable = new FlowBasedIngressServicesConfigUnbindHelper(interfaceMgrProvider);
+ }
+ }
+ }
+ }
+
+ public static FlowBasedServicesRemovable getFlowBasedIngressServicesRemoveHelper() {
+ if (flowBasedIngressServicesRemovable == null) {
+ LOG.error("FlowBasedIngressBindHelper is not initialized");
+ }
+ return flowBasedIngressServicesRemovable;
+ }
+
+ public static void clearFlowBasedIngressServicesConfigUnbindHelper() {
+ flowBasedIngressServicesRemovable = null;
+ }
+
+ public List<ListenableFuture<Void>> unbindService(InstanceIdentifier<BoundServices> instanceIdentifier,
+ BoundServices boundServiceOld) {
List<ListenableFuture<Void>> futures = new ArrayList<>();
+ DataBroker dataBroker = interfaceMgrProvider.getDataBroker();
String interfaceName =
InstanceIdentifier.keyOf(instanceIdentifier.firstIdentifierOf(ServicesInfo.class)).getInterfaceName();
Class<? extends ServiceModeBase> serviceMode = InstanceIdentifier.keyOf(instanceIdentifier.firstIdentifierOf(ServicesInfo.class)).getServiceMode();
package org.opendaylight.genius.interfacemanager.servicebindings.flowbased.listeners;
import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.genius.datastoreutils.AsyncDataTreeChangeListenerBase;
import org.opendaylight.genius.datastoreutils.DataStoreJobCoordinator;
-import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedServicesConfigBindHelper;
-import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedServicesConfigUnbindHelper;
+import org.opendaylight.genius.interfacemanager.InterfacemgrProvider;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedEgressServicesConfigBindHelper;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedEgressServicesConfigUnbindHelper;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedIngressServicesConfigBindHelper;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedIngressServicesConfigUnbindHelper;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesAddable;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesRemovable;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesRendererFactory;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceBindings;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public class FlowBasedServicesConfigListener extends AsyncDataTreeChangeListenerBase<BoundServices, FlowBasedServicesConfigListener> {
private static final Logger LOG = LoggerFactory.getLogger(FlowBasedServicesConfigListener.class);
- private DataBroker dataBroker;
+ private InterfacemgrProvider interfacemgrProvider;
- public FlowBasedServicesConfigListener(final DataBroker dataBroker) {
+ public FlowBasedServicesConfigListener(InterfacemgrProvider interfacemgrProvider) {
super(BoundServices.class, FlowBasedServicesConfigListener.class);
- this.dataBroker = dataBroker;
+ this.interfacemgrProvider = interfacemgrProvider;
+ initializeFlowBasedServiceHelpers(interfacemgrProvider);
}
+ private void initializeFlowBasedServiceHelpers(InterfacemgrProvider interfaceMgrProvider) {
+ FlowBasedIngressServicesConfigBindHelper.intitializeFlowBasedIngressServicesConfigAddHelper(interfaceMgrProvider);
+ FlowBasedIngressServicesConfigUnbindHelper.intitializeFlowBasedIngressServicesConfigRemoveHelper(interfaceMgrProvider);
+ FlowBasedEgressServicesConfigBindHelper.intitializeFlowBasedEgressServicesConfigAddHelper(interfaceMgrProvider);
+ FlowBasedEgressServicesConfigUnbindHelper.intitializeFlowBasedEgressServicesConfigRemoveHelper(interfaceMgrProvider);
+ }
@Override
protected InstanceIdentifier<BoundServices> getWildCardPath() {
return InstanceIdentifier.create(ServiceBindings.class).child(ServicesInfo.class)
String interfaceName = InstanceIdentifier.keyOf(key.firstIdentifierOf(ServicesInfo.class)).getInterfaceName();
LOG.info("Service Binding Entry removed for Interface: {}, Data: {}",
interfaceName, boundServiceOld);
-
+ Class<? extends ServiceModeBase> serviceMode = InstanceIdentifier.keyOf(key.firstIdentifierOf(ServicesInfo.class)).getServiceMode();
+ FlowBasedServicesRemovable flowBasedServicesRemovable = FlowBasedServicesRendererFactory.getFlowBasedServicesRendererFactory(serviceMode).
+ getFlowBasedServicesRemoveRenderer();
DataStoreJobCoordinator coordinator = DataStoreJobCoordinator.getInstance();
- RendererConfigRemoveWorker configWorker = new RendererConfigRemoveWorker(key, boundServiceOld);
+ RendererConfigRemoveWorker configWorker = new RendererConfigRemoveWorker(flowBasedServicesRemovable, key, boundServiceOld);
coordinator.enqueueJob(interfaceName, configWorker);
}
String interfaceName = InstanceIdentifier.keyOf(key.firstIdentifierOf(ServicesInfo.class)).getInterfaceName();
LOG.info("Service Binding Entry created for Interface: {}, Data: {}",
interfaceName, boundServicesNew);
+ Class<? extends ServiceModeBase> serviceMode = InstanceIdentifier.keyOf(key.firstIdentifierOf(ServicesInfo.class)).getServiceMode();
+ FlowBasedServicesAddable flowBasedServicesAddable = FlowBasedServicesRendererFactory.
+ getFlowBasedServicesRendererFactory(serviceMode).getFlowBasedServicesAddRenderer();
DataStoreJobCoordinator coordinator = DataStoreJobCoordinator.getInstance();
- RendererConfigAddWorker configWorker = new RendererConfigAddWorker(key, boundServicesNew);
+ RendererConfigAddWorker configWorker = new RendererConfigAddWorker(flowBasedServicesAddable, key, boundServicesNew);
coordinator.enqueueJob(interfaceName, configWorker);
}
}
private class RendererConfigAddWorker implements Callable<List<ListenableFuture<Void>>> {
+ FlowBasedServicesAddable flowBasedServicesAddable;
InstanceIdentifier<BoundServices> instanceIdentifier;
BoundServices boundServicesNew;
- public RendererConfigAddWorker(InstanceIdentifier<BoundServices> instanceIdentifier,
+ public RendererConfigAddWorker(FlowBasedServicesAddable flowBasedServicesAddable,
+ InstanceIdentifier<BoundServices> instanceIdentifier,
BoundServices boundServicesNew) {
+ this.flowBasedServicesAddable = flowBasedServicesAddable;
this.instanceIdentifier = instanceIdentifier;
this.boundServicesNew = boundServicesNew;
}
@Override
public List<ListenableFuture<Void>> call() throws Exception {
- return FlowBasedServicesConfigBindHelper.bindService(instanceIdentifier,
- boundServicesNew, dataBroker);
+ return flowBasedServicesAddable.bindService(instanceIdentifier,
+ boundServicesNew);
}
}
private class RendererConfigRemoveWorker implements Callable<List<ListenableFuture<Void>>> {
+ FlowBasedServicesRemovable flowBasedServicesRemovable;
InstanceIdentifier<BoundServices> instanceIdentifier;
BoundServices boundServicesNew;
- public RendererConfigRemoveWorker(InstanceIdentifier<BoundServices> instanceIdentifier,
- BoundServices boundServicesNew) {
+ public RendererConfigRemoveWorker(FlowBasedServicesRemovable flowBasedServicesRemovable,
+ InstanceIdentifier<BoundServices> instanceIdentifier,
+ BoundServices boundServicesNew) {
+ this.flowBasedServicesRemovable = flowBasedServicesRemovable;
this.instanceIdentifier = instanceIdentifier;
this.boundServicesNew = boundServicesNew;
}
@Override
public List<ListenableFuture<Void>> call() throws Exception {
- return FlowBasedServicesConfigUnbindHelper.unbindService(instanceIdentifier,
- boundServicesNew, dataBroker);
+ return flowBasedServicesRemovable.unbindService(instanceIdentifier,
+ boundServicesNew);
}
}
}
\ No newline at end of file
import org.opendaylight.genius.datastoreutils.DataStoreJobCoordinator;
import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.statehelpers.FlowBasedServicesStateBindHelper;
import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.statehelpers.FlowBasedServicesStateUnbindHelper;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
protected void remove(InstanceIdentifier<Interface> key, Interface interfaceStateOld) {
LOG.debug("Received interface state remove event for {}", interfaceStateOld.getName());
DataStoreJobCoordinator coordinator = DataStoreJobCoordinator.getInstance();
- RendererStateInterfaceUnbindWorker stateUnbindWorker =
- new RendererStateInterfaceUnbindWorker(interfaceStateOld);
- coordinator.enqueueJob(interfaceStateOld.getName(), stateUnbindWorker);
+ for(Object serviceMode : FlowBasedServicesUtils.SERVICE_MODE_MAP.values()) {
+ RendererStateInterfaceUnbindWorker stateUnbindWorker =
+ new RendererStateInterfaceUnbindWorker((Class<? extends ServiceModeBase>) serviceMode, interfaceStateOld);
+ coordinator.enqueueJob(interfaceStateOld.getName(), stateUnbindWorker);
+ }
}
@Override
}
LOG.debug("Received interface state add event for {}", interfaceStateNew.getName());
DataStoreJobCoordinator coordinator = DataStoreJobCoordinator.getInstance();
- RendererStateInterfaceBindWorker stateBindWorker = new RendererStateInterfaceBindWorker(interfaceStateNew);
- coordinator.enqueueJob(interfaceStateNew.getName(), stateBindWorker);
+ for(Object serviceMode : FlowBasedServicesUtils.SERVICE_MODE_MAP.values()) {
+ RendererStateInterfaceBindWorker stateBindWorker = new RendererStateInterfaceBindWorker((Class<? extends ServiceModeBase>) serviceMode, interfaceStateNew);
+ coordinator.enqueueJob(interfaceStateNew.getName(), stateBindWorker);
+ }
}
@Override
Interface iface;
Class<? extends ServiceModeBase> serviceMode;
- public RendererStateInterfaceBindWorker(Interface iface) {
+ public RendererStateInterfaceBindWorker(Class<? extends ServiceModeBase> serviceMode,
+ Interface iface) {
+ this.serviceMode = serviceMode;
this.iface = iface;
}
Interface iface;
Class<? extends ServiceModeBase> serviceMode;
- public RendererStateInterfaceUnbindWorker(Interface iface) {
+ public RendererStateInterfaceUnbindWorker(Class<? extends ServiceModeBase> serviceMode,
+ Interface iface) {
+ this.serviceMode = serviceMode;
this.iface = iface;
}
--- /dev/null
+/*
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities;
+
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedEgressServicesConfigBindHelper;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedEgressServicesConfigUnbindHelper;
+
+public class FlowBasedEgressServicesRendererFactory extends FlowBasedServicesRendererFactory{
+ private static FlowBasedEgressServicesRendererFactory egressServicesRendererFactory = new FlowBasedEgressServicesRendererFactory();
+
+ @Override
+ public FlowBasedServicesAddable getFlowBasedServicesAddRenderer() {
+ return FlowBasedEgressServicesConfigBindHelper.getFlowBasedEgressServicesAddHelper();
+ }
+
+ @Override
+ public FlowBasedServicesRemovable getFlowBasedServicesRemoveRenderer() {
+ return FlowBasedEgressServicesConfigUnbindHelper.getFlowBasedEgressServicesRemoveHelper();
+ }
+
+ public static FlowBasedServicesRendererFactory getFlowBasedServicesRendererFactory() {
+ return egressServicesRendererFactory;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities;
+
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedIngressServicesConfigBindHelper;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedIngressServicesConfigUnbindHelper;
+
+public class FlowBasedIngressServicesRendererFactory extends FlowBasedServicesRendererFactory{
+ private static FlowBasedServicesRendererFactory flowBasedServicesRendererFactory = new FlowBasedIngressServicesRendererFactory();
+
+ @Override
+ public FlowBasedServicesAddable getFlowBasedServicesAddRenderer() {
+ return FlowBasedIngressServicesConfigBindHelper.getFlowBasedIngressServicesAddHelper();
+ }
+
+ @Override
+ public FlowBasedServicesRemovable getFlowBasedServicesRemoveRenderer() {
+ return FlowBasedIngressServicesConfigUnbindHelper.getFlowBasedIngressServicesRemoveHelper();
+ }
+
+ public static FlowBasedServicesRendererFactory getFlowBasedServicesRendererFactory() {
+ return flowBasedServicesRendererFactory;
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+import java.util.List;
+
+public interface FlowBasedServicesAddable {
+ public List<ListenableFuture<Void>> bindService(InstanceIdentifier<BoundServices> instanceIdentifier,
+ BoundServices boundServiceNew);
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities;
+
+import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+import java.util.List;
+
+public interface FlowBasedServicesRemovable {
+ public List<ListenableFuture<Void>> unbindService(InstanceIdentifier<BoundServices> instanceIdentifier,
+ BoundServices boundServiceNew);
+}
--- /dev/null
+/*
+ * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeIngress;
+
+public abstract class FlowBasedServicesRendererFactory {
+ public abstract FlowBasedServicesAddable getFlowBasedServicesAddRenderer();
+ public abstract FlowBasedServicesRemovable getFlowBasedServicesRemoveRenderer();
+
+ public static FlowBasedServicesRendererFactory getFlowBasedServicesRendererFactory(Class<? extends ServiceModeBase> serviceMode) {
+ if (ServiceModeIngress.class.equals(serviceMode)) {
+ return FlowBasedIngressServicesRendererFactory.getFlowBasedServicesRendererFactory();
+ }
+ return FlowBasedEgressServicesRendererFactory.getFlowBasedServicesRendererFactory();
+ }
+
+}
package org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities;
import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableBiMap;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteMetadataCase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeGre;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeVxlan;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.*;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceBindings;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.StypeOpenflow;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfoKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlan;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeBase;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeGre;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeVxlan;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class FlowBasedServicesUtils {
private static final Logger LOG = LoggerFactory.getLogger(FlowBasedServicesUtils.class);
+ public enum ServiceMode {
+ INGRESS,
+ EGRESS;
+ }
+
+ public static final ImmutableBiMap SERVICE_MODE_MAP =
+ new ImmutableBiMap.Builder<ServiceMode, Class<? extends ServiceModeBase>>()
+ .put(ServiceMode.EGRESS, ServiceModeEgress.class)
+ .put(ServiceMode.INGRESS, ServiceModeIngress.class)
+ .build();
+
public static ServicesInfo getServicesInfoForInterface(String interfaceName, Class<? extends ServiceModeBase> serviceMode,
DataBroker dataBroker) {
ServicesInfoKey servicesInfoKey = new ServicesInfoKey(interfaceName,serviceMode);
import com.google.common.base.Optional;
import com.google.common.util.concurrent.Futures;
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker.DataChangeScope;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.dom.store.impl.DataChangeListenerRegistration;
import org.opendaylight.genius.interfacemanager.IfmUtil;
-import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedServicesConfigBindHelper;
-import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedServicesConfigUnbindHelper;
+import org.opendaylight.genius.interfacemanager.InterfacemgrProvider;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedIngressServicesConfigBindHelper;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.confighelpers.FlowBasedIngressServicesConfigUnbindHelper;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesAddable;
+import org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesRemovable;
import org.opendaylight.genius.mdsalutil.*;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlan;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeIngress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceBindings;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfoKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServicesKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.TunnelTypeGre;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
ServicesInfo servicesInfoUnbind = null;
StypeOpenflow stypeOpenflow = null;
InstanceIdentifier<Interface> interfaceInstanceIdentifier = null;
+ InstanceIdentifier<ServicesInfo> servicesInfoInstanceIdentifier = null;
InstanceIdentifier<Flow> flowInstanceId = null;
Flow ingressFlow = null;
Instruction instruction = null;
short key = 0;
int ifIndexval = 100;
- @Mock DataBroker dataBroker;
- @Mock ListenerRegistration<DataChangeListener> dataChangeListenerRegistration;
- @Mock ReadOnlyTransaction mockReadTx;
- @Mock WriteTransaction mockWriteTx;
+ DataBroker dataBroker;
+ ListenerRegistration<DataChangeListener> dataChangeListenerRegistration;
+ InterfacemgrProvider interfacemgrProvider;
+ ReadOnlyTransaction mockReadTx;
+ WriteTransaction mockWriteTx;
- FlowBasedServicesConfigBindHelper bindHelper;
- FlowBasedServicesConfigUnbindHelper unbindHelper;
+ FlowBasedServicesAddable flowBasedServicesAddable;
+ FlowBasedServicesRemovable flowBasedServicesRemovable;
@Before
public void setUp() throws Exception {
+ setupMocks();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ FlowBasedIngressServicesConfigBindHelper.clearFlowBasedIngressServicesConfigAddHelper();
+ FlowBasedIngressServicesConfigUnbindHelper.clearFlowBasedIngressServicesConfigUnbindHelper();
+ }
+ private void setupMocks(){
+ interfacemgrProvider = mock(InterfacemgrProvider.class);
+ dataBroker = mock(DataBroker.class);
+ mockReadTx = mock(ReadOnlyTransaction.class);
+ mockWriteTx = mock(WriteTransaction.class);
+ dataChangeListenerRegistration = mock(DataChangeListenerRegistration.class);
when(dataBroker.registerDataChangeListener(
any(LogicalDatastoreType.class),
any(InstanceIdentifier.class),
any(DataChangeListener.class),
any(DataChangeScope.class)))
.thenReturn(dataChangeListenerRegistration);
- setupMocks();
- }
-
- private void setupMocks(){
+ when(interfacemgrProvider.getDataBroker()).thenReturn(dataBroker);
+ when(dataBroker.newReadOnlyTransaction()).thenReturn(mockReadTx);
+ when(dataBroker.newWriteOnlyTransaction()).thenReturn(mockWriteTx);
+ FlowBasedIngressServicesConfigBindHelper.intitializeFlowBasedIngressServicesConfigAddHelper(interfacemgrProvider);
+ FlowBasedIngressServicesConfigUnbindHelper.intitializeFlowBasedIngressServicesConfigRemoveHelper(interfacemgrProvider);
+ flowBasedServicesAddable = FlowBasedIngressServicesConfigBindHelper.getFlowBasedIngressServicesAddHelper();
+ flowBasedServicesRemovable = FlowBasedIngressServicesConfigUnbindHelper.getFlowBasedIngressServicesRemoveHelper();
interfaceEnabled = InterfaceManagerTestUtil.buildInterface(InterfaceManagerTestUtil.interfaceName, "Test Vlan Interface1",true,L2vlan.class,dpId);
nodeConnectorId = InterfaceManagerTestUtil.buildNodeConnectorId(dpId, portNum);
stypeOpenflow.getFlowCookie(), matches, instructionList);
FlowKey flowKey = new FlowKey(new FlowId(ingressFlow.getId()));
flowInstanceId = InterfaceManagerTestUtil.getFlowInstanceIdentifier(dpId,ingressFlow.getTableId(),flowKey);
-
- when(dataBroker.newReadOnlyTransaction()).thenReturn(mockReadTx);
- when(dataBroker.newWriteOnlyTransaction()).thenReturn(mockWriteTx);
+ servicesInfoInstanceIdentifier = InterfaceManagerTestUtil.buildIngressServiceInfoInstanceIdentifier(InterfaceManagerTestUtil.interfaceName);
}
@Test
- public void testConfigBindSingleService(){
-
+ public void testConfigUnbindSingleService(){
Optional<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface> expectedStateInterface = Optional.of(stateInterface);
Optional<Interface> expectedInterface = Optional.of(interfaceEnabled);
Optional<ServicesInfo>expectedservicesInfo = Optional.of(servicesInfo);
- ServicesInfoKey servicesInfoKey = new ServicesInfoKey(InterfaceManagerTestUtil.interfaceName, ServiceModeIngress.class);
- InstanceIdentifier.InstanceIdentifierBuilder<ServicesInfo> servicesInfoIdentifierBuilder =
- InstanceIdentifier.builder(ServiceBindings.class).child(ServicesInfo.class, servicesInfoKey);
-
-
doReturn(Futures.immediateCheckedFuture(expectedStateInterface)).when(mockReadTx).read(
LogicalDatastoreType.OPERATIONAL,interfaceStateIdentifier);
doReturn(Futures.immediateCheckedFuture(expectedInterface)).when(mockReadTx).read(
LogicalDatastoreType.CONFIGURATION, interfaceInstanceIdentifier);
doReturn(Futures.immediateCheckedFuture(expectedservicesInfo)).when(mockReadTx).read(
- LogicalDatastoreType.CONFIGURATION, servicesInfoIdentifierBuilder.build());
+ LogicalDatastoreType.CONFIGURATION,servicesInfoInstanceIdentifier);
- bindHelper.bindService(boundServicesIid,boundServiceNew,dataBroker);
+ flowBasedServicesRemovable.unbindService(boundServicesIid,boundServiceNew);
- verify(mockWriteTx).put(LogicalDatastoreType.CONFIGURATION,flowInstanceId,ingressFlow, true);
+ verify(mockWriteTx).delete(LogicalDatastoreType.CONFIGURATION,flowInstanceId);
}
@Test
- public void testConfigUnbindSingleService(){
-
+ public void testConfigBindSingleService(){
Optional<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface> expectedStateInterface = Optional.of(stateInterface);
Optional<Interface> expectedInterface = Optional.of(interfaceEnabled);
- Optional<ServicesInfo>expectedservicesInfo = Optional.of(servicesInfoUnbind);
-
- ServicesInfoKey servicesInfoKey = new ServicesInfoKey(InterfaceManagerTestUtil.interfaceName, ServiceModeIngress.class);
- InstanceIdentifier.InstanceIdentifierBuilder<ServicesInfo> servicesInfoIdentifierBuilder =
- InstanceIdentifier.builder(ServiceBindings.class).child(ServicesInfo.class, servicesInfoKey);
+ Optional<ServicesInfo>expectedservicesInfo = Optional.of(servicesInfo);
doReturn(Futures.immediateCheckedFuture(expectedStateInterface)).when(mockReadTx).read(
LogicalDatastoreType.OPERATIONAL,interfaceStateIdentifier);
doReturn(Futures.immediateCheckedFuture(expectedInterface)).when(mockReadTx).read(
LogicalDatastoreType.CONFIGURATION, interfaceInstanceIdentifier);
doReturn(Futures.immediateCheckedFuture(expectedservicesInfo)).when(mockReadTx).read(
- LogicalDatastoreType.CONFIGURATION,servicesInfoIdentifierBuilder.build());
+ LogicalDatastoreType.CONFIGURATION, servicesInfoInstanceIdentifier);
- unbindHelper.unbindService(boundServicesIid,boundServiceNew,dataBroker);
+ flowBasedServicesAddable.bindService(boundServicesIid,boundServiceNew);
- verify(mockWriteTx).delete(LogicalDatastoreType.CONFIGURATION,flowInstanceId);
+ verify(mockWriteTx).put(LogicalDatastoreType.CONFIGURATION,flowInstanceId,ingressFlow, true);
}
}
\ No newline at end of file
lowerlayerIfList.add(boundService);
interfaceStateIdentifier = IfmUtil.buildStateInterfaceId(interfaceEnabled.getName());
servicesInfo = InterfaceManagerTestUtil.buildServicesInfo(InterfaceManagerTestUtil.interfaceName,servicesInfoKey,lowerlayerIfList);
-
String flowRef = InterfaceManagerTestUtil.buildflowRef(dpId, InterfaceManagerTestUtil.interfaceName, boundService.getServiceName(), boundService.getServicePriority());
List<Instruction> instructionList = boundService.getAugmentation(StypeOpenflow.class).getInstruction();
String serviceRef = boundService.getServiceName();
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.*;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.Options;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.OptionsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.OptionsKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceTypeFlowBased;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.StypeOpenflow;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.StypeOpenflowBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfoBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.ServicesInfoKey;
return builder.build();
}
+ public static InstanceIdentifier<ServicesInfo> buildIngressServiceInfoInstanceIdentifier(String interfaceName){
+ ServicesInfoKey servicesInfoKey = new ServicesInfoKey(interfaceName, ServiceModeIngress.class);
+ InstanceIdentifier.InstanceIdentifierBuilder<ServicesInfo> servicesInfoIdentifierBuilder =
+ InstanceIdentifier.builder(ServiceBindings.class).child(ServicesInfo.class, servicesInfoKey);
+ return servicesInfoIdentifierBuilder.build();
+ }
+
public static BoundServices buildBoundServices(String servicename, short servicepriority, BoundServicesKey boundServicesKey, StypeOpenflow stypeOpenflow){
BoundServicesBuilder builder = new BoundServicesBuilder().setServiceName(servicename).setKey(boundServicesKey).setServicePriority(servicepriority)
.setServiceType(ServiceTypeFlowBased.class).addAugmentation(StypeOpenflow.class,stypeOpenflow);
updateHelper.updateState(fcNodeConnectorId, alivenessMonitorService, dataBroker, InterfaceManagerTestUtil.interfaceName, fcNodeConnectorNew, fcNodeConnectorOld);
- verify(mockWriteTx).merge(LogicalDatastoreType.OPERATIONAL,interfaceStateIdentifier,parentInterface);
+ verify(mockWriteTx).merge(LogicalDatastoreType.OPERATIONAL,interfaceStateIdentifier,parentInterface, false);
}
}
\ No newline at end of file