Merge "BUG 1839 - HTTP delete of non existing data"
[controller.git] / opendaylight / md-sal / statistics-manager / src / test / java / test / mock / util / NotificationProviderServiceHelper.java
1 package test.mock.util;
2
3 import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
4 import org.opendaylight.controller.sal.binding.impl.NotificationBrokerImpl;
5 import org.opendaylight.yangtools.yang.binding.Notification;
6
7 import java.util.Timer;
8 import java.util.TimerTask;
9
10 public class NotificationProviderServiceHelper {
11     private NotificationBrokerImpl notifBroker = new NotificationBrokerImpl(SingletonHolder.getDefaultNotificationExecutor());
12
13     public NotificationBrokerImpl getNotifBroker() {
14         return notifBroker;
15     }
16
17     public void pushDelayedNotification(final Notification notification, int delay) {
18         new Timer().schedule(new TimerTask() {
19             @Override
20             public void run() {
21                 notifBroker.publish(notification);
22             }
23         }, delay);
24     }
25
26     public void pushNotification(final Notification notification) {
27         notifBroker.publish(notification);
28     }
29 }