Class NetconfNotification
- java.lang.Object
-
- org.opendaylight.netconf.api.NetconfMessage
-
- org.opendaylight.netconf.notifications.NetconfNotification
-
public final class NetconfNotification extends org.opendaylight.netconf.api.NetconfMessageSpecial kind of netconf message that contains a timestamp.
-
-
Field Summary
Fields Modifier and Type Field Description static StringEVENT_TIMEstatic StringNOTIFICATIONstatic StringNOTIFICATION_NAMESPACEstatic Function<Date,String>RFC3339_DATE_FORMATTERstatic Function<String,Date>RFC3339_DATE_PARSERstatic DateUNKNOWN_EVENT_TIMEUsed for unknown/un-parse-able event-times.
-
Constructor Summary
Constructors Constructor Description NetconfNotification(Document notificationContent)Create new notification and capture the timestamp in the constructor.NetconfNotification(Document notificationContent, Date eventTime)Create new notification with provided timestamp.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DategetEventTime()Get the time of the event.
-
-
-
Field Detail
-
NOTIFICATION
public static final String NOTIFICATION
- See Also:
- Constant Field Values
-
NOTIFICATION_NAMESPACE
public static final String NOTIFICATION_NAMESPACE
- See Also:
- Constant Field Values
-
RFC3339_DATE_PARSER
public static final Function<String,Date> RFC3339_DATE_PARSER
Parse aStringobject into aDateusing the time-zone offset for UTC,ZoneOffset.UTC, and the system default time-zone,ZoneId.systemDefault().While parsing, if an exception occurs, we try to handle it as if it is due to a leap second. If that's the case, a simple conversion is applied, replacing the second-of-minute of 60 with 59. If that's not the case, we propagate the
DateTimeParseExceptionto the caller.
-
EVENT_TIME
public static final String EVENT_TIME
- See Also:
- Constant Field Values
-
UNKNOWN_EVENT_TIME
public static final Date UNKNOWN_EVENT_TIME
Used for unknown/un-parse-able event-times.
-
-
Constructor Detail
-
NetconfNotification
public NetconfNotification(Document notificationContent)
Create new notification and capture the timestamp in the constructor.
-
-
Method Detail
-
getEventTime
public Date getEventTime()
Get the time of the event.- Returns:
- notification event time
-
-