2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.access.commands;
10 import akka.actor.ActorRef;
11 import java.io.IOException;
12 import java.io.ObjectInput;
13 import java.io.ObjectOutput;
14 import java.io.Serial;
15 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
16 import org.opendaylight.yangtools.concepts.WritableObjects;
18 final class IncrementTransactionSequenceRequestProxyV1
19 extends AbstractReadTransactionRequestProxyV1<IncrementTransactionSequenceRequest> {
21 private static final long serialVersionUID = -7345885599575376005L;
23 private long increment;
25 // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
26 // be able to create instances via reflection.
27 @SuppressWarnings("checkstyle:RedundantModifier")
28 public IncrementTransactionSequenceRequestProxyV1() {
32 IncrementTransactionSequenceRequestProxyV1(final IncrementTransactionSequenceRequest request) {
34 increment = request.getIncrement();
38 public void writeExternal(final ObjectOutput out) throws IOException {
39 super.writeExternal(out);
40 WritableObjects.writeLong(out, increment);
44 public void readExternal(final ObjectInput in) throws ClassNotFoundException, IOException {
45 super.readExternal(in);
46 increment = WritableObjects.readLong(in);
50 IncrementTransactionSequenceRequest createReadRequest(final TransactionIdentifier target, final long sequence,
51 final ActorRef replyToActor, final boolean snapshotOnly) {
52 return new IncrementTransactionSequenceRequest(target, sequence, replyToActor, snapshotOnly, increment);