2c9ebabaa4d4a99c535c351c103e66e05a7ce6d9
[controller.git] / opendaylight / md-sal / sal-distributed-eos / src / main / java / org / opendaylight / controller / cluster / entityownership / messages / RegisterListenerLocal.java
1 /*
2  * Copyright (c) 2015 Brocade Communications 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.entityownership.messages;
9
10 import static java.util.Objects.requireNonNull;
11
12 import org.eclipse.jdt.annotation.NonNullByDefault;
13 import org.opendaylight.mdsal.eos.dom.api.DOMEntityOwnershipListener;
14
15 /**
16  * Message sent to the local EntityOwnershipShard to register an EntityOwnershipListener.
17  *
18  * @author Thomas Pantelis
19  */
20 @NonNullByDefault
21 public class RegisterListenerLocal {
22     private final DOMEntityOwnershipListener listener;
23     private final String entityType;
24
25     public RegisterListenerLocal(final DOMEntityOwnershipListener listener, final String entityType) {
26         this.listener = requireNonNull(listener, "listener cannot be null");
27         this.entityType = requireNonNull(entityType, "entityType cannot be null");
28     }
29
30     public DOMEntityOwnershipListener getListener() {
31         return listener;
32     }
33
34     public String getEntityType() {
35         return entityType;
36     }
37
38     @Override
39     public String toString() {
40         return "RegisterListenerLocal [entityType=" + entityType + ", listener=" + listener + "]";
41     }
42 }