Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / CommitTransaction.java
index 14187139aafefd1758dd0dff444882b1ae4c54c9..bd80287ae9c187bdb8e2d30127cd0b74adac8654 100644 (file)
@@ -5,16 +5,29 @@
  * 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.cluster.datastore.messages;
 
-import org.opendaylight.controller.protobuff.messages.cohort3pc.ThreePhaseCommitCohortMessages;
+import com.google.common.base.Preconditions;
+import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
+
+@Deprecated(since = "9.0.0", forRemoval = true)
+public final class CommitTransaction extends AbstractThreePhaseCommitMessage {
+    @java.io.Serial
+    private static final long serialVersionUID = 1L;
+
+    public CommitTransaction() {
+    }
+
+    public CommitTransaction(final TransactionIdentifier transactionID, final short version) {
+        super(transactionID, version);
+    }
 
-public class CommitTransaction implements SerializableMessage {
-  public static Class SERIALIZABLE_CLASS = ThreePhaseCommitCohortMessages.CommitTransaction.class;
+    public static CommitTransaction fromSerializable(final Object serializable) {
+        Preconditions.checkArgument(serializable instanceof CommitTransaction);
+        return (CommitTransaction)serializable;
+    }
 
-  @Override
-  public Object toSerializable() {
-    return  ThreePhaseCommitCohortMessages.CommitTransaction.newBuilder().build();
-  }
+    public static boolean isSerializedType(final Object message) {
+        return message instanceof CommitTransaction;
+    }
 }