X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-common-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fcommon%2Fapi%2Fdata%2FAsyncWriteTransaction.java;h=f7eae27320107ef6a90696ff73f2cf40b3c99fde;hb=bd165724c2279b280cb6ff20543f899f68e551c7;hp=e2734eaddc4845396e3d866dec8d918ac9fe4bca;hpb=3023dca88c440607b9c7a8e238ef9f77d3037292;p=controller.git 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 e2734eaddc..f7eae27320 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 @@ -53,13 +53,19 @@ public interface AsyncWriteTransaction

, D> extends AsyncTransa * {@link TransactionStatus#NEW} or {@link TransactionStatus#SUBMITED} * * Invoking cancel() on {@link TransactionStatus#FAILED} or - * {@link TransactionStatus#CANCELED} will have no effect. + * {@link TransactionStatus#CANCELED} will have no effect, and transaction + * is considered cancelled. * - * @throws IllegalStateException - * If transaction status is {@link TransactionStatus#COMMITED} + * Invoking cancel() on finished transaction (future returned by {@link #commit()} + * already completed with {@link TransactionStatus#COMMITED}) will always + * fail (return false). + * + * @return false if the task could not be cancelled, + * typically because it has already completed normally; + * true otherwise * */ - public void cancel(); + public boolean cancel(); /** * Store a piece of data at specified path. This acts as an add / replace @@ -141,20 +147,6 @@ public interface AsyncWriteTransaction

, D> extends AsyncTransa */ public void delete(LogicalDatastoreType store, P path); - /** - * - * Closes transaction and resources allocated to the transaction. - * - * This call does not change Transaction status. Client SHOULD explicitly - * {@link #commit()} or {@link #cancel()} transaction. - * - * @throws IllegalStateException - * if the transaction has not been updated by invoking - * {@link #commit()} or {@link #cancel()}. - */ - @Override - public void close(); - /** * Submits transaction to be applied to update logical data tree. *