Deprecate all MD-SAL APIs
[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 @Deprecated
16 public class HeliumNotificationServiceAdapter
17         implements org.opendaylight.controller.sal.binding.api.NotificationService, AutoCloseable {
18
19     private final NotificationService notificationService;
20
21     public HeliumNotificationServiceAdapter(NotificationService notificationService) {
22         this.notificationService = notificationService;
23     }
24
25     @Override
26     public <T extends Notification> ListenerRegistration<
27             org.opendaylight.controller.sal.binding.api.NotificationListener<T>> registerNotificationListener(
28             final Class<T> notificationType,
29             final org.opendaylight.controller.sal.binding.api.NotificationListener<T> listener) {
30         throw new UnsupportedOperationException("Not supported type of listener.");
31     }
32
33     @Override
34     public ListenerRegistration<NotificationListener> registerNotificationListener(
35             final NotificationListener listener) {
36         return notificationService.registerNotificationListener(listener);
37     }
38
39     @Override
40     public void close() throws Exception {
41     }
42 }