Deprecate old MD-SAL APIs for removal
[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 package org.opendaylight.controller.cluster.datastore.shardmanager;
9
10 import com.google.common.collect.ImmutableList;
11 import java.io.Serializable;
12 import java.util.Collections;
13 import java.util.List;
14 import org.eclipse.jdt.annotation.NonNull;
15
16
17 /**
18  * Persisted data of the ShardManager.
19  *
20  * @deprecated Use {@link org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnapshot} instead.
21  */
22 @Deprecated(forRemoval = true)
23 public final class ShardManagerSnapshot implements Serializable {
24     private static final long serialVersionUID = 1L;
25     private final List<String> shardList;
26
27     ShardManagerSnapshot(final @NonNull 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 }

©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.