X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fcommands%2FSkipTransactionsRequestV1.java;fp=opendaylight%2Fmd-sal%2Fcds-access-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fcommands%2FSkipTransactionsRequestV1.java;h=762289c0bc3687067fbd81d3114cf2ec151958f1;hb=d92bd0e575983b3d6a09a73089ef8f9c62f94eaa;hp=26d660f1d9d5580f46de0d41add9aaf9fe937970;hpb=e085f22bb1934959f9d6f7f4368c1afe964b1e07;p=controller.git diff --git a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/SkipTransactionsRequestV1.java b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/SkipTransactionsRequestV1.java index 26d660f1d9..762289c0bc 100644 --- a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/SkipTransactionsRequestV1.java +++ b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/SkipTransactionsRequestV1.java @@ -7,27 +7,15 @@ */ package org.opendaylight.controller.cluster.access.commands; -import akka.actor.ActorRef; -import com.google.common.collect.ImmutableList; -import com.google.common.primitives.UnsignedLong; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; -import java.io.Serial; -import java.util.List; -import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; -import org.opendaylight.yangtools.concepts.WritableObjects; - /** * Externalizable proxy for use with {@link SkipTransactionsRequest}. It implements the initial * (Phosphorus SR1) serialization format. */ -final class SkipTransactionsRequestV1 extends AbstractTransactionRequestProxy { - @Serial +final class SkipTransactionsRequestV1 extends AbstractTransactionRequestProxy + implements SkipTransactionsRequest.SerialForm { + @java.io.Serial private static final long serialVersionUID = -7493419007644462643L; - private List others; - // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to // be able to create instances via reflection. @SuppressWarnings("checkstyle:RedundantModifier") @@ -37,52 +25,5 @@ final class SkipTransactionsRequestV1 extends AbstractTransactionRequestProxybuilderWithExpectedSize(size); - int idx; - if (size % 2 != 0) { - builder.add(UnsignedLong.fromLongBits(WritableObjects.readLong(in))); - idx = 1; - } else { - idx = 0; - } - for (; idx < size; idx += 2) { - final byte hdr = WritableObjects.readLongHeader(in); - builder.add(UnsignedLong.fromLongBits(WritableObjects.readFirstLong(in, hdr))); - builder.add(UnsignedLong.fromLongBits(WritableObjects.readSecondLong(in, hdr))); - } - others = builder.build(); - } - - @Override - public void writeExternal(final ObjectOutput out) throws IOException { - super.writeExternal(out); - - final int size = others.size(); - out.writeInt(size); - - int idx; - if (size % 2 != 0) { - WritableObjects.writeLong(out, others.get(0).longValue()); - idx = 1; - } else { - idx = 0; - } - for (; idx < size; idx += 2) { - WritableObjects.writeLongs(out, others.get(idx).longValue(), others.get(idx + 1).longValue()); - } - } - - @Override - protected SkipTransactionsRequest createRequest(final TransactionIdentifier target, final long sequence, - final ActorRef replyToActor) { - return new SkipTransactionsRequest(target, sequence, replyToActor, others); } }