BUG-4521 Support milliseconds in event-time notification format
[controller.git] / opendaylight / netconf / netconf-notifications-api / src / main / java / org / opendaylight / controller / netconf / notifications / NetconfNotification.java
index efa42c03e99d2deacba2c48e5657d3a71ab68ccc..d9a9e1d685c800aad9a3a7861f89a0e24df3145e 100644 (file)
@@ -23,8 +23,17 @@ public final class NetconfNotification extends NetconfMessage {
     public static final String NOTIFICATION = "notification";
     public static final String NOTIFICATION_NAMESPACE = "urn:ietf:params:netconf:capability:notification:1.0";
     public static final String RFC3339_DATE_FORMAT_BLUEPRINT = "yyyy-MM-dd'T'HH:mm:ssXXX";
+    // The format with milliseconds is a bit fragile, it cannot be used for timestamps without millis (thats why its a separate format)
+    // + it might not work properly with more than 6 digits
+    // TODO try to find a better solution with Java8
+    public static final String RFC3339_DATE_FORMAT_WITH_MILLIS_BLUEPRINT = "yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXX";
     public static final String EVENT_TIME = "eventTime";
 
+    /**
+     * Used for unknown/un-parse-able event-times
+     */
+    public static final Date UNKNOWN_EVENT_TIME = new Date(0);
+
     /**
      * Create new notification and capture the timestamp in the constructor
      */