9899aeb1fc12dcadabb4b13cefc419a5e3bad1af
[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.Collections;
14 import java.util.List;
15 import javax.annotation.Nonnull;
16
17 /**
18  * Persisted data of the ShardManager.
19  *
20  * @deprecated Use {@link org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnapshot} instead.
21  */
22 @Deprecated
23 public final class ShardManagerSnapshot implements Serializable {
24     private static final long serialVersionUID = 1L;
25     private final List<String> shardList;
26
27     ShardManagerSnapshot(@Nonnull final List<String> shardList) {
28         this.shardList = ImmutableList.copyOf(shardList);
29     }
30
31     public List<String> getShardList() {
32         return this.shardList;
33     }
34
35     /**
36      * Creates a ShardManagerSnapshot.
37      *
38      * @deprecated This method is for migration only and should me removed once
39      *             org.opendaylight.controller.cluster.datastore.ShardManagerSnapshot is removed.
40      */
41     @Deprecated
42     public static ShardManagerSnapshot forShardList(final @Nonnull List<String> shardList) {
43         return new ShardManagerSnapshot(shardList);
44     }
45
46     private Object readResolve() {
47         return new org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnapshot(shardList,
48                 Collections.emptyMap());
49     }
50
51     @Override
52     public String toString() {
53         return "ShardManagerSnapshot [ShardList = " + shardList + " ]";
54     }
55 }