public interface SubscriptionNotifyEvent
Event generated when an actual or historical data or a server-answer to
Subscription.refreshEntity()
is available.
This event must be handled by
SubscriptionListener.onSubscriptionNotify()
.
With this event the server result is always
Event.RESULT_OK
.
Field Summary | |
---|---|
static int |
ACTION_ENTITY_ADD
Action-code: entity added on the server, or just returned as an answer to Subscription.refreshEntity() . |
static int |
ACTION_ENTITY_DEL
Action-code: entity logically removed on the server. |
static int |
ACTION_ENTITY_KIL
Action-code: entity physically removed on the server. |
static int |
ACTION_ENTITY_RWT
Action-code: entity rewritten on the server. |
Fields inherited from interface Event |
---|
RESULT_GENERIC_ERROR, RESULT_OK |
Method Summary | |
---|---|
int |
getAction()
Returns the server action associated with the entity available on this event. |
Entity |
getEntity()
Returns the entity available on this event. |
int |
getKeyID()
Returns the index of the key on the basis of which the server has carried out getAction() . |
TimeStamp |
getTimeStamp()
Returns the timestamp associated with the entity available on this event. |
boolean |
isMasked()
Returns the indication that some fields of getEntity() may be
missings. |
Methods inherited from interface SubscriptionEvent |
---|
getSubscription |
Methods inherited from interface Event |
---|
getResult |
Field Detail |
---|
static final int ACTION_ENTITY_ADD
Subscription.refreshEntity()
.
Historical data are always tagged as ACTION_ENTITY_ADD
.
This value may be returned by getAction()
.
static final int ACTION_ENTITY_DEL
In this case the Entity returned by getEntity()
is generally
undefined on any fields apart from those associated with
getKeyID()
.
Historical data are never tagged as ACTION_ENTITY_DEL
.
This value may be returned by getAction()
.
static final int ACTION_ENTITY_RWT
Historical data are never tagged as ACTION_ENTITY_RWT
.
This value may be returned by getAction()
.
static final int ACTION_ENTITY_KIL
Every time there is an ACTION_ENTITY_KIL
the server
EntityClass version changed. This new version is available in
getTimeStamp()
.getDateTime()
and it's different from both the
initially subscribed EntityClass version
and the
initially required EntityClass version.
If getKeyID()
> 0,
then
getEntity()
is generally undefined on
any fields apart from those associated with getKeyID()
getKeyID()
<= 0)
getEntity()
returns null
.
Historical data are never tagged as ACTION_ENTITY_KIL
.
This value may be returned by getAction()
.
Method Detail |
---|
int getAction()
The possible returned values are described in the Field Summary section.
If this event is the server-answer to a
Subscription.refreshEntity()
the value ACTION_ENTITY_ADD
is returned.
TimeStamp getTimeStamp()
null
is never returned.Entity getEntity()
If getKeyID()
<= 0
then
null
,
getAction()
is ACTION_ENTITY_DEL
or
ACTION_ENTITY_KIL
getKeyID()
,
Subscription.refreshEntity()
isMasked()
returns true
,
isMasked()
returns false
,
null
is returned when getKeyID()
<= 0.int getKeyID()
getAction()
.
For ACTION_ENTITY_DEL
and ACTION_ENTITY_KIL
this value
determines which field are available in getEntity()
.
getAction()
.getEntity()
boolean isMasked()
getEntity()
may be
missings.
For ACTION_ENTITY_ADD
and ACTION_ENTITY_RWT
this value
determines which field are available in getEntity()
.
true
is returned when this event refers a
masked subscriptions
and it is not an answer to a
Subscription.refreshEntity()
.
In this case the Entity returned by getEntity()
is generally
undefined on any fields apart from those associated with the mask.
false
is returned when this event refers a not
masked subscriptions
or it is an answer to a
Subscription.refreshEntity()
.
In this case all fields of the Entity returned by getEntity()
are
meaningful.
Please note that the behaviour of this method does not depends on
the values (SubscriptionParam.SUBSCRIBE_MASKED_FLOW_ALL
and SubscriptionParam.SUBSCRIBE_MASKED_FLOW_LAST
)
given to
SubscriptionParam.setFlow()
.
getEntity()
may be
missings. ACTION_ENTITY_DEL
and
ACTION_ENTITY_KIL
.getEntity()