Add optional timeout parameter for backup rpc
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / client / messages / GetSnapshot.java
index d51f93f..c9bc2ed 100644 (file)
@@ -7,15 +7,25 @@
  */
 package org.opendaylight.controller.cluster.raft.client.messages;
 
  */
 package org.opendaylight.controller.cluster.raft.client.messages;
 
+import akka.util.Timeout;
+import java.util.Optional;
+
 /**
 /**
- * Internal client message to get a snapshot of the current state based on whether or not persistence is
- * enabled. Returns a {@link GetSnapshotReply} instance.
+ * Internal client message to get a snapshot of the current state based on whether or not persistence is enabled.
+ * Returns a {@link GetSnapshotReply} instance.
  *
  * @author Thomas Pantelis
  */
 public final class GetSnapshot {
  *
  * @author Thomas Pantelis
  */
 public final class GetSnapshot {
-    public static final GetSnapshot INSTANCE = new GetSnapshot();
+    public static final GetSnapshot INSTANCE = new GetSnapshot(null);
+
+    private final Timeout timeout;
+
+    public GetSnapshot(final Timeout timeout) {
+        this.timeout = timeout;
+    }
 
 
-    private GetSnapshot() {
+    public Optional<Timeout> getTimeout() {
+        return Optional.ofNullable(timeout);
     }
 }
     }
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.