import org.opendaylight.vpnservice.interfacemgr.renderer.ovs.confighelpers.OvsInterfaceConfigAddHelper;
import org.opendaylight.vpnservice.interfacemgr.renderer.ovs.confighelpers.OvsInterfaceConfigRemoveHelper;
import org.opendaylight.vpnservice.interfacemgr.renderer.ovs.confighelpers.OvsInterfaceConfigUpdateHelper;
+import org.opendaylight.vpnservice.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces;
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.vpnservice.alivenessmonitor.rev150629.AlivenessMonitorService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.idmanager.rev150403.IdManagerService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.vpnservice.interfacemgr.rev150331.ParentRefs;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
private static final Logger LOG = LoggerFactory.getLogger(InterfaceConfigListener.class);
private DataBroker dataBroker;
private IdManagerService idManager;
+ private AlivenessMonitorService alivenessMonitorService;
+ private IMdsalApiManager mdsalApiManager;
- public InterfaceConfigListener(final DataBroker dataBroker, final IdManagerService idManager) {
+ public InterfaceConfigListener(final DataBroker dataBroker, final IdManagerService idManager,
+ final AlivenessMonitorService alivenessMonitorService,
+ final IMdsalApiManager mdsalApiManager) {
super(Interface.class, InterfaceConfigListener.class);
this.dataBroker = dataBroker;
this.idManager = idManager;
+ this.alivenessMonitorService = alivenessMonitorService;
+ this.mdsalApiManager = mdsalApiManager;
}
@Override
String parentInterface = null;
ParentRefs parentRefs = interfaceOld.getAugmentation(ParentRefs.class);
- if (parentRefs != null) {
- parentInterface = parentRefs.getParentInterface();
+ /* parentInterface = parentRefs.getParentInterface();
if (parentInterface != null && !parentInterface.equals(ifName)) {
return;
}
if (parentRefs.getDatapathNodeIdentifier() == null) {
return;
}
- }
+ if(parentInterface == null){
+ LOG.error("parent interface not specified for {}",interfaceOld.getName());
+ }
+ }*/
DataStoreJobCoordinator coordinator = DataStoreJobCoordinator.getInstance();
RendererConfigRemoveWorker configWorker = new RendererConfigRemoveWorker(key, interfaceOld, ifName, parentRefs);
String ifNameNew = interfaceNew.getName();
String parentInterface = null;
- ParentRefs parentRefs = interfaceNew.getAugmentation(ParentRefs.class);
- if (parentRefs != null) {
- parentInterface = parentRefs.getParentInterface();
+ /*ParentRefs parentRefs = interfaceNew.getAugmentation(ParentRefs.class);
+ if (parentRefs == null) {
+ LOG.error("parent refs not specified for {}",interfaceNew.getName());
}
- if (parentInterface != null && !parentInterface.equals(ifNameNew)) {
+ if (parentInterface == null) {
+ LOG.error("parent interface not specified for {}",interfaceOld.getName());
return;
- }
+ }*/
DataStoreJobCoordinator coordinator = DataStoreJobCoordinator.getInstance();
RendererConfigUpdateWorker worker = new RendererConfigUpdateWorker(key, interfaceOld, interfaceNew, ifNameNew);
String parentInterface = null;
ParentRefs parentRefs = interfaceNew.getAugmentation(ParentRefs.class);
- if (parentRefs != null) {
- parentInterface = parentRefs.getParentInterface();
+ if (parentRefs == null) {
+ LOG.error("parent refs not specified for {}",interfaceNew.getName());
}
- if (parentInterface != null && !parentInterface.equals(ifName)) {
- return;
- }
+ /*if(parentInterface == null){
+ LOG.error("parent interface not specified for {}",interfaceNew.getName());
+ }*/
DataStoreJobCoordinator coordinator = DataStoreJobCoordinator.getInstance();
RendererConfigAddWorker configWorker = new RendererConfigAddWorker(key, interfaceNew, parentRefs, ifName);
public List<ListenableFuture<Void>> call() throws Exception {
// If another renderer(for eg : CSS) needs to be supported, check can be performed here
// to call the respective helpers.
- return OvsInterfaceConfigAddHelper.addConfiguration(dataBroker, parentRefs, interfaceNew, idManager);
+ return OvsInterfaceConfigAddHelper.addConfiguration(dataBroker, parentRefs, interfaceNew,
+ idManager, alivenessMonitorService, mdsalApiManager);
}
@Override
public List<ListenableFuture<Void>> call() throws Exception {
// If another renderer(for eg : CSS) needs to be supported, check can be performed here
// to call the respective helpers.
- return OvsInterfaceConfigUpdateHelper.updateConfiguration(dataBroker, idManager, interfaceNew, interfaceOld);
+ return OvsInterfaceConfigUpdateHelper.updateConfiguration(dataBroker, alivenessMonitorService, idManager,
+ mdsalApiManager, interfaceNew, interfaceOld);
}
@Override
public List<ListenableFuture<Void>> call() throws Exception {
// If another renderer(for eg : CSS) needs to be supported, check can be performed here
// to call the respective helpers.
- return OvsInterfaceConfigRemoveHelper.removeConfiguration(dataBroker, interfaceOld, idManager, parentRefs);
+ return OvsInterfaceConfigRemoveHelper.removeConfiguration(dataBroker, alivenessMonitorService,
+ interfaceOld, idManager, mdsalApiManager, parentRefs);
}
@Override