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