2 * Copyright (c) 2016 Cisco Systems, Inc. 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;
18 * Abstract base class for serialization proxies associated with {@link AbstractReadTransactionRequest}s. It implements
19 * the initial (Boron) serialization format.
21 * @author Robert Varga
23 * @param <T> Message type
25 abstract class AbstractReadTransactionRequestProxyV1<T extends AbstractReadTransactionRequest<T>>
26 extends AbstractTransactionRequestProxy<T> {
28 private static final long serialVersionUID = 1L;
30 private boolean snapshotOnly;
32 protected AbstractReadTransactionRequestProxyV1() {
36 AbstractReadTransactionRequestProxyV1(final T request) {
38 snapshotOnly = request.isSnapshotOnly();
42 public void writeExternal(final ObjectOutput out) throws IOException {
43 super.writeExternal(out);
44 out.writeBoolean(snapshotOnly);
48 public void readExternal(final ObjectInput in) throws ClassNotFoundException, IOException {
49 super.readExternal(in);
50 snapshotOnly = in.readBoolean();
54 protected final T createRequest(final TransactionIdentifier target, final long sequence, final ActorRef replyTo) {
55 return createReadRequest(target, sequence, replyTo, snapshotOnly);
58 @SuppressWarnings("checkstyle:hiddenField")
59 abstract T createReadRequest(TransactionIdentifier target, long sequence, ActorRef replyTo, boolean snapshotOnly);