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 org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
16 * Externalizable proxy for use with {@link ExistsTransactionSuccess}. It implements the initial (Boron) serialization
19 * @author Robert Varga
21 final class ExistsTransactionSuccessProxyV1 extends AbstractTransactionSuccessProxy<ExistsTransactionSuccess> {
22 private static final long serialVersionUID = 1L;
23 private boolean exists;
25 // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
26 // be able to create instances via reflection.
27 @SuppressWarnings("checkstyle:RedundantModifier")
28 public ExistsTransactionSuccessProxyV1() {
32 ExistsTransactionSuccessProxyV1(final ExistsTransactionSuccess request) {
34 this.exists = request.getExists();
38 public void writeExternal(final ObjectOutput out) throws IOException {
39 super.writeExternal(out);
40 out.writeBoolean(exists);
44 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
45 super.readExternal(in);
46 exists = in.readBoolean();
50 protected ExistsTransactionSuccess createSuccess(final TransactionIdentifier target, final long sequence) {
51 return new ExistsTransactionSuccess(target, sequence, exists);