X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=dom%2Fmdsal-dom-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fdom%2Fapi%2FDOMDataTreeCommitCohort.java;h=9760a8e7a30e6d56ae447a10dfcfba6119518a5b;hb=9e344b9902099daf029a8e9ea42727760b7b2a9e;hp=8bf594db4e40024cc32cc36ae6294120cf13cad2;hpb=00451c01a40bbe7d98bc787adffbc2c6343d9947;p=mdsal.git diff --git a/dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMDataTreeCommitCohort.java b/dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMDataTreeCommitCohort.java index 8bf594db4e..9760a8e7a3 100644 --- a/dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMDataTreeCommitCohort.java +++ b/dom/mdsal-dom-api/src/main/java/org/opendaylight/mdsal/dom/api/DOMDataTreeCommitCohort.java @@ -7,109 +7,109 @@ */ package org.opendaylight.mdsal.dom.api; +import static java.util.Objects.requireNonNull; + import com.google.common.annotations.Beta; -import com.google.common.util.concurrent.CheckedFuture; -import javax.annotation.Nonnull; +import com.google.common.util.concurrent.FluentFuture; +import java.util.Collection; +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; /** - * * Commit cohort participating in commit of data modification, which can validate data tree * modifications, with option to reject supplied modification, and with callbacks describing state * of commit. * *
+ * If {@link DataValidationFailedException} is thrown by implementation, the commit of the supplied data + * will be prevented, with the DataBroker transaction providing the thrown exception as the cause of failure. * - * Implementations SHOULD do processing fast, and are discouraged SHOULD NOT block on any - * external resources. - * - * Implementation MUST NOT access any data transaction related APIs during invocation of - * callback. Note that this may be enforced by some implementations of - * {@link DOMDataTreeCommitCohortRegistry} and such calls may fail. + *
+ * Note the implementations are expected to do validation and processing asynchronous. Implementations SHOULD do + * processing fast, and are discouraged from blocking on any external resources. Implementation MUST NOT access + * any data transaction related APIs during invocation of the callback. Note that this may be enforced by some + * implementations of {@link DOMDataTreeCommitCohortRegistry} and such calls may fail. * + *
* Implementation MAY opt-out from implementing other steps by returning
* {@link PostCanCommitStep#NOOP}. Otherwise implementation MUST return instance of
* {@link PostCanCommitStep}, which will be used to invoke
* {@link org.opendaylight.mdsal.common.api.PostPreCommitStep#commit()} or
- * {@link PostCanCommitStep#abort()} based on accepting data by data broker and or other commit
- * cohorts.
+ * {@link PostCanCommitStep#abort()} based on accepting data by data broker and or other commit cohorts.
*
* @param txId Transaction identifier. SHOULD be used only for reporting and correlation.
* Implementation MUST NOT use {@code txId} for validation.
- * @param candidate Data Tree candidate to be validated and committed.
+ * @param candidates Data Tree candidates to be validated and committed.
* @param ctx Schema Context to which Data Tree candidate should conform.
- * @return Checked future which will successfully complete with user-supplied implementation of
- * {@link PostCanCommitStep} if data are valid, or failed check future with
- * {@link DataValidationFailedException} if and only if provided
- * {@link DOMDataTreeCandidate} did not pass validation. Users are encouraged to use
+ * @return a FluentFuture which will successfully complete with the user-supplied implementation of
+ * {@link PostCanCommitStep} if all candidates are valid, or a failed future with a
+ * {@link DataValidationFailedException} if and only if a provided
+ * {@link DOMDataTreeCandidate} instance did not pass validation. Users are encouraged to use
* more specific subclasses of this exception to provide additional information about
* validation failure reason.
*/
- @Nonnull
- CheckedFuture