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 java.io.IOException;
11 import java.io.ObjectInput;
12 import java.io.ObjectOutput;
13 import java.io.Serial;
14 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
17 * Externalizable proxy for use with {@link ExistsTransactionSuccess}. It implements the initial (Boron) serialization
20 * @author Robert Varga
22 final class ExistsTransactionSuccessProxyV1 extends AbstractTransactionSuccessProxy<ExistsTransactionSuccess> {
24 private static final long serialVersionUID = 1L;
26 private boolean exists;
28 // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
29 // be able to create instances via reflection.
30 @SuppressWarnings("checkstyle:RedundantModifier")
31 public ExistsTransactionSuccessProxyV1() {
35 ExistsTransactionSuccessProxyV1(final ExistsTransactionSuccess request) {
37 exists = request.getExists();
41 public void writeExternal(final ObjectOutput out) throws IOException {
42 super.writeExternal(out);
43 out.writeBoolean(exists);
47 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
48 super.readExternal(in);
49 exists = in.readBoolean();
53 protected ExistsTransactionSuccess createSuccess(final TransactionIdentifier target, final long sequence) {
54 return new ExistsTransactionSuccess(target, sequence, exists);