Class: EventDescriptor

ServerlessDb.EventDescriptor

Instances of this class describe some data event to be watched by a subscription on a data node. Subscriptions will send corresponding notifications as soon as matching events are raised, and are expected to be registered using the ServerlessDb.ServerlessDbNode#subscribe method.

Instances of this class are built using either the ValueChange or Child static properties, which can be accessed using the Event property of the Webcom.ServerlessDb static property.

Since:
  • 2.10

Members

(static, readonly) Child :ServerlessDb.EventDescriptor

Creates an event descriptor whose associated subscriptions will raise events as soon as something changes among the children of the watched data node. The changes to watch on the children nodes must be specified by calling further one or more of the Addition, Removal and Change members on the returned object.

This field creates a new instance of ServerlessDb.EventDescriptor that is intended to be used as first parameter of the ServerlessDb.ServerlessDbNode#subscribe method.

Type:

(static, readonly) ValueChange :ServerlessDb.EventDescriptor

Creates an event descriptor whose associated subscriptions will raise events as soon as the value of the watched data node changes. The corresponding sent notifications will contain the new value of the data node.

This field creates a new instance of ServerlessDb.EventDescriptor that is intended to be used as first parameter of the ServerlessDb.ServerlessDbNode#subscribe method.

Type:

(readonly) Addition :ServerlessDb.EventDescriptor

Returns a Child event descriptor updated so that associated subscriptions will raise events as soon as a new child is added to the watched data node. The corresponding sent notifications will contain the list of the newly added children as well as their values.

Note: this member is available only on ServerlessDb.EventDescriptor instances created with the ServerlessDb.EventDescriptor.Child property or one of the Addition, Removal and Change members.

The returned object can be combined further with Removal and Change.

Type:

(readonly) Change :ServerlessDb.EventDescriptor

Returns a Child event descriptor updated so that associated subscriptions will raise events as soon as the value of a child of the watched data node is updated. The corresponding sent notifications will contain the list of the just updated children as well as their updated values.

Note: this member is available only on ServerlessDb.EventDescriptor instances created with the ServerlessDb.EventDescriptor.Child property or one of the Addition, Removal and Change members.

The returned object can be combined further with Addition and Removal.

Type:

(readonly) isAck :boolean

Property available only on actually raised events, that is, the ones passed to ServerlessDb.DataSnapshot#event property.
Indicates whether this EventDescriptor only consists in an acknowledgement of data (the data itself being unchanged).

Type:
  • boolean
Since:
  • 3.0

(readonly) isChildAddition :boolean

Returns true if and only if this ServerlessDb.EventDescriptor represents the addition of a new child on the watched node. It has necessarily been created using Child and Addition.

Type:
  • boolean
Since:
  • 3.0

(readonly) isChildChange :boolean

Returns true if and only if this ServerlessDb.EventDescriptor represents the change of an existing child on the watched node. It has necessarily been created using Child and Change.

Type:
  • boolean
Since:
  • 3.0

(readonly) isChildEvent :boolean

Returns true if and only if this ServerlessDb.EventDescriptor represents an update of one of the children of the watched node. It has necessarily been created using Child.

Type:
  • boolean
Since:
  • 3.0

(readonly) isChildRemoval :boolean

Returns true if and only if this ServerlessDb.EventDescriptor represents the removal of an existing child on the watched node. It has necessarily been created using Child and Removal.

Type:
  • boolean
Since:
  • 3.0

(readonly) isValueChange :boolean

Returns true if and only if this ServerlessDb.EventDescriptor represents a value change of the watched node. It has necessarily been created using ValueChange.

Type:
  • boolean
Since:
  • 3.0

(readonly) isValueChangeWithoutData :boolean

Returns true if and only if this ServerlessDb.EventDescriptor represents a value change of the watched node without containing the changed data. It has necessarily been created using ValueChange and ValueChange.WithoutData.

Type:
  • boolean
Since:
  • 3.0

(readonly) Removal :ServerlessDb.EventDescriptor

Returns a Child event descriptor updated so that associated subscriptions will raise events as soon as a new child is removed from the watched data node. The corresponding sent notifications will contain the list of the just removed children.

Note: this member is available only on ServerlessDb.EventDescriptor instances created with the ServerlessDb.EventDescriptor.Child property or one of the Addition, Removal and Change members.

The returned object can be combined further with Addition and Change.

Type:

(readonly) WithoutData :ServerlessDb.EventDescriptor

Creates an event descriptor whose associated subscriptions will raise events as soon as the value of the watched data node changes, similarly to the ServerlessDb.EventDescriptor.ValueChange field. However, the corresponding sent notifications will be very lightweight and contain no data.

Note: this member is available only on ServerlessDb.EventDescriptor instances created with the ServerlessDb.EventDescriptor.ValueChange property.

Type:

Methods

excludeRevocations() → {ServerlessDb.EventDescriptor}

Specifies that the revocations of the subscriptions associated with this ServerlessDb.EventDescriptor instance will not be watched (and so, will not be notified to the subscribing targets). Subscriptions are typically revoked as soon as the deadline of the watched event is passed or when the security rules forbid to read the watched data.

Returns:

This EventDescriptor instance updated.

Type
ServerlessDb.EventDescriptor
show
deprecated