- for (final Notification notification : notifications.get().getNotificationList()) {
- for (int i = 0; i <= notification.getTimes(); i++) {
-
- delayAggregator += notification.getDelayInSeconds();
-
- System.console().writer().println("Times " + notification.getTimes());
- scheduledExecutorService.schedule(new Runnable() {
- @Override
- public void run() {
- try {
- System.console().writer().println("Sending actual notification " + notification);
- Preconditions.checkState(session != null, "Session is not set, cannot process notifications");
- session.sendMessage(parseNetconfNotification(notification.getContent()));
- } catch (IOException | SAXException e) {
- throw new IllegalStateException("Unable to process notification " + notification, e);
- }
- }
- }, delayAggregator, TimeUnit.SECONDS);
- }
+ scheduledExecutorService.schedule(new Runnable() {
+ @Override
+ public void run() {
+ Preconditions.checkState(session != null, "Session is not set, cannot process notifications");
+ session.sendMessage(notification.getValue());
+ }
+ }, delayAggregator, TimeUnit.SECONDS);