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

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.