f4c1020677f87a2e1c54853046d49a3066a1c286
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / compat / HeliumNotificationServiceAdapter.java
1 /*
2  * Copyright (c) 2015 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.binding.compat;
9
10 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
11 import org.opendaylight.yangtools.concepts.ListenerRegistration;
12 import org.opendaylight.yangtools.yang.binding.Notification;
13 import org.opendaylight.yangtools.yang.binding.NotificationListener;
14
15 public class HeliumNotificationServiceAdapter
16         implements org.opendaylight.controller.sal.binding.api.NotificationService, AutoCloseable {
17
18     private final NotificationService notificationService;
19
20     public HeliumNotificationServiceAdapter(NotificationService notificationService) {
21         this.notificationService = notificationService;
22     }
23
24     @Override
25     public <T extends Notification> ListenerRegistration<
26             org.opendaylight.controller.sal.binding.api.NotificationListener<T>> registerNotificationListener(
27             final Class<T> notificationType,
28             final org.opendaylight.controller.sal.binding.api.NotificationListener<T> listener) {
29         throw new UnsupportedOperationException("Not supported type of listener.");
30     }
31
32     @Override
33     public ListenerRegistration<NotificationListener> registerNotificationListener(
34             final NotificationListener listener) {
35         return notificationService.registerNotificationListener(listener);
36     }
37
38     @Override
39     public void close() throws Exception {
40     }
41 }