Merge "Bug 1106: Introduced TransactionCommitFailedException."
authorEd Warnicke <eaw@cisco.com>
Tue, 10 Jun 2014 14:06:58 +0000 (14:06 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 10 Jun 2014 14:06:58 +0000 (14:06 +0000)
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncWriteTransaction.java
opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionCommitFailedException.java [new file with mode: 0644]

index 2ce43b5f7c36d6a4146ed52b922f59b8db330743..82c48d2ddb27e657c12cb9c8f56f49997923b370 100644 (file)
@@ -110,8 +110,10 @@ public interface AsyncWriteTransaction<P extends Path<P>, D>  extends AsyncTrans
      * @param store Identifier of the store, where commit should occur.
      * @return Result of the Commit, containing success information or list of
      *         encountered errors, if commit was not successful. The Future
-     *         blocks until {@link TransactionStatus#COMMITED} or
-     *         {@link TransactionStatus#FAILED} is reached.
+     *         blocks until {@link TransactionStatus#COMMITED} is reached.
+     *         Future will fail with {@link TransactionCommitFailedException}
+     *         if Commit of this transaction failed.
+     *
      * @throws IllegalStateException if the transaction is not {@link TransactionStatus#NEW}
      */
     public ListenableFuture<RpcResult<TransactionStatus>> commit();
diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionCommitFailedException.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/TransactionCommitFailedException.java
new file mode 100644 (file)
index 0000000..f3c2e10
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.md.sal.common.api.data;
+
+/**
+ *
+ * Failed commit of asynchronous transaction
+ *
+ * This exception is raised and returned when transaction commit
+ * failed.
+ *
+ */
+public class TransactionCommitFailedException extends Exception {
+
+    private static final long serialVersionUID = -6138306275373237068L;
+
+    protected TransactionCommitFailedException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) {
+        super(message, cause, enableSuppression, writableStackTrace);
+    }
+
+    public TransactionCommitFailedException(final String message, final Throwable cause) {
+        super(message, cause);
+    }
+
+    public TransactionCommitFailedException(final String message) {
+        super(message);
+    }
+
+}