Bug 4105: Implement EntityOwnershipListener registration/notification
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / 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.datastore.entityownership.messages;
9
10 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListener;
11
12 /**
13  * Message sent to the local EntityOwnershipShard to register an EntityOwnershipListener.
14  *
15  * @author Thomas Pantelis
16  */
17 public class RegisterListenerLocal {
18     private final EntityOwnershipListener listener;
19     private final String entityType;
20
21     public RegisterListenerLocal(EntityOwnershipListener listener, String entityType) {
22         this.listener = listener;
23         this.entityType = entityType;
24     }
25
26     public EntityOwnershipListener getListener() {
27         return listener;
28     }
29
30     public String getEntityType() {
31         return entityType;
32     }
33
34     @Override
35     public String toString() {
36         return "RegisterListenerLocal [entityType=" + entityType + ", listener=" + listener + "]";
37     }
38 }