5b0c992a006aedfd0fd99cfe87f30bf48323e56b
[controller.git] / opendaylight / sal / yang-prototype / sal / sal-core-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.Set;
11
12 import org.opendaylight.controller.sal.core.api.Consumer;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
15
16
17 /**
18  * Notification listener for SAL notifications.
19  */
20 public interface NotificationListener extends Consumer.ConsumerFunctionality {
21     /**
22      * A set of notification types supported by listeners.
23      * 
24      * The set of notification {@link QName}s which are supported by this
25      * listener. This set is used, when {@link Consumer} is registered to the
26      * SAL, to automatically register the listener.
27      * 
28      * @return Set of QNames identifying supported notifications.
29      */
30     Set<QName> getSupportedNotifications();
31
32     /**
33      * Fired when the notification occurs.
34      * 
35      * The type of the notification could be learned by
36      * <code>QName type = notification.getNodeType();</code>
37      * 
38      * @param notification
39      *            Notification content
40      */
41     void onNotification(CompositeNode notification);
42 }