/**
* The purpose of this class is to eliminate boilerplate code used in most of
* {@link DataTreeChangeListener} implementations.
- *
+ *
* @param <T>
*/
public abstract class DataTreeChangeHandler<T extends DataObject> implements DataTreeChangeListener<T>, AutoCloseable {
/**
* Registers {@link DataTreeChangeListener} for {@code pointOfInterest} by using
* {@code dataProvider}
- *
+ *
* @param dataProvider cannot be {@code null}
* @param pointOfInterest cannot be {@code null}
* @throws NullPointerException if at least one paramter is {@code null}
onDelete(rootNode, rootIdentifier);
break;
case SUBTREE_MODIFIED:
- onSubreeModified(rootNode, rootIdentifier);
+ onSubtreeModified(rootNode, rootIdentifier);
break;
}
}
* Handles case where {@link DataObjectModification#getModificationType()} is
* {@link ModificationType#WRITE}. <br>
* <b>Parameters of this method are never {@code null}.</b>
- *
+ *
* @param rootNode represents {@link DataObjectModification} as result of
* {@link DataTreeModification#getRootNode()}
* @param rootIdentifier represents {@link InstanceIdentifier} obtained from result of
* Handles case where {@link DataObjectModification#getModificationType()} is
* {@link ModificationType#DELETE}. <br>
* <b>Parameters of this method are never {@code null}.</b>
- *
+ *
* @param rootNode represents {@link DataObjectModification} as result of
* {@link DataTreeModification#getRootNode()}
* @param rootIdentifier represents {@link InstanceIdentifier} obtained from result of
* Handles case where {@link DataObjectModification#getModificationType()} is
* {@link ModificationType#SUBTREE_MODIFIED}. <br>
* <b>Parameters of this method are never {@code null}.</b>
- *
+ *
* @param rootNode represents {@link DataObjectModification} as result of
* {@link DataTreeModification#getRootNode()}
* @param rootIdentifier represents {@link InstanceIdentifier} obtained from result of
* {@link DataTreeModification#getRootPath()}
*/
- protected abstract void onSubreeModified(DataObjectModification<T> rootNode, InstanceIdentifier<T> rootIdentifier);
+ protected abstract void onSubtreeModified(DataObjectModification<T> rootNode, InstanceIdentifier<T> rootIdentifier);
@Override
public void close() throws Exception {
@Override
protected void onWrite(DataObjectModification<ActionDefinition> rootNode,
InstanceIdentifier<ActionDefinition> rootIdentifier) {
- onSubreeModified(rootNode, rootIdentifier);
+ onSubtreeModified(rootNode, rootIdentifier);
}
@Override
}
@Override
- protected void onSubreeModified(DataObjectModification<ActionDefinition> rootNode,
+ protected void onSubtreeModified(DataObjectModification<ActionDefinition> rootNode,
InstanceIdentifier<ActionDefinition> rootIdentifier) {
ActionDefinition actionDefinitionAfter = checkNotNull(rootNode.getDataAfter());
Action ourAction = SubjectFeatures.getAction(actionDefinitionAfter.getId());
@Override
protected void onWrite(DataObjectModification<ClassifierDefinition> rootNode,
InstanceIdentifier<ClassifierDefinition> rootIdentifier) {
- onSubreeModified(rootNode, rootIdentifier);
+ onSubtreeModified(rootNode, rootIdentifier);
}
@Override
}
@Override
- protected void onSubreeModified(DataObjectModification<ClassifierDefinition> rootNode,
+ protected void onSubtreeModified(DataObjectModification<ClassifierDefinition> rootNode,
InstanceIdentifier<ClassifierDefinition> rootIdentifier) {
ClassifierDefinition classifierDefinitionAfter = checkNotNull(rootNode.getDataAfter());
Classifier ourClassifier = SubjectFeatures.getClassifier(classifierDefinitionAfter.getId());