/*
- * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2015 - 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,
private IdManagerService idManager;
private AlivenessMonitorService alivenessMonitorService;
private IMdsalApiManager mdsalApiManager;
+ private static final int MAX_RETRIES = 3;
public InterfaceConfigListener(final DataBroker dataBroker, final IdManagerService idManager,
final AlivenessMonitorService alivenessMonitorService,
ParentRefs parentRefs = interfaceOld.getAugmentation(ParentRefs.class);
DataStoreJobCoordinator coordinator = DataStoreJobCoordinator.getInstance();
RendererConfigRemoveWorker configWorker = new RendererConfigRemoveWorker(key, interfaceOld, ifName, parentRefs);
- coordinator.enqueueJob(ifName, configWorker);
+ coordinator.enqueueJob(ifName, configWorker, MAX_RETRIES);
}
@Override
String ifNameNew = interfaceNew.getName();
DataStoreJobCoordinator coordinator = DataStoreJobCoordinator.getInstance();
RendererConfigUpdateWorker worker = new RendererConfigUpdateWorker(key, interfaceOld, interfaceNew, ifNameNew);
- coordinator.enqueueJob(ifNameNew, worker);
+ coordinator.enqueueJob(ifNameNew, worker, MAX_RETRIES);
}
@Override
}
DataStoreJobCoordinator coordinator = DataStoreJobCoordinator.getInstance();
RendererConfigAddWorker configWorker = new RendererConfigAddWorker(key, interfaceNew, parentRefs, ifName);
- coordinator.enqueueJob(ifName, configWorker);
+ coordinator.enqueueJob(ifName, configWorker, MAX_RETRIES);
}
private class RendererConfigAddWorker implements Callable<List<ListenableFuture<Void>>> {
/*
- * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2015 - 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,
@Override
protected AsyncDataBroker.DataChangeScope getDataChangeScope() {
- return AsyncDataBroker.DataChangeScope.BASE;
+ return AsyncDataBroker.DataChangeScope.ONE;
}
@Override
@Override
protected void update(InstanceIdentifier<OvsdbBridgeAugmentation> identifier, OvsdbBridgeAugmentation bridgeOld,
OvsdbBridgeAugmentation bridgeNew) {
- LOG.info("Received Update DataChange Notification for identifier: {}, ovsdbBridgeAugmentation old: {}, new: {}." +
- "No Action Performed.", identifier, bridgeOld, bridgeNew);
+ LOG.debug("Received Update DataChange Notification for identifier: {}, ovsdbBridgeAugmentation old: {}, new: {}.",
+ identifier, bridgeOld, bridgeNew);
+ if(bridgeOld.getDatapathId()== null && bridgeNew.getDatapathId()!= null){
+ DataStoreJobCoordinator jobCoordinator = DataStoreJobCoordinator.getInstance();
+ RendererStateAddWorker rendererStateAddWorker = new RendererStateAddWorker(identifier, bridgeNew);
+ jobCoordinator.enqueueJob(bridgeNew.getBridgeName().getValue() + bridgeNew.getDatapathId(), rendererStateAddWorker);
+ }
}
@Override
/*
- * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. and others. All rights reserved.
+ * Copyright (c) 2015 - 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,
WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
if (bridgeNew.getDatapathId() == null) {
- LOG.warn("DataPathId found as null for Bridge Augmentation: {}... retrying...", bridgeNew);
- Optional<OvsdbBridgeAugmentation> bridgeNodeOptional = IfmUtil.read(LogicalDatastoreType.OPERATIONAL, bridgeIid, dataBroker);
- if (bridgeNodeOptional.isPresent()) {
- bridgeNew = bridgeNodeOptional.get();
- }
- if (bridgeNew.getDatapathId() == null) {
- LOG.warn("DataPathId found as null again for Bridge Augmentation: {}. Bailing out.", bridgeNew);
- return futures;
- }
+ LOG.warn("DataPathId found as null for Bridge Augmentation: {}... returning...", bridgeNew);
+ return futures;
}
String bridgeName = bridgeNew.getBridgeName().getValue();
BigInteger dpnId = IfmUtil.getDpnId(bridgeNew.getDatapathId());
- if (dpnId == null) {
- LOG.warn("Got Null DPID for Bridge: {}", bridgeNew);
- return futures;
- }
-
// create bridge reference entry in interface meta operational DS
InterfaceMetaUtils.createBridgeRefEntry(dpnId, bridgeIid, writeTransaction);