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 akka.actor.ActorRef;
11 import com.google.common.annotations.Beta;
12 import org.opendaylight.controller.cluster.access.ABIVersion;
13 import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
14 import org.opendaylight.controller.cluster.access.concepts.Request;
15 import org.opendaylight.controller.cluster.access.concepts.RequestException;
18 * Abstract base class for {@link Request}s involving specific local history. This class is visible outside of this
19 * package solely for the ability to perform a unified instanceof check.
21 * @author Robert Varga
23 * @param <T> Message type
26 public abstract class LocalHistoryRequest<T extends LocalHistoryRequest<T>> extends Request<LocalHistoryIdentifier, T> {
27 private static final long serialVersionUID = 1L;
29 LocalHistoryRequest(final LocalHistoryIdentifier target, final long sequence, final ActorRef replyTo) {
30 super(target, sequence, replyTo);
33 LocalHistoryRequest(final T request, final ABIVersion version) {
34 super(request, version);
38 public final LocalHistoryFailure toRequestFailure(final RequestException cause) {
39 return new LocalHistoryFailure(getTarget(), getSequence(), cause);
43 protected abstract AbstractLocalHistoryRequestProxy<T> externalizableProxy(final ABIVersion version);