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.DataInput;
12 import java.io.IOException;
13 import java.io.ObjectInput;
14 import java.io.ObjectOutput;
15 import java.io.Serial;
16 import org.opendaylight.controller.cluster.access.ABIVersion;
17 import org.opendaylight.controller.cluster.access.concepts.AbstractRequestProxy;
18 import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
21 * Externalizable proxy for use with {@link ConnectClientRequest}. It implements the initial (Boron) serialization
24 * @author Robert Varga
26 final class ConnectClientRequestProxyV1 extends AbstractRequestProxy<ClientIdentifier, ConnectClientRequest> {
28 private static final long serialVersionUID = 8439729661327852159L;
30 private ABIVersion minVersion;
31 private ABIVersion maxVersion;
33 // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
34 // be able to create instances via reflection.
35 @SuppressWarnings("checkstyle:RedundantModifier")
36 public ConnectClientRequestProxyV1() {
40 ConnectClientRequestProxyV1(final ConnectClientRequest request) {
42 minVersion = request.getMinVersion();
43 maxVersion = request.getMaxVersion();
47 public void writeExternal(final ObjectOutput out) throws IOException {
48 super.writeExternal(out);
49 minVersion.writeTo(out);
50 maxVersion.writeTo(out);
54 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
55 super.readExternal(in);
56 minVersion = ABIVersion.inexactReadFrom(in);
57 maxVersion = ABIVersion.inexactReadFrom(in);
61 protected ConnectClientRequest createRequest(final ClientIdentifier target, final long sequence,
62 final ActorRef replyTo) {
63 return new ConnectClientRequest(target, sequence, replyTo, minVersion, maxVersion);
67 protected ClientIdentifier readTarget(final DataInput in) throws IOException {
68 return ClientIdentifier.readFrom(in);