Improve segmented journal actor metrics
[controller.git] / opendaylight / md-sal / eos-dom-akka / src / main / java / org / opendaylight / controller / eos / akka / owner / supervisor / command / InternalClusterEvent.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 static java.util.Objects.requireNonNull;
11
12 import akka.actor.Address;
13 import com.google.common.base.MoreObjects;
14 import java.util.Set;
15 import org.eclipse.jdt.annotation.NonNull;
16
17 public abstract class InternalClusterEvent extends OwnerSupervisorCommand {
18     private final @NonNull Set<String> roles;
19     private final @NonNull Address address;
20
21     InternalClusterEvent(final Address address, final Set<String> roles) {
22         this.address = requireNonNull(address);
23         this.roles = Set.copyOf(roles);
24     }
25
26     public final @NonNull Address getAddress() {
27         return address;
28     }
29
30     public final @NonNull Set<String> getRoles() {
31         return roles;
32     }
33
34     @Override
35     public final String toString() {
36         return MoreObjects.toStringHelper(this).add("address", address).add("roles", roles).toString();
37     }
38 }