/*
- * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2016, 2017 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
import akka.actor.ActorRef;
import com.google.common.annotations.Beta;
+import com.google.common.base.Preconditions;
import org.opendaylight.controller.cluster.access.ABIVersion;
import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
import org.opendaylight.controller.cluster.access.concepts.Request;
public abstract class LocalHistoryRequest<T extends LocalHistoryRequest<T>> extends Request<LocalHistoryIdentifier, T> {
private static final long serialVersionUID = 1L;
- LocalHistoryRequest(final LocalHistoryIdentifier target, final ActorRef replyTo) {
- super(target, replyTo);
+ LocalHistoryRequest(final LocalHistoryIdentifier target, final long sequence, final ActorRef replyTo) {
+ super(target, sequence, replyTo);
+ Preconditions.checkArgument(target.getHistoryId() != 0, "History identifier must be non-zero");
}
LocalHistoryRequest(final T request, final ABIVersion version) {
@Override
public final LocalHistoryFailure toRequestFailure(final RequestException cause) {
- return new LocalHistoryFailure(getTarget(), cause);
+ return new LocalHistoryFailure(getTarget(), getSequence(), cause);
}
@Override
- protected abstract AbstractLocalHistoryRequestProxy<T> externalizableProxy(final ABIVersion version);
+ protected abstract AbstractLocalHistoryRequestProxy<T> externalizableProxy(ABIVersion version);
}