Introduce DOMEntityOwnershipService replacement
[controller.git] / opendaylight / md-sal / eos-dom-akka / src / main / java / org / opendaylight / controller / eos / akka / bootstrap / command / RunningContext.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. 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.eos.akka.bootstrap.command;
9
10 import static java.util.Objects.requireNonNull;
11
12 import akka.actor.typed.ActorRef;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.controller.eos.akka.owner.checker.command.StateCheckerCommand;
15 import org.opendaylight.controller.eos.akka.owner.supervisor.command.OwnerSupervisorCommand;
16 import org.opendaylight.controller.eos.akka.registry.candidate.command.CandidateRegistryCommand;
17 import org.opendaylight.controller.eos.akka.registry.listener.type.command.TypeListenerRegistryCommand;
18
19 public final class RunningContext extends BootstrapCommand {
20     private final @NonNull ActorRef<TypeListenerRegistryCommand> listenerRegistry;
21     private final @NonNull ActorRef<CandidateRegistryCommand> candidateRegistry;
22     private final @NonNull ActorRef<StateCheckerCommand> ownerStateChecker;
23     private final @NonNull ActorRef<OwnerSupervisorCommand> ownerSupervisor;
24
25     public RunningContext(final ActorRef<TypeListenerRegistryCommand> listenerRegistry,
26                           final ActorRef<CandidateRegistryCommand> candidateRegistry,
27                           final ActorRef<StateCheckerCommand> ownerStateChecker,
28                           final ActorRef<OwnerSupervisorCommand> ownerSupervisor) {
29         this.listenerRegistry = requireNonNull(listenerRegistry);
30         this.candidateRegistry = requireNonNull(candidateRegistry);
31         this.ownerStateChecker = requireNonNull(ownerStateChecker);
32         this.ownerSupervisor = requireNonNull(ownerSupervisor);
33     }
34
35     public @NonNull ActorRef<TypeListenerRegistryCommand> getListenerRegistry() {
36         return listenerRegistry;
37     }
38
39     public @NonNull ActorRef<CandidateRegistryCommand> getCandidateRegistry() {
40         return candidateRegistry;
41     }
42
43     public @NonNull ActorRef<StateCheckerCommand> getOwnerStateChecker() {
44         return ownerStateChecker;
45     }
46
47     public @NonNull ActorRef<OwnerSupervisorCommand> getOwnerSupervisor() {
48         return ownerSupervisor;
49     }
50 }