Class Index | File Index

Classes


Class EventReceiver

A class which provides the receiver functionality. Use HTTPFabricConnection#createEventReceiver method to create a new receiver.
Defined in: </home/ubuntu/streamscape/NeeveBuild/stjsapi/src/main/webapp/js/EventReceiver.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
EventReceiver(receiverName, filter, selector, fabricConnection, noLocal, fabricConnection)
Creates a receiver for receiving events raised in Fabric
Method Summary
Method Attributes Method Name and Description
void 
Clears this receiver queue
void 
Closes the receiver and removes it from the Fabric connection
Promise 
Returns current depth
String 
Returns the event filter of this receiver.
String 
Returns the event scope of this receiver.
String 
Returns the event selector of this receiver.
String 
Returns the flow control mode of this receiver queue.
number 
Returns the maximum depth of this receiver queue
String 
Returns the name of this receiver
void 
receive(callback)
Asynchronously gets the next available event in the receiver queue.
void 
receiveNoWait(callback)
Asynchronously gets the next available event in the receiver queue.
void 
receiveSelected(selector, callback)
Asynchronously gets the next available event in the receiver queue.
void 
receiveSelectedNoWait(selector, callback)
Asynchronously gets the next available event in the receiver queue.
void 
receiveSelectedWithWait(selector, timeout, callback)
Asynchronously gets the next available event in the receiver queue.
void 
receiveWithWait(timeout, callback)
Asynchronously gets the next available event in the receiver queue.
void 
setEventSelector(selector)
Sets the event selector for this receiver.
void 
Sets the flow control mode of this receiver queue.
void 
setMaxDepth(maxDepth)
Sets the maximum depth of this receiver queue
Class Detail
EventReceiver(receiverName, filter, selector, fabricConnection, noLocal, fabricConnection)
Creates a receiver for receiving events raised in Fabric
Parameters:
{String} receiverName
The name of the receiver, which should be unique within Fabric
{String} filter
The event filter of the receiver. This filter is actually an event id mask, which defines what event id can have a received event. See HTTPFabricConnection#createEventConsumer for details.
{String} selector
The event selector of the receiver. Selector allows to specify almost any conditions on event properties' values which should be satisfied for an event to be received. See Selector for details.
{HTTPFabricConnection} fabricConnection
The connection for which this receiver is created.
noLocal
fabricConnection
Method Detail
clear()
Clears this receiver queue

close()
Closes the receiver and removes it from the Fabric connection

{Promise} getCurrentDepth()
Returns current depth
Returns:
{Promise}

{String} getEventFilter()
Returns the event filter of this receiver. An event filter is actually an event id mask, which defines what event id can have a received event. See HTTPFabricConnection#createEventConsumer for details.
Returns:
This receiver event filter

{String} getEventScope()
Returns the event scope of this receiver. See HTTPFabricConnection#getEventScope for possible event scope values.
Returns:
This receiver event scope

{String} getEventSelector()
Returns the event selector of this receiver. An event selector allows to specify almost any conditions on event properties' values which should be satisfied for an event to be received. See Selector for details.
Returns:
This receiver event selector

{String} getFlowControlMode()
Returns the flow control mode of this receiver queue. See EventConsumer#getFlowControlMode for the mode possible values.
Returns:
This receiver flow control mode

{number} getMaxDepth()
Returns the maximum depth of this receiver queue
Returns:
This receiver queue maximum depth

{String} getName()
Returns the name of this receiver
Returns:
This receiver name

receive(callback)
Asynchronously gets the next available event in the receiver queue. If the receiver's event selector is not null, it will be used as a filtering criteria when getting the next event. The got event is passed to the specified callback function when it is returned from server side. The callback won't be called until the event is available or the receiver is stopped. In the last case it is called with null parameter.
Parameters:
{Function} callback
The callback function called with the event got from the queue or null if the receiver is stopped and no events are available. (See HTTPFabricConnection for a callback description). Callback object type: Event.AbstractDataEvent

receiveNoWait(callback)
Asynchronously gets the next available event in the receiver queue. If the receiver's event selector is not null, it will be used as a filtering criteria when getting the next event. The got event is passed to the specified callback function when it is returned from server side. If there are no available events currently then callback is called with null parameter.
Parameters:
{Function} callback
The callback function called with the event got from the queue or null if no events are available currently. (See HTTPFabricConnection for a callback description). Callback object type: Event.AbstractDataEvent

receiveSelected(selector, callback)
Asynchronously gets the next available event in the receiver queue. If the specified event selector is not null, it will be used as a criteria when getting the next event. The got event is passed to the specified callback function when it is returned from server side. The callback won't be called until the event is available or the receiver is stopped. In the last case it is called with null parameter.
Parameters:
{String} selector
The event selector allows to specify almost any conditions on event properties' values which should be satisfied for an event to be matched. See Selector for details.
{Function} callback
The callback function called with the event got from the queue or null if the receiver is stopped and no events are available. (See HTTPFabricConnection for a callback description). Callback object type: Event.AbstractDataEvent

receiveSelectedNoWait(selector, callback)
Asynchronously gets the next available event in the receiver queue. If the specified event selector is not null, it will be used as a criteria when getting the next event. The got event is passed to the specified callback function when it is returned from server side. If there are no available events currently then callback is called with null parameter.
Parameters:
{String} selector
The event selector allows to specify almost any conditions on event properties' values which should be satisfied for an event to be matched. See Selector for details.
{Function} callback
The callback function called with the event got from the queue or null if no events are available currently. (See HTTPFabricConnection for a callback description). Callback object type: Event.AbstractDataEvent

receiveSelectedWithWait(selector, timeout, callback)
Asynchronously gets the next available event in the receiver queue. If the specified event selector is not null, it will be used as a criteria when getting the next event. The got event is passed to the specified callback function when it is returned from server side. The callback won't be called until the event is available or the specified waitTime milliseconds pass or the receiver is stopped. In the last two cases it is called with null parameter.
Parameters:
{String} selector
The event selector allows to specify almost any conditions on event properties' values which should be satisfied for an event to be matched. See Selector for details.
{number} timeout
The maximum waiting time in milliseconds
{Function} callback
The callback function called with the event got from the queue or null if the timeout has expired or the receiver is stopped and no events are available. (See HTTPFabricConnection for a callback description). Callback object type: Event.AbstractDataEvent

receiveWithWait(timeout, callback)
Asynchronously gets the next available event in the receiver queue. If the receiver's event selector is not null, it will be used as a filtering criteria when getting the next event. The got event is passed to the specified callback function when it is returned from server side. The callback won't be called until the event is available or the specified waitTime milliseconds pass or the receiver is stopped. In the last two cases it is called with null parameter.
Parameters:
{number} timeout
The maximum waiting time in milliseconds
{Function} callback
The callback function called with the event got from the queue or null if the timeout has expired or the receiver is stopped and no events are available. (See HTTPFabricConnection for a callback description). Callback object type: Event.AbstractDataEvent

setEventSelector(selector)
Sets the event selector for this receiver. An event selector allows to specify almost any conditions on event properties' values which should be satisfied for an event to be received. See Selector for details.
Parameters:
{String} selector
The new event selector for this receiver.

setFlowControlMode(mode)
Sets the flow control mode of this receiver queue. See EventConsumer#getFlowControlMode for the mode possible values.
Parameters:
{String} mode
The new flow control mode of the receiver queue

setMaxDepth(maxDepth)
Sets the maximum depth of this receiver queue
Parameters:
{number} maxDepth
The new maximum depth of the receiver queue

Copyright © 2015-2021 StreamScape Technologies. All rights reserved.