Switch to use PayloadVersion.CHLORINE_SR2
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / persisted / PurgeLocalHistoryPayload.java
index d440910943d213e57cd45037e29593bec864c130..a9e4557eced0c010e77a9821c76e7ddd0f1e2e95 100644 (file)
@@ -12,6 +12,7 @@ import com.google.common.io.ByteStreams;
 import java.io.DataInput;
 import java.io.IOException;
 import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
+import org.opendaylight.controller.cluster.raft.persisted.LegacySerializable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -21,8 +22,20 @@ import org.slf4j.LoggerFactory;
  *
  * @author Robert Varga
  */
-public final class PurgeLocalHistoryPayload extends AbstractIdentifiablePayload<LocalHistoryIdentifier> {
+public sealed class PurgeLocalHistoryPayload extends AbstractIdentifiablePayload<LocalHistoryIdentifier> {
+    @Deprecated(since = "7.0.0", forRemoval = true)
+    private static final class Magnesium extends PurgeLocalHistoryPayload implements LegacySerializable {
+        @java.io.Serial
+        private static final long serialVersionUID = 1L;
+
+        Magnesium(final LocalHistoryIdentifier historyId, final byte[] serialized) {
+            super(historyId, serialized);
+        }
+    }
+
+    @Deprecated(since = "7.0.0", forRemoval = true)
     private static final class Proxy extends AbstractProxy<LocalHistoryIdentifier> {
+        @java.io.Serial
         private static final long serialVersionUID = 1L;
 
         // checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
@@ -32,10 +45,6 @@ public final class PurgeLocalHistoryPayload extends AbstractIdentifiablePayload<
             // For Externalizable
         }
 
-        Proxy(final byte[] serialized) {
-            super(serialized);
-        }
-
         @Override
         protected LocalHistoryIdentifier readIdentifier(final DataInput in) throws IOException {
             return LocalHistoryIdentifier.readFrom(in);
@@ -44,13 +53,14 @@ public final class PurgeLocalHistoryPayload extends AbstractIdentifiablePayload<
         @Override
         protected PurgeLocalHistoryPayload createObject(final LocalHistoryIdentifier identifier,
                 final byte[] serialized) {
-            return new PurgeLocalHistoryPayload(identifier, serialized);
+            return new Magnesium(identifier, serialized);
         }
     }
 
     private static final Logger LOG = LoggerFactory.getLogger(PurgeLocalHistoryPayload.class);
+    @java.io.Serial
     private static final long serialVersionUID = 1L;
-    private static final int PROXY_SIZE = externalizableProxySize(Proxy::new);
+    private static final int PROXY_SIZE = externalizableProxySize(PH::new);
 
     PurgeLocalHistoryPayload(final LocalHistoryIdentifier historyId, final byte[] serialized) {
         super(historyId, serialized);
@@ -70,8 +80,8 @@ public final class PurgeLocalHistoryPayload extends AbstractIdentifiablePayload<
     }
 
     @Override
-    protected Proxy externalizableProxy(final byte[] serialized) {
-        return new Proxy(serialized);
+    protected PH externalizableProxy(final byte[] serialized) {
+        return new PH(serialized);
     }
 
     @Override