Bump upstream SNAPSHOTS
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / commands / LocalHistoryRequest.java
index c74711618cd9533b23119ff50b5ba3feb402eaf4..33d04850fb91d01a524a7f17ffc12820445e392a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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,
@@ -9,6 +9,7 @@ package org.opendaylight.controller.cluster.access.commands;
 
 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;
@@ -28,6 +29,7 @@ public abstract class LocalHistoryRequest<T extends LocalHistoryRequest<T>> exte
 
     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) {
@@ -40,5 +42,5 @@ public abstract class LocalHistoryRequest<T extends LocalHistoryRequest<T>> exte
     }
 
     @Override
-    protected abstract AbstractLocalHistoryRequestProxy<T> externalizableProxy(final ABIVersion version);
+    protected abstract AbstractLocalHistoryRequestProxy<T> externalizableProxy(ABIVersion version);
 }