package org.opendaylight.controller.cluster.datastore;
import com.google.common.base.Preconditions;
+import java.io.ObjectStreamException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* Persisted data of the ShardManager
+ *
+ * @deprecated Use {@link org.opendaylight.controller.cluster.datastore.shardmanager.ShardManagerSnapshot} instead.
+ * This class is scheduled for removal once persistence migration from Beryllium is no longer needed.
*/
-
+@Deprecated
public class ShardManagerSnapshot implements Serializable {
private static final long serialVersionUID = 1L;
private final List<String> shardList;
public String toString() {
return "ShardManagerSnapshot [ShardList = " + shardList + " ]";
}
+
+ private Object readResolve() throws ObjectStreamException {
+ return org.opendaylight.controller.cluster.datastore.shardmanager.ShardManagerSnapshot.forShardList(shardList);
+ }
}
import org.opendaylight.controller.cluster.datastore.DatastoreContext;
import org.opendaylight.controller.cluster.datastore.DatastoreContextFactory;
import org.opendaylight.controller.cluster.datastore.Shard;
-import org.opendaylight.controller.cluster.datastore.ShardManagerSnapshot;
import org.opendaylight.controller.cluster.datastore.config.Configuration;
import org.opendaylight.controller.cluster.datastore.config.ModuleShardConfiguration;
import org.opendaylight.controller.cluster.datastore.exceptions.AlreadyExistsException;
--- /dev/null
+/*
+ * Copyright (c) 2015 Dell Inc. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+
+package org.opendaylight.controller.cluster.datastore.shardmanager;
+
+import com.google.common.collect.ImmutableList;
+import java.io.Serializable;
+import java.util.List;
+import javax.annotation.Nonnull;
+
+/**
+ * Persisted data of the ShardManager
+ */
+// FIXME: make this package-protected once forShardList is removed.
+public final class ShardManagerSnapshot implements Serializable {
+ private static final long serialVersionUID = 1L;
+ private final List<String> shardList;
+
+ ShardManagerSnapshot(final @Nonnull List<String> shardList) {
+ this.shardList = ImmutableList.copyOf(shardList);
+ }
+
+ List<String> getShardList() {
+ return this.shardList;
+ }
+
+ /**
+ * @deprecated This method is for migration only and should me removed once
+ * org.opendaylight.controller.cluster.datastore.ShardManagerSnapshot is removed.
+ */
+ @Deprecated
+ public static ShardManagerSnapshot forShardList(final @Nonnull List<String> shardList) {
+ return new ShardManagerSnapshot(shardList);
+ }
+
+ @Override
+ public String toString() {
+ return "ShardManagerSnapshot [ShardList = " + shardList + " ]";
+ }
+}
import org.opendaylight.controller.cluster.datastore.DatastoreContextFactory;
import org.opendaylight.controller.cluster.datastore.Shard;
import org.opendaylight.controller.cluster.datastore.ShardManager.SchemaContextModules;
-import org.opendaylight.controller.cluster.datastore.ShardManagerSnapshot;
import org.opendaylight.controller.cluster.datastore.config.Configuration;
import org.opendaylight.controller.cluster.datastore.config.ConfigurationImpl;
import org.opendaylight.controller.cluster.datastore.config.EmptyModuleShardConfigProvider;