2 * Copyright (c) 2015 Dell 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
9 package org.opendaylight.controller.cluster.datastore.shardmanager;
11 import com.google.common.collect.ImmutableList;
12 import java.io.Serializable;
13 import java.util.List;
14 import javax.annotation.Nonnull;
17 * Persisted data of the ShardManager.
19 // FIXME: make this package-protected once forShardList is removed.
20 public final class ShardManagerSnapshot implements Serializable {
21 private static final long serialVersionUID = 1L;
22 private final List<String> shardList;
24 ShardManagerSnapshot(final @Nonnull List<String> shardList) {
25 this.shardList = ImmutableList.copyOf(shardList);
28 List<String> getShardList() {
29 return this.shardList;
33 * Creates a ShardManagerSnapshot.
35 * @deprecated This method is for migration only and should me removed once
36 * org.opendaylight.controller.cluster.datastore.ShardManagerSnapshot is removed.
39 public static ShardManagerSnapshot forShardList(final @Nonnull List<String> shardList) {
40 return new ShardManagerSnapshot(shardList);
44 public String toString() {
45 return "ShardManagerSnapshot [ShardList = " + shardList + " ]";