+
+ private class NormalizedDataModification extends AbstractDataModification<InstanceIdentifier, CompositeNode> {
+
+ private final Object identifier;
+ private TransactionStatus status;
+
+ public NormalizedDataModification(DataModification<InstanceIdentifier, CompositeNode> original) {
+ super(getDelegate());
+ identifier = original;
+ status = TransactionStatus.NEW;
+ }
+
+ /**
+ *
+ * Ensures all subpaths are removed - this currently does slow lookup in
+ * all keys.
+ *
+ * @param entry
+ */
+ public void deepRemoveOperationalData(InstanceIdentifier entry) {
+ Iterable<InstanceIdentifier> paths = getOperationalSubpaths(entry);
+ removeOperationalData(entry);
+ for (InstanceIdentifier potential : paths) {
+ removeOperationalData(potential);
+ }
+ }
+
+ public void deepRemoveConfigurationData(InstanceIdentifier entry) {
+ Iterable<InstanceIdentifier> paths = getConfigurationSubpaths(entry);
+ removeConfigurationData(entry);
+ for (InstanceIdentifier potential : paths) {
+ removeConfigurationData(potential);
+ }
+ }
+
+ @Override
+ public Object getIdentifier() {
+ return this.identifier;
+ }
+
+ @Override
+ public TransactionStatus getStatus() {
+ return status;
+ }
+
+ @Override
+ public Future<RpcResult<TransactionStatus>> commit() {
+ throw new UnsupportedOperationException("Commit should not be invoked on this");
+ }
+
+ @Override
+ protected CompositeNode mergeConfigurationData(InstanceIdentifier path, CompositeNode stored,
+ CompositeNode modified) {
+ return mergeData(path, stored, modified, true);
+ }
+
+ @Override
+ protected CompositeNode mergeOperationalData(InstanceIdentifier path, CompositeNode stored,
+ CompositeNode modified) {
+ return mergeData(path, stored, modified, false);
+ }
+ }
+