2 * Copyright (c) 2022 PANTHEON.tech, 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 static com.google.common.base.Verify.verifyNotNull;
11 import static java.util.Objects.requireNonNull;
13 import java.io.IOException;
14 import java.io.ObjectInput;
15 import java.io.ObjectOutput;
16 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
19 * Externalizable proxy for use with {@link ExistsTransactionSuccess}. It implements the Chlorine SR2 serialization
22 final class ETS implements TransactionSuccess.SerialForm<ExistsTransactionSuccess> {
24 private static final long serialVersionUID = 1L;
26 private ExistsTransactionSuccess message;
28 @SuppressWarnings("checkstyle:RedundantModifier")
33 ETS(final ExistsTransactionSuccess message) {
34 this.message = requireNonNull(message);
38 public ExistsTransactionSuccess message() {
39 return verifyNotNull(message);
43 public void setMessage(final ExistsTransactionSuccess message) {
44 this.message = requireNonNull(message);
48 public void writeExternal(final ObjectOutput out, final ExistsTransactionSuccess msg) throws IOException {
49 out.writeBoolean(msg.getExists());
53 public ExistsTransactionSuccess readExternal(final ObjectInput in, final TransactionIdentifier target,
54 final long sequence) throws IOException {
55 return new ExistsTransactionSuccess(target, sequence, in.readBoolean());
59 public Object readResolve() {