Class NotificationOrder
java.lang.Object
org.eclipse.californium.core.observe.NotificationOrder
The NotificationOrderer holds the state of an observe relation such as the
timeout of the last notification and the current number.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final long
The timestamp of the responseprotected final int
The observe number -
Constructor Summary
ConstructorsConstructorDescriptionNotificationOrder
(int observe) Creates a new notification order for a given notification.NotificationOrder
(int observe, long nanoTime) Creates a new notification order for a given notification and nano-time. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the notification number.static boolean
isNew
(long T1, int V1, long T2, int V2) Compare order of notifications.boolean
Test, if the provided notification is newer than the current one.
-
Field Details
-
number
protected final int numberThe observe number -
nanoTimestamp
protected final long nanoTimestampThe timestamp of the response
-
-
Constructor Details
-
NotificationOrder
public NotificationOrder(int observe) Creates a new notification order for a given notification.- Parameters:
observe
- observe of the notification- Since:
- 3.0 changed type of observe from
Integer
toint
.
-
NotificationOrder
public NotificationOrder(int observe, long nanoTime) Creates a new notification order for a given notification and nano-time.- Parameters:
observe
- observe of the notificationnanoTime
- receive time of notification- Since:
- 3.0 changed type of observe from
Integer
toint
.
-
-
Method Details
-
getObserve
public int getObserve()Returns the notification number.- Returns:
- the notification number.
- Since:
- 3.0 changed return type from
Integer
toint
.
-
isNew
Test, if the provided notification is newer than the current one.- Parameters:
response
- the notification- Returns:
true
if the notification is new
-
isNew
public static boolean isNew(long T1, int V1, long T2, int V2) Compare order of notifications.- Parameters:
T1
- nano realtimestamp of first notificationV1
- observe number of first notificationT2
- nano realtimestamp of second notificationV2
- observe number of second notification- Returns:
true
, if second notification is newer.
-