Deprecate old MD-SAL APIs for removal
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / compat / HeliumNotificationProviderServiceAdapter.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 java.util.concurrent.ExecutorService;
11 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
12 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
13 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
14 import org.opendaylight.yangtools.concepts.ListenerRegistration;
15 import org.opendaylight.yangtools.yang.binding.Notification;
16 import org.slf4j.Logger;
17 import org.slf4j.LoggerFactory;
18
19 @Deprecated(forRemoval = true)
20 public class HeliumNotificationProviderServiceAdapter extends HeliumNotificationServiceAdapter
21         implements NotificationProviderService {
22     private static final Logger LOG = LoggerFactory.getLogger(HeliumNotificationProviderServiceAdapter.class);
23
24     private final NotificationPublishService notificationPublishService;
25
26     public HeliumNotificationProviderServiceAdapter(final NotificationPublishService notificationPublishService,
27             final NotificationService notificationService) {
28         super(notificationService);
29         this.notificationPublishService = notificationPublishService;
30     }
31
32     @Override
33     public void publish(final Notification notification) {
34         try {
35             notificationPublishService.putNotification(notification);
36         } catch (InterruptedException e) {
37             LOG.error("Notification publication was interupted", e);
38         }
39     }
40
41     @Override
42     public void publish(final Notification notification, final ExecutorService executor) {
43         try {
44             notificationPublishService.putNotification(notification);
45         } catch (InterruptedException e) {
46             LOG.error("Notification publication was interupted", e);
47         }
48     }
49
50     @Override
51     public ListenerRegistration<NotificationInterestListener> registerInterestListener(
52             final NotificationInterestListener interestListener) {
53         throw new UnsupportedOperationException("InterestListener is not supported.");
54     }
55
56     @Override
57     public void close() {
58
59     }
60 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.