X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fpersisted%2FCreateLocalHistoryPayload.java;h=928503a9fc78ce7f62cfd71a1b903800e56cc1a9;hb=HEAD;hp=76ea934cb42433c7ff833346e302e3a308f271c9;hpb=ac9b62ec80da4d68e5d867bde0ceaa73062de444;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CreateLocalHistoryPayload.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CreateLocalHistoryPayload.java index 76ea934cb4..928503a9fc 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CreateLocalHistoryPayload.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CreateLocalHistoryPayload.java @@ -9,7 +9,6 @@ package org.opendaylight.controller.cluster.datastore.persisted; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; -import java.io.DataInput; import java.io.IOException; import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier; import org.slf4j.Logger; @@ -21,34 +20,10 @@ import org.slf4j.LoggerFactory; * @author Robert Varga */ public final class CreateLocalHistoryPayload extends AbstractIdentifiablePayload { - private static final class Proxy extends AbstractProxy { - private static final long serialVersionUID = 1L; - - // checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't - // redundant. It is explicitly needed for Java serialization to be able to create instances via reflection. - @SuppressWarnings("checkstyle:RedundantModifier") - public Proxy() { - // For Externalizable - } - - Proxy(final byte[] serialized) { - super(serialized); - } - - @Override - protected LocalHistoryIdentifier readIdentifier(final DataInput in) throws IOException { - return LocalHistoryIdentifier.readFrom(in); - } - - @Override - protected CreateLocalHistoryPayload createObject(final LocalHistoryIdentifier identifier, - final byte[] serialized) { - return new CreateLocalHistoryPayload(identifier, serialized); - } - } - private static final Logger LOG = LoggerFactory.getLogger(CreateLocalHistoryPayload.class); + @java.io.Serial private static final long serialVersionUID = 1L; + private static final int PROXY_SIZE = externalizableProxySize(CH::new); CreateLocalHistoryPayload(final LocalHistoryIdentifier historyId, final byte[] serialized) { super(historyId, serialized); @@ -68,7 +43,12 @@ public final class CreateLocalHistoryPayload extends AbstractIdentifiablePayload } @Override - protected Proxy externalizableProxy(final byte[] serialized) { - return new Proxy(serialized); + protected CH externalizableProxy(final byte[] serialized) { + return new CH(serialized); + } + + @Override + protected int externalizableProxySize() { + return PROXY_SIZE; } }