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
20 implements NotificationProviderService {
21 private static final Logger LOG = LoggerFactory.getLogger(HeliumNotificationProviderServiceAdapter.class);
23 private final NotificationPublishService notificationPublishService;
25 public HeliumNotificationProviderServiceAdapter(final NotificationPublishService notificationPublishService,
26 final NotificationService notificationService) {
27 super(notificationService);
28 this.notificationPublishService = notificationPublishService;
32 public void publish(final Notification notification) {
34 notificationPublishService.putNotification(notification);
35 } catch (InterruptedException e) {
36 LOG.error("Notification publication was interupted", e);
41 public void publish(final Notification notification, final ExecutorService executor) {
43 notificationPublishService.putNotification(notification);
44 } catch (InterruptedException e) {
45 LOG.error("Notification publication was interupted", e);
50 public ListenerRegistration<NotificationInterestListener> registerInterestListener(
51 final NotificationInterestListener interestListener) {
52 throw new UnsupportedOperationException("InterestListener is not supported.");