2 * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.databroker;
10 import akka.actor.ActorSystem;
11 import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
12 import org.opendaylight.controller.cluster.databroker.actors.dds.DataStoreClient;
13 import org.opendaylight.controller.cluster.datastore.ClusterWrapper;
14 import org.opendaylight.controller.cluster.datastore.DatastoreContextFactory;
15 import org.opendaylight.controller.cluster.datastore.LocalShardStore;
16 import org.opendaylight.controller.cluster.datastore.config.Configuration;
17 import org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshot;
18 import org.opendaylight.controller.cluster.datastore.shardmanager.AbstractShardManagerCreator;
19 import org.opendaylight.controller.cluster.datastore.shardmanager.TestShardManager;
20 import org.opendaylight.controller.cluster.datastore.shardmanager.TestShardManager.GetLocalShards;
21 import org.opendaylight.controller.cluster.datastore.shardmanager.TestShardManager.GetLocalShardsReply;
22 import org.opendaylight.controller.cluster.datastore.utils.ActorUtils;
24 public class TestClientBackedDataStore extends ClientBackedDataStore implements LocalShardStore {
26 public TestClientBackedDataStore(final ActorSystem actorSystem, final ClusterWrapper cluster,
27 final Configuration configuration,
28 final DatastoreContextFactory datastoreContextFactory,
29 final DatastoreSnapshot restoreFromSnapshot) {
30 super(actorSystem, cluster, configuration, datastoreContextFactory, restoreFromSnapshot);
33 TestClientBackedDataStore(final ActorUtils actorUtils, final ClientIdentifier identifier,
34 final DataStoreClient clientActor) {
35 super(actorUtils, identifier, clientActor);
39 protected AbstractShardManagerCreator<?> getShardManagerCreator() {
40 return new TestShardManager.TestShardManagerCreator();
44 public GetLocalShardsReply getLocalShards() {
45 final ActorUtils utils = getActorUtils();
46 return (GetLocalShardsReply) utils.executeOperation(utils.getShardManager(), GetLocalShards.INSTANCE);