Merge "CHange log level from warn to debug in ProtocolSessionPromise when connection...
[controller.git] / opendaylight / md-sal / sal-common-impl / src / main / java / org / opendaylight / controller / md / sal / common / impl / service / DataChangeListenerRegistration.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 package org.opendaylight.controller.md.sal.common.impl.service;
9
10 import org.opendaylight.controller.md.sal.common.api.data.DataChangeListener;
11 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
12 import org.opendaylight.yangtools.concepts.ListenerRegistration;
13 import org.opendaylight.yangtools.concepts.Path;
14
15 @SuppressWarnings("all")
16 class DataChangeListenerRegistration<P extends Path<P>, D extends Object, DCL extends DataChangeListener<P, D>> extends
17         AbstractObjectRegistration<DCL> implements ListenerRegistration<DCL> {
18     private AbstractDataBroker<P, D, DCL> dataBroker;
19
20     private final P path;
21
22     public P getPath() {
23         return this.path;
24     }
25
26     public DataChangeListenerRegistration(final P path, final DCL instance, final AbstractDataBroker<P, D, DCL> broker) {
27         super(instance);
28         this.dataBroker = broker;
29         this.path = path;
30     }
31
32     @Override
33     protected void removeRegistration() {
34         this.dataBroker.removeListener(this);
35         this.dataBroker = null;
36     }
37 }