2 * Copyright (c) 2016 Cisco Systems, Inc. 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.actors.dds;
10 import akka.actor.Props;
11 import javax.annotation.Nonnull;
12 import org.opendaylight.controller.cluster.access.client.AbstractClientActor;
13 import org.opendaylight.controller.cluster.access.client.ClientActorContext;
14 import org.opendaylight.controller.cluster.access.concepts.FrontendIdentifier;
15 import org.opendaylight.controller.cluster.access.concepts.FrontendType;
16 import org.opendaylight.controller.cluster.access.concepts.MemberName;
17 import org.opendaylight.controller.cluster.datastore.utils.ActorContext;
20 * A {@link AbstractClientActor} which acts as the point of contact for DistributedDataStore.
22 * @author Robert Varga
24 public final class DistributedDataStoreClientActor extends AbstractDataStoreClientActor {
25 private DistributedDataStoreClientActor(final FrontendIdentifier frontendId, final ActorContext actorContext) {
26 super(frontendId, actorContext);
30 AbstractDataStoreClientBehavior initialBehavior(final ClientActorContext context, final ActorContext actorContext) {
31 return new DistributedDataStoreClientBehavior(context, actorContext);
34 public static Props props(@Nonnull final MemberName memberName, @Nonnull final String storeName,
35 final ActorContext ctx) {
36 final String name = "datastore-" + storeName;
37 final FrontendIdentifier frontendId = FrontendIdentifier.create(memberName, FrontendType.forName(name));
38 return Props.create(DistributedDataStoreClientActor.class,
39 () -> new DistributedDataStoreClientActor(frontendId, ctx));