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 java.io.DataInput;
11 import java.io.IOException;
12 import org.opendaylight.controller.cluster.access.ABIVersion;
13 import org.opendaylight.controller.cluster.access.concepts.RequestSuccess;
14 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
17 * Abstract base class for {@link RequestSuccess}es involving specific transaction. This class is visible outside of
18 * this package solely for the ability to perform a unified instanceof check.
20 * @param <T> Message type
22 public abstract class TransactionSuccess<T extends TransactionSuccess<T>>
23 extends RequestSuccess<TransactionIdentifier, T> {
24 interface SerialForm<T extends TransactionSuccess<T>> extends RequestSuccess.SerialForm<TransactionIdentifier, T> {
26 default TransactionIdentifier readTarget(final DataInput in) throws IOException {
27 return TransactionIdentifier.readFrom(in);
32 private static final long serialVersionUID = 1L;
34 TransactionSuccess(final TransactionIdentifier identifier, final long sequence) {
35 super(identifier, sequence);
38 TransactionSuccess(final T success, final ABIVersion version) {
39 super(success, version);
43 protected abstract SerialForm<T> externalizableProxy(ABIVersion version);