@Test public void testOnWrite() { when(rootNode.getModificationType()).thenReturn(DataObjectModification.ModificationType.WRITE); classifierListener.onDataTreeChanged(changes); verify(classifierListener).onWrite(rootNode, rootIdentifier); }
@Override protected void onWrite(DataObjectModification<ResolvedPolicy> rootNode, InstanceIdentifier<ResolvedPolicy> rootIdentifier) { ResolvedPolicy resolvedPolicy = rootNode.getDataAfter(); Map<InstanceIdentifier<Classifier>, Classifier> classifierByIid = resolveClassifiers(resolvedPolicy, rootIdentifier); for (Entry<InstanceIdentifier<Classifier>, Classifier> classifierEntry : classifierByIid.entrySet()) { LOG.trace("New classifier created: {}\n{}", classifierEntry.getKey(), classifierEntry.getValue()); ofStatsManager.pullStatsForClassifier(classifierEntry.getKey(), classifierEntry.getValue()); } }
ResolvedPolicyClassifierListener extends DataTreeChangeHandler<ResolvedPolicy> { @Override protected void onWrite(DataObjectModification<ResolvedPolicy> rootNode, InstanceIdentifier<ResolvedPolicy> rootIdentifier) { ResolvedPolicy resolvedPolicy = rootNode.getDataAfter(); Map<InstanceIdentifier<Classifier>, Classifier> classifierByIid = resolveClassifiers(resolvedPolicy, rootIdentifier); for (Entry<InstanceIdentifier<Classifier>, Classifier> classifierEntry : classifierByIid.entrySet()) { LOG.trace("New classifier created: {}\n{}", classifierEntry.getKey(), classifierEntry.getValue()); ofStatsManager.pullStatsForClassifier(classifierEntry.getKey(), classifierEntry.getValue()); } } }
ResolvedPolicyClassifierListener extends DataTreeChangeHandler<ResolvedPolicy> { @Override protected void onWrite(DataObjectModification<ResolvedPolicy> rootNode, InstanceIdentifier<ResolvedPolicy> rootIdentifier) { ResolvedPolicy resolvedPolicy = rootNode.getDataAfter(); Map<InstanceIdentifier<Classifier>, Classifier> classifierByIid = resolveClassifiers(resolvedPolicy, rootIdentifier); for (Entry<InstanceIdentifier<Classifier>, Classifier> classifierEntry : classifierByIid.entrySet()) { LOG.trace("New classifier created: {}\n{}", classifierEntry.getKey(), classifierEntry.getValue()); ofStatsManager.pullStatsForClassifier(classifierEntry.getKey(), classifierEntry.getValue()); } } ResolvedPolicyClassifierListener(DataBroker dataProvider, OFStatisticsManager ofStatsManager); }
ResolvedPolicyClassifierListener extends DataTreeChangeHandler<ResolvedPolicy> { @Override protected void onWrite(DataObjectModification<ResolvedPolicy> rootNode, InstanceIdentifier<ResolvedPolicy> rootIdentifier) { ResolvedPolicy resolvedPolicy = rootNode.getDataAfter(); Map<InstanceIdentifier<Classifier>, Classifier> classifierByIid = resolveClassifiers(resolvedPolicy, rootIdentifier); for (Entry<InstanceIdentifier<Classifier>, Classifier> classifierEntry : classifierByIid.entrySet()) { LOG.trace("New classifier created: {}\n{}", classifierEntry.getKey(), classifierEntry.getValue()); ofStatsManager.pullStatsForClassifier(classifierEntry.getKey(), classifierEntry.getValue()); } } ResolvedPolicyClassifierListener(DataBroker dataProvider, OFStatisticsManager ofStatsManager); static Map<InstanceIdentifier<Classifier>, Classifier> resolveClassifiers(ResolvedPolicy resolvedPolicy,
            InstanceIdentifier<ResolvedPolicy> resolvedPolicyIid); }
ResolvedPolicyClassifierListener extends DataTreeChangeHandler<ResolvedPolicy> { @Override protected void onWrite(DataObjectModification<ResolvedPolicy> rootNode, InstanceIdentifier<ResolvedPolicy> rootIdentifier) { ResolvedPolicy resolvedPolicy = rootNode.getDataAfter(); Map<InstanceIdentifier<Classifier>, Classifier> classifierByIid = resolveClassifiers(resolvedPolicy, rootIdentifier); for (Entry<InstanceIdentifier<Classifier>, Classifier> classifierEntry : classifierByIid.entrySet()) { LOG.trace("New classifier created: {}\n{}", classifierEntry.getKey(), classifierEntry.getValue()); ofStatsManager.pullStatsForClassifier(classifierEntry.getKey(), classifierEntry.getValue()); } } ResolvedPolicyClassifierListener(DataBroker dataProvider, OFStatisticsManager ofStatsManager); static Map<InstanceIdentifier<Classifier>, Classifier> resolveClassifiers(ResolvedPolicy resolvedPolicy,
            InstanceIdentifier<ResolvedPolicy> resolvedPolicyIid);  }