sort by descending number of suspected transaction leaks in trace output
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / RegisterChangeListener.java
1 /*
2  * Copyright (c) 2014 Cisco 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
9 package org.opendaylight.controller.cluster.datastore.messages;
10
11 import akka.actor.ActorPath;
12 import akka.actor.ActorRef;
13 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataBroker;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15
16 public class RegisterChangeListener implements ListenerRegistrationMessage {
17     private final YangInstanceIdentifier path;
18     private final ActorRef dataChangeListenerActor;
19     private final AsyncDataBroker.DataChangeScope scope;
20     private final boolean registerOnAllInstances;
21
22     public RegisterChangeListener(YangInstanceIdentifier path, ActorRef dataChangeListenerActor,
23             AsyncDataBroker.DataChangeScope scope, boolean registerOnAllInstances) {
24         this.path = path;
25         this.dataChangeListenerActor = dataChangeListenerActor;
26         this.scope = scope;
27         this.registerOnAllInstances = registerOnAllInstances;
28     }
29
30     @Override
31     public YangInstanceIdentifier getPath() {
32         return path;
33     }
34
35     public AsyncDataBroker.DataChangeScope getScope() {
36         return scope;
37     }
38
39     @Override
40     public ActorPath getListenerActorPath() {
41         return dataChangeListenerActor.path();
42     }
43
44     @Override
45     public boolean isRegisterOnAllInstances() {
46         return registerOnAllInstances;
47     }
48
49     @Override
50     public String toString() {
51         return "RegisterChangeListener [path=" + path + ", scope=" + scope + ", registerOnAllInstances="
52                 + registerOnAllInstances + ", dataChangeListenerActor=" + dataChangeListenerActor + "]";
53     }
54 }