Reduce JSR305 proliferation
[controller.git] / opendaylight / md-sal / cds-access-client / src / main / java / org / opendaylight / controller / cluster / access / client / AbstractClientActorContext.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.access.client;
9
10 import static java.util.Objects.requireNonNull;
11
12 import akka.actor.ActorRef;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.concepts.Mutable;
15
16 /**
17  * Common, externally-invisible superclass of contexts associated with a {@link AbstractClientActor}. End users pass
18  * this object via opaque {@link ClientActorContext}.
19  *
20  * @author Robert Varga
21  */
22 abstract class AbstractClientActorContext implements Mutable {
23     private final @NonNull String persistenceId;
24     private final @NonNull ActorRef self;
25
26     AbstractClientActorContext(final @NonNull ActorRef self, final @NonNull String persistenceId) {
27         this.persistenceId = requireNonNull(persistenceId);
28         this.self = requireNonNull(self);
29     }
30
31     // TODO: rename this to logContext()
32     final @NonNull String persistenceId() {
33         return persistenceId;
34     }
35
36     public final @NonNull ActorRef self() {
37         return self;
38     }
39 }