X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-common-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fcommon%2Fapi%2Fdata%2FDataCommitHandler.java;h=a9f02a8ee5ed13cac55a436311f1b556225703c0;hp=90de13d15e8229238f36c5ec59b1180babcff1ae;hb=805feca65ad7fa68cecaec1973f79a57f88e0b9c;hpb=9108efddf9a5f3e2c81202a17ccdeca22cb5ca09 diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataCommitHandler.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataCommitHandler.java index 90de13d15e..a9f02a8ee5 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataCommitHandler.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/DataCommitHandler.java @@ -7,31 +7,29 @@ */ package org.opendaylight.controller.md.sal.common.api.data; -import org.opendaylight.controller.sal.common.DataStoreIdentifier; -// FIXME: After 0.6 Release of YANGTools refactor to use Path marker interface for arguments. -// import org.opendaylight.yangtools.concepts.Path; +import org.opendaylight.yangtools.concepts.Path; import org.opendaylight.yangtools.yang.common.RpcResult; /** * Two phase commit handler (cohort) of the two-phase commit protocol of data. - * + * *

* The provider should expose the implementation of DataCommitHandler if it's * functionality depends on any subset of data stored in data repositories, in * order to participate in {@link DataBrokerService#commit(DataStoreIdentifier) * operation. - * + * *

* Operations of two-phase commit handlers should not change data in data store, * this is responsibility of the coordinator (broker or some component of the * broker). - * - * The commit handlers are responsible for changing the internal state of the - * provider to reflect the commited changes in data. - * + * + * Commit handlers are responsible for changing the internal state of the + * provider to reflect the committed changes in data. + * *

Two-phase commit

- * + * *

Commit Request Phase

- * + * *
    *
  1. Consumer edits data by invocation of * DataBrokerService.editCandidateData(DataStoreIdentifier, DataRoot) @@ -51,9 +49,9 @@ import org.opendaylight.yangtools.yang.common.RpcResult; *
*
  • Broker starts a commit finish phase * - * + * *

    Commit Finish Phase

    - * + * *
      *
    1. For each CommitTransaction from Commit Request phase *
        @@ -69,7 +67,7 @@ import org.opendaylight.yangtools.yang.common.RpcResult; *
      1. If error occured, the broker starts a commit rollback phase. * *
      - * + * *

      Commit Rollback Phase

      *
    2. For each DataCommitTransaction from Commit Request phase *
        @@ -78,43 +76,45 @@ import org.opendaylight.yangtools.yang.common.RpcResult; *
      1. The provider rollbacks a commit and returns an {@link RpcResult} of * rollback.
      *
    3. Broker returns a error result to the consumer. - * + * * @param

      Class representing a path * @param Superclass from which all data objects are derived from. + * @deprecated Replaced by {@link AsyncConfigurationCommitHandler} */ -public interface DataCommitHandler

      */,D> { +@Deprecated +public interface DataCommitHandler

      , D> { + - DataCommitTransaction requestCommit(DataModification modification); - public interface DataCommitTransaction

      */,D> { + public interface DataCommitTransaction

      , D> { DataModification getModification(); /** - * + * * Finishes a commit. - * + * * This callback is invoked by commit coordinator to finish commit action. - * + * * The implementation is required to finish transaction or return unsuccessful * rpc result if something went wrong. - * + * * The provider (commit handler) should apply all changes to its state * which are a result of data change- - * + * * @return */ RpcResult finish() throws IllegalStateException; /** * Rollbacks a commit. - * + * * This callback is invoked by commit coordinator to finish commit action. - * + * * The provider (commit handler) should rollback all changes to its state * which were a result of previous request commit. - * + * * @return * @throws IllegalStateException * If the method is invoked after {@link #finish()}