BUG-8372: fix abort message confusion
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / databroker / actors / dds / DistributedDataStoreClientActor.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, 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.databroker.actors.dds;
9
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;
18
19 /**
20  * A {@link AbstractClientActor} which acts as the point of contact for DistributedDataStore.
21  *
22  * @author Robert Varga
23  */
24 public final class DistributedDataStoreClientActor extends AbstractDataStoreClientActor {
25     private DistributedDataStoreClientActor(final FrontendIdentifier frontendId, final ActorContext actorContext) {
26         super(frontendId, actorContext);
27     }
28
29     @Override
30     AbstractDataStoreClientBehavior initialBehavior(final ClientActorContext context, final ActorContext actorContext) {
31         return new DistributedDataStoreClientBehavior(context, actorContext);
32     }
33
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));
40     }
41 }