Enabling Data Change Notifications for all nodes in cluster.
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / LeaderLocalDelegateFactory.java
index d33cebbebc2f7680dff2097f8b3ab3745f861c26..8ce28571ee16b22bca1d1a5a8d76e5c88dd51583 100644 (file)
@@ -19,8 +19,9 @@ import com.google.common.base.Preconditions;
  *
  * <D> delegate type
  * <M> message type
+ * <I> initial state type
  */
-abstract class LeaderLocalDelegateFactory<M, D> extends DelegateFactory<M, D> {
+abstract class LeaderLocalDelegateFactory<M, D, I> extends DelegateFactory<M, D, I> {
     private final Shard shard;
 
     protected LeaderLocalDelegateFactory(final Shard shard) {
@@ -59,8 +60,9 @@ abstract class LeaderLocalDelegateFactory<M, D> extends DelegateFactory<M, D> {
      * Invoked whenever the local shard's leadership role changes.
      *
      * @param isLeader true if the shard has become leader, false if it has
-     *                 become a follower.
+ *                 become a follower.
+     * @param hasLeader true if the shard knows about leader ID
      */
-    abstract void onLeadershipChange(boolean isLeader);
-    abstract void onMessage(M message, boolean isLeader);
+    abstract void onLeadershipChange(boolean isLeader, boolean hasLeader);
+    abstract void onMessage(M message, boolean isLeader, boolean hasLeader);
 }