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 static java.util.Objects.requireNonNull;
12 import java.io.IOException;
13 import java.io.ObjectInputStream;
14 import java.io.ObjectOutputStream;
15 import java.io.ObjectStreamException;
16 import java.util.Optional;
17 import org.opendaylight.controller.cluster.access.ABIVersion;
18 import org.opendaylight.controller.cluster.access.concepts.SliceableMessage;
19 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
20 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
23 * Successful reply to an {@link ReadTransactionRequest}. It indicates presence of requested data via
26 public final class ReadTransactionSuccess extends TransactionSuccess<ReadTransactionSuccess>
27 implements SliceableMessage {
29 private static final long serialVersionUID = 1L;
31 private final Optional<NormalizedNode> data;
33 private ReadTransactionSuccess(final ReadTransactionSuccess request, final ABIVersion version) {
34 super(request, version);
38 public ReadTransactionSuccess(final TransactionIdentifier identifier, final long sequence,
39 final Optional<NormalizedNode> data) {
40 super(identifier, sequence);
41 this.data = requireNonNull(data);
44 public Optional<NormalizedNode> getData() {
49 protected RTS externalizableProxy(final ABIVersion version) {
54 protected ReadTransactionSuccess cloneAsVersion(final ABIVersion version) {
55 return new ReadTransactionSuccess(this, version);
59 private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException {
64 private void readObjectNoData() throws ObjectStreamException {
69 private void writeObject(final ObjectOutputStream stream) throws IOException {