Deprecate ManagedNewTransactionRunner et al. 48/91848/2
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 4 Aug 2020 11:15:45 +0000 (13:15 +0200)
committerHema Gopalakrishnan <hema.gopalkrishnan@ericsson.com>
Wed, 12 Aug 2020 18:37:40 +0000 (18:37 +0000)
ManagedNewTransactionRunner is exposed from mdsal-binding-util,
deprecate its old genius incarnation to guide migration.

JIRA: GENIUS-295
Change-Id: I8ed236164469dfeb0be3e295b68f8982c15bb06e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
mdsalutil/mdsalutil-api/pom.xml
mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/infra/Datastore.java
mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/infra/ManagedNewTransactionRunner.java
mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/infra/ManagedNewTransactionRunnerImpl.java
mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/infra/ManagedTransactionChain.java
mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/infra/ManagedTransactionFactory.java
mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/infra/RetryingManagedNewTransactionRunner.java
mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/infra/TransactionAdapter.java
mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/infra/TypedReadTransaction.java
mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/infra/TypedReadWriteTransaction.java
mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/infra/TypedWriteTransaction.java

index cd5615a7ab230dc301680fa6acbc228b176ad0ec..cd67b202d5df3de18e7d074ae3640c083bf32372 100644 (file)
@@ -150,6 +150,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <groupId>org.opendaylight.mdsal</groupId>
       <artifactId>mdsal-binding-spi</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.mdsal</groupId>
+      <artifactId>mdsal-binding-util</artifactId>
+    </dependency>
     <dependency>
       <groupId>com.google.truth</groupId>
       <artifactId>truth</artifactId>
index 847e6d469f6486dfeebfefbd3cce0790fcfc13cd..f95eef86f7eb547e73522c6ec7d95e8753248ee7 100644 (file)
@@ -11,7 +11,10 @@ import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 
 /**
  * Strongly-typed representation of a datastore (configuration or operational).
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.util.Datastore} instead.
  */
+@Deprecated(forRemoval = true)
 public abstract class Datastore {
 
     /** Class representing the configuration datastore. */
index ded965af3de968d677f0a288ab47b28eeac529f6..5c3487d988e695cc949daf7ea8fd5b720b9c7698 100644 (file)
@@ -30,8 +30,11 @@ import org.opendaylight.mdsal.binding.api.WriteTransaction;
  * <p>This should typically be used (only) directly in code which really must be creating its own new transactions,
  * such as RPC entry points, or background jobs.  Other lower level code "behind" such entry points should
  * just get handed over the transaction provided by this API.
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner} instead.
  */
 @Beta
