2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.controller.md.sal.binding.compat;
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;
19 public class HeliumNotificationProviderServiceAdapter extends HeliumNotificationServiceAdapter implements NotificationProviderService, AutoCloseable {
20 private static final Logger LOG = LoggerFactory.getLogger(HeliumNotificationProviderServiceAdapter.class);
22 private final NotificationPublishService notificationPublishService;
24 public HeliumNotificationProviderServiceAdapter(NotificationPublishService notificationPublishService,
25 NotificationService notificationService) {
26 super(notificationService);
27 this.notificationPublishService = notificationPublishService;
31 public void publish(final Notification notification) {
33 notificationPublishService.putNotification(notification);
34 } catch (InterruptedException e) {
35 LOG.error("Notification publication was interupted: " + e);
40 public void publish(final Notification notification, final ExecutorService executor) {
42 notificationPublishService.putNotification(notification);
43 } catch (InterruptedException e) {
44 LOG.error("Notification publication was interupted: " + e);
49 public ListenerRegistration<NotificationInterestListener> registerInterestListener(
50 NotificationInterestListener interestListener) {
51 throw new UnsupportedOperationException("InterestListener is not supported.");
55 public void close() throws Exception {