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 org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
15 import org.opendaylight.yangtools.concepts.WritableObjects;
17 final class IncrementTransactionSequenceRequestProxyV1
18 extends AbstractReadTransactionRequestProxyV1<IncrementTransactionSequenceRequest> {
19 private long increment;
21 // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
22 // be able to create instances via reflection.
23 @SuppressWarnings("checkstyle:RedundantModifier")
24 public IncrementTransactionSequenceRequestProxyV1() {
28 IncrementTransactionSequenceRequestProxyV1(final IncrementTransactionSequenceRequest request) {
30 this.increment = request.getIncrement();
34 public void writeExternal(final ObjectOutput out) throws IOException {
35 super.writeExternal(out);
36 WritableObjects.writeLong(out, increment);
40 public void readExternal(final ObjectInput in) throws ClassNotFoundException, IOException {
41 super.readExternal(in);
42 increment = WritableObjects.readLong(in);
46 IncrementTransactionSequenceRequest createReadRequest(final TransactionIdentifier target, final long sequence,
47 final ActorRef replyToActor, final boolean snapshotOnly) {
48 return new IncrementTransactionSequenceRequest(target, sequence, replyToActor, snapshotOnly, increment);