Fix DOMDataTreeCommitCohort 61/105061/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 4 Apr 2023 07:10:15 +0000 (09:10 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 11 Apr 2023 23:03:02 +0000 (23:03 +0000)
The cohort should be exposing EffectiveModelContext in order to provide
correct interactions with other utilities.

JIRA: MDSAL-822
Change-Id: I2b0a3ada8cb677cdbcf9c2fad0ca50d502f6d2e4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a706a8e41d9fc17d52f5623bef3042eefb8847cb)

binding/mdsal-binding-dom-adapter/src/main/java/org/opendaylight/mdsal/binding/dom/adapter/BindingDOMDataTreeCommitCohortAdapter.java
dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMDataTreeCommitCohort.java

index 695383c4d3cb823b8b14129b8e9eb2234d2f966a..f3f15b7aa3c27d319daf8c304d9ba4190b7b5de7 100644 (file)
@@ -16,7 +16,7 @@ import org.opendaylight.mdsal.common.api.PostCanCommitStep;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeCandidate;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeCommitCohort;
 import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 
 final class BindingDOMDataTreeCommitCohortAdapter<T extends DataObject>
         extends AbstractBindingAdapter<DataTreeCommitCohort<T>> implements DOMDataTreeCommitCohort {
@@ -26,7 +26,7 @@ final class BindingDOMDataTreeCommitCohortAdapter<T extends DataObject>
 
     @Override
     public FluentFuture<PostCanCommitStep> canCommit(final Object txId,
-            final SchemaContext ctx, final Collection<DOMDataTreeCandidate> candidates) {
+            final EffectiveModelContext ctx, final Collection<DOMDataTreeCandidate> candidates) {
         final Collection<DataTreeModification<T>> modifications = candidates.stream()
                 .map(candidate -> LazyDataTreeModification.<T>create(currentSerializer(), candidate))
                 .collect(Collectors.toList());
index 9760a8e7a30e6d56ae447a10dfcfba6119518a5b..cbe61124886a12cda4b506384e5042c30c7ae822 100644 (file)
@@ -16,7 +16,7 @@ import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.common.api.DataValidationFailedException;
 import org.opendaylight.mdsal.common.api.PostCanCommitStep;
 import org.opendaylight.yangtools.util.concurrent.ExceptionMapper;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 
 /**
  * Commit cohort participating in commit of data modification, which can validate data tree
@@ -31,7 +31,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
  *
  * <h2>Implementation requirements</h2>
  * <h3>Correctness assumptions</h3> Implementation SHOULD use only the {@link DOMDataTreeCandidate} instances and
- * provided {@link SchemaContext} for validation purposes.
+ * provided {@link EffectiveModelContext} for validation purposes.
  * Use of any other external mutable state is discouraged, implementation MUST NOT use any
  * transaction related APIs on same data broker / data store instance during invocation of
  * callbacks, except ones provided as argument. Note that this MAY BE enforced by some
@@ -40,7 +40,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
  * and such calls may fail.
  * <h3>Correct model usage</h3> If implementation is performing YANG-model driven validation
  * implementation SHOULD use provided schema context.
- * Any other instance of {@link SchemaContext} obtained by other means, may not be valid for the
+ * Any other instance of {@link EffectiveModelContext} obtained by other means, may not be valid for the
  * associated DOMDataTreeCandidates and it may lead to incorrect validation or processing of provided
  * data.
  * <h3>DataTreeCandidate assumptions</h3> Implementation SHOULD NOT make any assumptions on a
@@ -94,7 +94,7 @@ public interface DOMDataTreeCommitCohort {
      *         validation failure reason.
      */
     @NonNull FluentFuture<PostCanCommitStep> canCommit(@NonNull Object txId,
-            @NonNull SchemaContext ctx, @NonNull Collection<DOMDataTreeCandidate> candidates);
+            @NonNull EffectiveModelContext ctx, @NonNull Collection<DOMDataTreeCandidate> candidates);
 
     /**
      * An ExceptionMapper that translates an Exception to a DataValidationFailedException.