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 com.google.common.annotations.Beta;
13 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
14 import java.util.Optional;
15 import org.opendaylight.controller.cluster.access.ABIVersion;
16 import org.opendaylight.controller.cluster.access.concepts.SliceableMessage;
17 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
18 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
21 * Successful reply to an {@link ReadTransactionRequest}. It indicates presence of requested data via
24 * @author Robert Varga
27 @SuppressFBWarnings("SE_BAD_FIELD")
28 public final class ReadTransactionSuccess extends TransactionSuccess<ReadTransactionSuccess>
29 implements SliceableMessage {
30 private static final long serialVersionUID = 1L;
31 private final Optional<NormalizedNode<?, ?>> data;
33 public ReadTransactionSuccess(final TransactionIdentifier identifier, final long sequence,
34 final Optional<NormalizedNode<?, ?>> data) {
35 super(identifier, sequence);
36 this.data = requireNonNull(data);
39 public Optional<NormalizedNode<?, ?>> getData() {
44 protected AbstractTransactionSuccessProxy<ReadTransactionSuccess> externalizableProxy(final ABIVersion version) {
45 return new ReadTransactionSuccessProxyV1(this);
49 protected ReadTransactionSuccess cloneAsVersion(final ABIVersion version) {