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<ActorSelection> dataChangeListenerActors;
23 private Collection<ActorRef> commitCohortActors;
25 public Collection<ActorSelection> getTreeChangeListenerActors() {
26 return treeChangeListenerActors;
29 public Collection<ActorSelection> getDataChangeListenerActors() {
30 return dataChangeListenerActors;
33 public Collection<ActorRef> getCommitCohortActors() {
34 return commitCohortActors;
37 public static Builder newBuilder() {
41 public static class Builder extends AbstractBuilder<Builder, OnDemandShardState> {
42 private final OnDemandShardState state = new OnDemandShardState();
45 protected OnDemandRaftState state() {
49 public Builder treeChangeListenerActors(Collection<ActorSelection> actors) {
50 state.treeChangeListenerActors = actors;
54 public Builder dataChangeListenerActors(Collection<ActorSelection> actors) {
55 state.dataChangeListenerActors = actors;
59 public Builder commitCohortActors(Collection<ActorRef> actors) {
60 state.commitCohortActors = actors;
65 public OnDemandShardState build() {