b3b4c8cff82e9375286236009e3454c99361de90
[controller.git] / opendaylight / md-sal / eos-dom-akka / src / main / java / org / opendaylight / controller / eos / akka / owner / supervisor / command / AbstractEntityRequest.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.owner.supervisor.command;
9
10 import akka.actor.typed.ActorRef;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.entity.owners.norev.EntityId;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.entity.owners.norev.EntityName;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.entity.owners.norev.EntityType;
15
16 public abstract class AbstractEntityRequest<T extends OwnerSupervisorReply> extends OwnerSupervisorRequest<T> {
17     private static final long serialVersionUID = 1L;
18
19     private final @NonNull EntityType type;
20     private final @NonNull EntityName name;
21
22     AbstractEntityRequest(final ActorRef<T> replyTo, final EntityId entity) {
23         super(replyTo);
24         this.type = entity.requireType();
25         this.name = entity.requireName();
26     }
27
28     public final @NonNull EntityType getType() {
29         return type;
30     }
31
32     public final @NonNull EntityName getName() {
33         return name;
34     }
35 }