BUG 2854 : Do not add empty read write transactions to the replicable journal
[controller.git] / opendaylight / md-sal / sal-dom-api / src / main / java / org / opendaylight / controller / sal / core / api / notify / NotificationListener.java
1 /*
2  * Copyright (c) 2013 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.sal.core.api.notify;
9
10 import java.util.EventListener;
11 import java.util.Set;
12
13 import org.opendaylight.controller.sal.core.api.Consumer;
14 import org.opendaylight.yangtools.yang.common.QName;
15 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
16
17
18 /**
19  * Notification listener for SAL notifications.
20  */
21 public interface NotificationListener extends Consumer.ConsumerFunctionality, EventListener {
22     /**
23      * A set of notification types supported by listeners.
24      *
25      * The set of notification {@link QName}s which are supported by this
26      * listener. This set is used, when {@link Consumer} is registered to the
27      * SAL, to automatically register the listener.
28      *
29      * @return Set of QNames identifying supported notifications.
30      */
31     Set<QName> getSupportedNotifications();
32
33     /**
34      * Fired when the notification occurs.
35      *
36      * The type of the notification could be learned by
37      * <code>QName type = notification.getNodeType();</code>
38      *
39      * @param notification
40      *            Notification content
41      */
42     void onNotification(CompositeNode notification);
43 }