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