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.base.MoreObjects.ToStringHelper;
11 import org.opendaylight.controller.cluster.access.ABIVersion;
12 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
15 * Successful reply to an {@link ExistsTransactionRequest}. It indicates presence of requested data via
16 * {@link #getExists()}.
18 public final class ExistsTransactionSuccess extends TransactionSuccess<ExistsTransactionSuccess> {
20 private static final long serialVersionUID = 1L;
22 private final boolean exists;
24 private ExistsTransactionSuccess(final ExistsTransactionSuccess success, final ABIVersion version) {
25 super(success, version);
26 exists = success.exists;
29 public ExistsTransactionSuccess(final TransactionIdentifier target, final long sequence, final boolean exists) {
30 super(target, sequence);
34 public boolean getExists() {
39 protected ETS externalizableProxy(final ABIVersion version) {
44 protected ExistsTransactionSuccess cloneAsVersion(final ABIVersion version) {
45 return new ExistsTransactionSuccess(this, version);
49 protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
50 return super.addToStringAttributes(toStringHelper).add("exists", exists);