+@Deprecated(forRemoval = true)
 public interface ManagedNewTransactionRunner extends ManagedTransactionFactory {
 
     /**
index 4fa293a1d7c265492015f503b78ea96d409bdf19..978de5866a1891d40ac19f2c0a8a370f6326dd35 100644 (file)
@@ -31,8 +31,11 @@ import org.slf4j.LoggerFactory;
  * Implementation of {@link ManagedNewTransactionRunner}. This is based on {@link ManagedTransactionFactoryImpl} but
  * re-implements operations based on (read-)write transactions to cancel transactions which don't end up making any
  * changes to the datastore.
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl} instead.
  */
 @Beta
+@Deprecated(forRemoval = true)
 // Do *NOT* mark this as @Singleton, because users choose Impl; and as long as this in API, because of https://wiki.opendaylight.org/view/BestPractices/DI_Guidelines#Nota_Bene
 public class ManagedNewTransactionRunnerImpl extends ManagedTransactionFactoryImpl
         implements ManagedNewTransactionRunner {
index 00b4e09f35706b11581056de32ac17066c596ec8..e77699bca9b4b4b877f7e55a23ddd01b4d9df073 100644 (file)
@@ -10,6 +10,10 @@ package org.opendaylight.genius.infra;
 /**
  * Managed transaction chains provide managed semantics around transaction chains, <em>i.e.</em> chains which provide
  * transactions which are automatically submitted or cancelled.
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.util.ManagedTransactionChain} instead.
  */
+@Deprecated
 public interface ManagedTransactionChain extends ManagedTransactionFactory {
+
 }
index 45644ba18ecfabdbe6510c87643f73b2848ed560..1cf72c58f2043a22d4b49b40eed2b4368c88f272 100644 (file)
@@ -24,7 +24,10 @@ import org.opendaylight.mdsal.binding.api.WriteTransaction;
 /**
  * Managed transaction factories provide managed transactions, <em>i.e.</em> transactions which are automatically
  * submitted or cancelled (write) or closed (read).
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.util.ManagedTransactionFactory} instead.
  */
+@Deprecated(forRemoval = true)
 public interface ManagedTransactionFactory {
     /**
      * Invokes a function with a <b>NEW</b> {@link TypedReadTransaction}, and ensures that that transaction is closed.
index d2dc96709dfd0c5afb4670daee96c3091c364e63..7f282206fcee7b52357a72f9e5bc8cba7082a493 100644 (file)
@@ -41,8 +41,10 @@ import org.opendaylight.mdsal.common.api.ReadFailedException;
  * another {@link Executor} to be used for the retries by using the alternative constructor.
  *
  * @author Michael Vorburger.ch &amp; Stephen Kitt
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.util.RetryingManagedNewTransactionRunner} instead.
  */
 @Beta
+@Deprecated
 // Do *NOT* mark this as @Singleton, because users choose Impl; and as long as this in API, because of https://wiki.opendaylight.org/view/BestPractices/DI_Guidelines#Nota_Bene
 public class RetryingManagedNewTransactionRunner extends RetryingManagedNewTransactionRunnerImpl {
 
index c3f893d1f3f727711c495768479255cebfc70b4e..9cb6268b56eaed301942140a30f9d9ffb2b9b2f8 100644 (file)
@@ -24,8 +24,10 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
  * <p>The adapted transactions maintain the following constraints: they cannot be cancelled or
  * submitted (only the transaction manager can do this), and they cannot access a logical datastore
  * other than the one they were created for.
+ *
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.util.TransactionAdapter} instead.
  */
-@Deprecated
+@Deprecated(forRemoval = true)
 public final class TransactionAdapter {
     private TransactionAdapter() {
 
index fce59a627a8d84c0383e0e9bc1499ac638567e29..2097c6537b6bf6fc77d30d4f0189781484df0e9e 100644 (file)
@@ -15,7 +15,6 @@ import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
-
 /**
  * Read transaction which is specific to a single logical datastore (configuration or operational). Designed for use
  * with {@link ManagedNewTransactionRunner} (it doesn’t support explicit cancel or commit operations).
@@ -23,7 +22,9 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
  * @see ReadTransaction
  *
  * @param <D> The logical datastore handled by the transaction.
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.util.TypedReadTransaction} instead.
  */
+@Deprecated(forRemoval = true)
 public interface TypedReadTransaction<D extends Datastore>
         extends Transaction {
     /**
index a3cee1ca3cdfdf7e39b0be51ae2fd1d9a1eb59ab..810daf1a35b60b0b615903c834ed4427789058a3 100644 (file)
@@ -13,7 +13,9 @@ package org.opendaylight.genius.infra;
  *
  * @param <D> The logical datastore handled by the transaction.
  * @see org.opendaylight.mdsal.binding.api.ReadWriteTransaction
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction} instead.
  */
+@Deprecated(forRemoval = true)
 public interface TypedReadWriteTransaction<D extends Datastore>
         extends TypedReadTransaction<D>, TypedWriteTransaction<D> {
 }
index 37a5cfcdbd4c395a6f35c8dea99d65f38a1b71d6..2c301a28b8096883be8c3d1163c8786465fbbd4d 100644 (file)
@@ -19,7 +19,9 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
  *
  * @param <D> The logical datastore handled by the transaction.
  * @see WriteTransaction
+ * @deprecated Use {@link org.opendaylight.mdsal.binding.util.TypedWriteTransaction} instead.
  */
+@Deprecated(forRemoval = true)
 public interface TypedWriteTransaction<D extends Datastore> extends
         Transaction {
     /**