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%2FAsyncWriteTransaction.java;h=effeabefae89a69158d73028cc9467fb47f9a896;hp=e47b54a0a1e6e138292530994a57b539501fc1bb;hb=690b4c7632f05f7f1ba23e45ce2d00a2e82d22c1;hpb=17d82f582a6bc13c78be3b19954ff8c021180e93 diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncWriteTransaction.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncWriteTransaction.java index e47b54a0a1..effeabefae 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncWriteTransaction.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncWriteTransaction.java @@ -132,8 +132,6 @@ public interface AsyncWriteTransaction

, D> extends AsyncTransa *

* This call logically seals the transaction, which prevents the client from * further changing data tree using this transaction. Any subsequent calls to - * {@link #put(LogicalDatastoreType, Path, Object)}, - * {@link #merge(LogicalDatastoreType, Path, Object)} or * {@link #delete(LogicalDatastoreType, Path)} will fail with * {@link IllegalStateException}. * @@ -149,24 +147,24 @@ public interface AsyncWriteTransaction

, D> extends AsyncTransa * The effects of a successful commit of data depends on data change listeners * ({@link AsyncDataChangeListener}) and commit participants * ({@link AsyncConfigurationCommitHandler}) that are registered with the data broker. - *

+ * *

Example usage:

*
      *  private void doWrite( final int tries ) {
      *      WriteTransaction writeTx = dataBroker.newWriteOnlyTransaction();
      *
      *      MyDataObject data = ...;
-     *      InstanceIdentifier path = ...;
+     *      InstanceIdentifier<MyDataObject> path = ...;
      *      writeTx.put( LogicalDatastoreType.OPERATIONAL, path, data );
      *
-     *      Futures.addCallback( writeTx.submit(), new FutureCallback() {
+     *      Futures.addCallback( writeTx.submit(), new FutureCallback<Void>() {
      *          public void onSuccess( Void result ) {
      *              // succeeded
      *          }
      *
      *          public void onFailure( Throwable t ) {
      *              if( t instanceof OptimisticLockFailedException ) {
-     *                  if( ( tries - 1 ) > 0 ) {
+     *                  if( ( tries - 1 ) > 0 ) {
      *                      // do retry
      *                      doWrite( tries - 1 );
      *                  } else {
@@ -214,7 +212,7 @@ public interface AsyncWriteTransaction

, D> extends AsyncTransa * which are based on same initial state, Tx 1 completes successfully * before Tx 2 is submitted. * - * + *
* * * @@ -238,7 +236,7 @@ public interface AsyncWriteTransaction

, D> extends AsyncTransa * which are based on same initial state, Tx 1 completes successfully * before Tx 2 is submitted. * - *

Initial stateTx 1Tx 2Result
Emptyput(A,1)put(A,2)Tx 2 will fail, state is A=1
Emptyput(A,1)merge(A,2)A=2
+ *
* * *
Initial stateTx 1Tx 2Result
Emptyput(TOP,[])put(TOP,[])Tx 2 will fail, state is TOP=[]