Move ShardManagerSnapshot to new package
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / shardmanager / ShardManagerSnapshot.java
1 /*
2  * Copyright (c) 2015 Dell Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.cluster.datastore.shardmanager;
10
11 import com.google.common.collect.ImmutableList;
12 import java.io.Serializable;
13 import java.util.List;
14 import javax.annotation.Nonnull;
15
16 /**
17  * Persisted data of the ShardManager
18  */
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;
23
24     ShardManagerSnapshot(final @Nonnull List<String> shardList) {
25         this.shardList = ImmutableList.copyOf(shardList);
26     }
27
28     List<String> getShardList() {
29         return this.shardList;
30     }
31
32     /**
33      * @deprecated This method is for migration only and should me removed once
34      *             org.opendaylight.controller.cluster.datastore.ShardManagerSnapshot is removed.
35      */
36     @Deprecated
37     public static ShardManagerSnapshot forShardList(final @Nonnull List<String> shardList) {
38         return new ShardManagerSnapshot(shardList);
39     }
40
41     @Override
42     public String toString() {
43         return "ShardManagerSnapshot [ShardList = " + shardList + " ]";
44     }
45 }