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 com.google.common.base.Preconditions;
12 import java.io.Serial;
13 import org.opendaylight.controller.cluster.access.ABIVersion;
14 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
17 * A blank transaction request. This is used to provide backfill requests in converted retransmit scenarios, such as
18 * when a initial request to a transaction (such as a {@link ReadTransactionRequest}) is satisfied by the backend
19 * before the need to replay the transaction to a different remote backend.
21 * @author Robert Varga
23 public final class IncrementTransactionSequenceRequest extends
24 AbstractReadTransactionRequest<IncrementTransactionSequenceRequest> {
26 private static final long serialVersionUID = 1L;
28 private final long increment;
30 public IncrementTransactionSequenceRequest(final TransactionIdentifier identifier, final long sequence,
31 final ActorRef replyTo, final boolean snapshotOnly, final long increment) {
32 super(identifier, sequence, replyTo, snapshotOnly);
33 Preconditions.checkArgument(increment >= 0);
34 this.increment = increment;
38 * Return the sequence increment beyond this request's sequence.
40 * @return Sequence increment, guaranteed to be non-negative.
42 public long getIncrement() {
47 protected IncrementTransactionSequenceRequestProxyV1 externalizableProxy(final ABIVersion version) {
48 return new IncrementTransactionSequenceRequestProxyV1(this);
52 protected IncrementTransactionSequenceRequest cloneAsVersion(final ABIVersion targetVersion) {