2 * Copyright (c) 2017 Brocade Communications 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.datastore.messages;
10 import akka.actor.ActorRef;
11 import akka.actor.ActorSelection;
12 import java.util.Collection;
13 import org.opendaylight.controller.cluster.raft.client.messages.OnDemandRaftState;
16 * Extends OnDemandRaftState to add Shard state.
18 * @author Thomas Pantelis
20 public class OnDemandShardState extends OnDemandRaftState {
21 private Collection<ActorSelection> treeChangeListenerActors;
22 private Collection<ActorRef> commitCohortActors;
24 public Collection<ActorSelection> getTreeChangeListenerActors() {
25 return treeChangeListenerActors;
28 public Collection<ActorRef> getCommitCohortActors() {
29 return commitCohortActors;
32 public static Builder newBuilder() {
36 public static class Builder extends AbstractBuilder<Builder, OnDemandShardState> {
37 private final OnDemandShardState state = new OnDemandShardState();
40 protected OnDemandRaftState state() {
44 public Builder treeChangeListenerActors(Collection<ActorSelection> actors) {
45 state.treeChangeListenerActors = actors;
49 public Builder commitCohortActors(Collection<ActorRef> actors) {
50 state.commitCohortActors = actors;
55 public OnDemandShardState build() {