import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.openflowplugin.applications.statistics.manager.StatNodeRegistration;
import org.opendaylight.openflowplugin.applications.statistics.manager.StatRpcMsgManager.TransactionCacheContainer;
import org.opendaylight.openflowplugin.applications.statistics.manager.StatisticsManager;
import org.opendaylight.openflowplugin.applications.statistics.manager.StatisticsManager.StatDataStoreOperation;
private final AtomicInteger unaccountedFlowsCounter = new AtomicInteger(0);
public StatListenCommitFlow (final StatisticsManager manager, final DataBroker db,
- final NotificationProviderService nps){
- super(manager, db, nps, Flow.class);
+ final NotificationProviderService nps,
+ final StatNodeRegistration nrm){
+ super(manager, db, nps, Flow.class,nrm);
}
@Override
if (( ! inputObj.isPresent()) || ( ! (inputObj.get() instanceof Table))) {
return;
}
+
+ if(!nodeRegistrationManager.isFlowCapableNodeOwner(nodeId)) { return; }
+
final Table table = (Table) inputObj.get();
final List<? extends TransactionAware> cacheNotifs = txContainer.get().getNotifications();
for (final TransactionAware notif : cacheNotifs) {
}
}
}
+
+ @Override
+ public UUID generatedUUIDForNode() {
+ return manager.getGeneratedUUIDForNode(getNodeIdentifier());
+ }
});
}
if (( ! txContainer.isPresent()) || txContainer.get().getNotifications() == null) {
return;
}
+ if(!nodeRegistrationManager.isFlowCapableNodeOwner(nodeId)) { return; }
+
final List<FlowAndStatisticsMapList> flowStats = new ArrayList<FlowAndStatisticsMapList>(10);
final InstanceIdentifier<Node> nodeIdent = InstanceIdentifier.create(Nodes.class)
.child(Node.class, new NodeKey(nodeId));
notifyToCollectNextStatistics(nodeIdent, transId);
}
+ @Override
+ public UUID generatedUUIDForNode() {
+ return manager.getGeneratedUUIDForNode(getNodeIdentifier());
+ }
+
});
}
* FIXME: CREATE BETTER KEY - for flow (MATCH is the problem)
*/
static String buildFlowIdOperKey(final FlowAndStatisticsMapList deviceFlow) {
- return new StringBuffer().append(deviceFlow.getMatch())
+ return new StringBuilder().append(deviceFlow.getMatch())
.append(deviceFlow.getPriority()).append(deviceFlow.getCookie().getValue()).toString();
}
final InstanceIdentifier<Flow> flowRef = tableRef.child(Flow.class, flowKey);
if (nodeDeleteMap != null && flowKey.getId().getValue().startsWith(ALIEN_SYSTEM_FLOW_ID)) {
final Integer lifeIndex = nodeDeleteMap.get(flowRef);
- if (lifeIndex > 0) {
+ if (lifeIndex != null && lifeIndex > 0) {
break;
} else {
nodeDeleteMap.remove(flowRef);