2 * Copyright (c) 2015 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 com.google.common.base.Optional;
11 import com.google.common.base.Preconditions;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.controller.cluster.notifications.LeaderStateChanged;
14 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
17 * A local message derived from LeaderStateChanged containing additional Shard-specific info that is sent
18 * when some state of the shard leader has changed. This message is used by the ShardManager to maintain
19 * current Shard information.
21 * @author Thomas Pantelis
23 public class ShardLeaderStateChanged extends LeaderStateChanged {
25 private final Optional<DataTree> localShardDataTree;
27 public ShardLeaderStateChanged(@Nonnull String memberId, @Nonnull String leaderId,
28 @Nonnull Optional<DataTree> localShardDataTree, short leaderPayloadVersion) {
29 super(memberId, leaderId, leaderPayloadVersion);
30 this.localShardDataTree = Preconditions.checkNotNull(localShardDataTree);
33 public @Nonnull Optional<DataTree> getLocalShardDataTree() {
34 return localShardDataTree;