/* * Copyright (c) 2017 Brocade Communications 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, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.controller.cluster.datastore.messages; import akka.actor.ActorRef; import akka.actor.ActorSelection; import java.util.Collection; import org.opendaylight.controller.cluster.raft.client.messages.OnDemandRaftState; /** * Extends OnDemandRaftState to add Shard state. * * @author Thomas Pantelis */ public class OnDemandShardState extends OnDemandRaftState { private Collection treeChangeListenerActors; private Collection dataChangeListenerActors; private Collection commitCohortActors; public Collection getTreeChangeListenerActors() { return treeChangeListenerActors; } public Collection getDataChangeListenerActors() { return dataChangeListenerActors; } public Collection getCommitCohortActors() { return commitCohortActors; } public static Builder newBuilder() { return new Builder(); } public static class Builder extends AbstractBuilder { private final OnDemandShardState state = new OnDemandShardState(); @Override protected OnDemandRaftState state() { return state; } public Builder treeChangeListenerActors(Collection actors) { state.treeChangeListenerActors = actors; return self(); } public Builder dataChangeListenerActors(Collection actors) { state.dataChangeListenerActors = actors; return self(); } public Builder commitCohortActors(Collection actors) { state.commitCohortActors = actors; return self(); } @Override public OnDemandShardState build() { return super.build(); } } }