X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Ftools%2Fnetconf-testtool%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Ftest%2Ftool%2Frpc%2FSimulatedCreateSubscription.java;h=9ec5795de21f0b87d6d7d727ed4d03a4a56916f1;hb=dffe3d87e10e92d53c8fa175266eff388d5d88d7;hp=1d4040a3845bf29d5aa9f962f0138c9c4b1c662d;hpb=f7a8466d06668fcd671a72c9fe9e72070cba020c;p=netconf.git diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java index 1d4040a384..9ec5795de2 100644 --- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java +++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedCreateSubscription.java @@ -48,15 +48,16 @@ public class SimulatedCreateSubscription extends AbstractLastNetconfOperation im Optional notifications; - if(notificationsFile.isPresent()) { + if (notificationsFile.isPresent()) { notifications = Optional.of(loadNotifications(notificationsFile.get())); scheduledExecutorService = Executors.newScheduledThreadPool(1); } else { notifications = Optional.absent(); } - if(notifications.isPresent()) { - Map preparedMessages = Maps.newHashMapWithExpectedSize(notifications.get().getNotificationList().size()); + if (notifications.isPresent()) { + Map preparedMessages = Maps.newHashMapWithExpectedSize( + notifications.get().getNotificationList().size()); for (final Notification notification : notifications.get().getNotificationList()) { final NetconfMessage parsedNotification = parseNetconfNotification(notification.getContent()); preparedMessages.put(notification, parsedNotification); @@ -89,7 +90,8 @@ public class SimulatedCreateSubscription extends AbstractLastNetconfOperation im } @Override - protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) throws DocumentedException { + protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) + throws DocumentedException { long delayAggregator = 0; for (final Map.Entry notification : notifications.entrySet()) { @@ -113,7 +115,7 @@ public class SimulatedCreateSubscription extends AbstractLastNetconfOperation im final int startEventTime = content.indexOf("") + "".length(); final int endEventTime = content.indexOf(""); final String eventTime = content.substring(startEventTime, endEventTime); - if(eventTime.equals("XXXX")) { + if (eventTime.equals("XXXX")) { content = content.replace(eventTime, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX").format(new Date())); } @@ -125,8 +127,8 @@ public class SimulatedCreateSubscription extends AbstractLastNetconfOperation im } @Override - public void setNetconfSession(final NetconfServerSession s) { - this.session = s; + public void setNetconfSession(final NetconfServerSession session) { + this.session = session; } @XmlRootElement(name = "notifications")