Make DataTree take EffectiveModelContext
[yangtools.git] / yang / yang-data-api / src / main / java / org / opendaylight / yangtools / yang / data / api / schema / tree / DataTree.java
index 7b0ae040bf7d6d3cc9219a3c1c6be87d54e6fd9d..378b980dd91b726bbfe353aea5e0fd557709a511 100644 (file)
@@ -7,40 +7,34 @@
  */
 package org.opendaylight.yangtools.yang.data.api.schema.tree;
 
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
 /**
  * Interface representing a data tree which can be modified in an MVCC fashion.
  */
-public interface DataTree {
-    /**
-     * Take a read-only point-in-time snapshot of the tree.
-     *
-     * @return Data tree snapshot.
-     */
-    DataTreeSnapshot takeSnapshot();
-
+public interface DataTree extends DataTreeTip, ReadOnlyDataTree {
     /**
      * Make the data tree use a new schema context. The context will be used
      * only by subsequent operations.
      *
      * @param newSchemaContext new SchemaContext
      * @throws IllegalArgumentException if the new context is incompatible
+     * @throws NullPointerException if newSchemaContext is null
+     * @deprecated Prefer {@link #setEffectiveModelContext(EffectiveModelContext)}.
      */
+    @Deprecated
     void setSchemaContext(SchemaContext newSchemaContext);
 
     /**
-     * Validate whether a particular modification can be applied to the data tree.
-     */
-    void validate(DataTreeModification modification) throws DataValidationFailedException;
-
-    /**
-     * Prepare a modification for commit.
+     * Make the data tree use a new schema context. The context will be used
+     * only by subsequent operations.
      *
-     * @param modification
-     * @return candidate data tree
+     * @param newModelContext new EffectiveModelContext
+     * @throws IllegalArgumentException if the new context is incompatible
+     * @throws NullPointerException if newModelContext is null
      */
-    DataTreeCandidate prepare(DataTreeModification modification);
+    void setEffectiveModelContext(EffectiveModelContext newModelContext);
 
     /**
      * Commit a data tree candidate.