X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcore%2Fapi%2Fnotify%2FNotificationListener.java;fp=opendaylight%2Fmd-sal%2Fsal-dom-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcore%2Fapi%2Fnotify%2FNotificationListener.java;h=5b0c992a006aedfd0fd99cfe87f30bf48323e56b;hb=fe024ad74b8656c3ee61b9ddff6009a779aa2189;hp=0000000000000000000000000000000000000000;hpb=437c1bdb967072319e81774bdcf570b2fb0f7b89;p=controller.git diff --git a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/notify/NotificationListener.java b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/notify/NotificationListener.java new file mode 100644 index 0000000000..5b0c992a00 --- /dev/null +++ b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/notify/NotificationListener.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.sal.core.api.notify; + +import java.util.Set; + +import org.opendaylight.controller.sal.core.api.Consumer; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.data.api.CompositeNode; + + +/** + * Notification listener for SAL notifications. + */ +public interface NotificationListener extends Consumer.ConsumerFunctionality { + /** + * A set of notification types supported by listeners. + * + * The set of notification {@link QName}s which are supported by this + * listener. This set is used, when {@link Consumer} is registered to the + * SAL, to automatically register the listener. + * + * @return Set of QNames identifying supported notifications. + */ + Set getSupportedNotifications(); + + /** + * Fired when the notification occurs. + * + * The type of the notification could be learned by + * QName type = notification.getNodeType(); + * + * @param notification + * Notification content + */ + void onNotification(CompositeNode notification); +}