Class Index | File Index

Classes


Class HTTPFabricConnection

Main class which provides API for working with Fabric.

Functional overview

The API methods, which return a remote object got from server side, use callback functions or promises to pass the returned object to a user. If callback function passed to the method it will be called when method completed, otherwise promise will be returned. This callback has the following definition:
           callback(response, sequenceId, success)
        
Parameter 'response' contains the object returned from server side. Parameter 'sequenceId' contains the sequence identifier of this method call. This sequence identifier is returned by the API method called by a user. Parameter 'success' is set to 'true' if the server response is got. If there is no response from the server then the callback is called after the timeout (30 seconds by default) is expired. In this case 'response' parameter is set to 'null', 'success' parameter is set to 'false'. In case of an exception occurred at server side, 'response' contains the exception object. Method Utilities#isException can be used to check 'response'. If an exception handler is set in HTTPFabricConnection constructor then the exception is passed to this handler too. Promise success callback has the following definition
             function(response)
         
where response object contains of the following fields
             {
                 id,         // sequence id of request
                 returned,   // returned object
                 success,    // always true in success response
                 timeouted   // always false in success response
             }
        
Promise error callback has the following definition
             function(error)
         
where error object contains of the following fields
             {
                 id,         // sequence id of request
                 returned,   // returned object, exception in error callback
                 success,    // always false in error response
                 timeouted   // true if request was time outed
             }
        
All exception objects has the following signature
             {
                 '@type'  : Exception,
                 detailMessage : detailMessage,
                 cause : cause
             };
        
Here is a user code example.
           // Create connection
           fabricConnection = new HTTPFabricConnection();

           fabricConnection.authenticate('user', 'password', 'Quilt').then((response) => {
             // Login to Fabric
             fabricConnection.open().then((response) => {

                 // Call API methods
                 var moderator = fabricConnection.getModerator();
                 var helloId = moderator.lookupComponentByName('Hello', userCallback);
                 var worldId = moderator.lookupComponentByName('World', userCallback);

                 var names = {};
                 names[helloId] = 'Hello';
                 names[worldId] = 'World';

                 function userCallback(response, sequenceId, success)
                 {
                     if (! success)
                     {
                         alert('Timeout expired for call ' + names[sequenceId]);
                         return;
                     }

                     if (Utilities.isException(response))
                     {
                         alert('Exception for call ' + names[sequenceId] +
                                 ': ' + response.detailMessage);
                         return;
                     }

                     alert('Response object for call ' + names[sequenceId] +
                         ': ' + Utilities.encode(response));
                 }
             })
          });
        
The response object's type for the API method is specified in its documentation. 'Utilities.encode()' method can be used to see all the object fields in JSON representation.
Defined in: </home/ubuntu/streamscape/NeeveBuild/stjsapi/src/main/webapp/js/HTTPFabricConnection.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
HTTPFabricConnection(user, password, exceptionHandler, url)
Creates a connection to Fabric.
Method Summary
Method Attributes Method Name and Description
void 
acknowledgeEvent(event, withSourceData, action, recipientId, eventScope, timeToLive)
Raises the acknowledgement for the specified event.
void 
addEventCache(eventFilter, maxSize, thresholdAction)
Adds a new event cache of maxSize size for the events which satisfy the specified simple eventFilter.
void 
bindProducerFor(eventId)
Binds the specified event identifier in Fabric, so that it can then be raised via this connection.
void 
Clears this connection parameters.
void 
Performs logout procedure and closes the connection to Fabric.
Constraint.DateRange 
createDateRangeConstraint(rangeName, minValue, maxValue, eventScope)
Creates a new date range constraint for this Fabric connection.
Constraint.Domain 
createDomainConstraint(domainName, eventScope)
Creates a new domain constraint for this Fabric connection.
EventConsumer 
createEventAsyncConsumer(consumerName, listener, eventFilter, eventSelector, eventScope, noLocal)
Asynchronously creates a new asynchronous event consumer and adds this consumer to the connection dispatcher.
EventConsumer 
createEventConsumer(consumerName, listener, eventFilter, eventSelector, eventScope, noLocal)
Asynchronously creates a new event consumer and adds this consumer to the connection's dispatcher.
EventReceiver 
createEventReceiver(receiverName, eventFilter, eventSelector, eventScope, noLocal, receiver)
Asynchronously creates a new event receiver and adds this receiver to the connection dispatcher.
Constraint.NumericRange 
createNumericRangeConstraint(rangeName, minValue, maxValue, eventScope)
Creates a new numeric range constraint for this Fabric connection.
EventConsumer 
createRequestConsumer(consumerName, listener, eventScope)
Asynchronously creates a new request event consumer and adds this consumer to the connection dispatcher.
Accessor.Service 
createServiceAccessor(serviceType, serviceName)
Asynchronously creates a service accessor object which can be used to access the specified service.
Accessor.Service 
createServiceAccessorForNode(nodeName, serviceType, serviceName)
Asynchronously creates a service accessor object which can be used to access the specified service.
Promise 
createSLSession(callback)
Asynchronously creates a semantic language session to the current node of the connection.
Promise 
createSLSessionForNode(nodeName, callback)
Asynchronously creates a semantic language session to the node with the specified name.
void 
Asynchronously creates a new user in Fabric with the specified user object: { name, password, description, domain, vCard}.
<static> void 
HTTPFabricConnection.createUser(name, password, description, domain, callback, callback)
This method should be considered as deprecated due to its limitations and exists for backward compatibility.
void 
dropConsumer(consumerName)
Drops the consumer with the specified name from the dispatcher.
void 
dropDateRangeConstraint(rangeName, eventScope)
Drops the specified constraint of this Fabric connection
void 
dropDomainConstraint(domainName, eventScope)
Drops the specified domain constraint of this Fabric connection
void 
dropEventAsyncConsumer(consumerName)
Drops the asynchronous event consumer with the specified name from the dispatcher
void 
dropEventConsumer(consumerName)
Drops the event consumer with the specified name from the dispatcher
void 
dropEventReceiver(receiverName, withoutInvoke)
Drops the receiver with the specified name from the dispatcher
void 
dropNumericRangeConstraint(rangeName, eventScope)
Drops the specified constraint of this Fabric connection
void 
dropRequestConsumer(consumerName)
Drops the request consumer with the specified name from the dispatcher
<static> String 
HTTPFabricConnection.getAcceptorName()
Returns HTTP Acceptor name
Security.ClientId 
Returns the client id of this fabric connection
void 
getConnectionReopenInterval(connectionReopenInterval)
Returns a time (in milliseconds) between failed connection reopen attempts.
Constraint.DateRange 
getDateRangeConstraint(rangeName, eventScope)
Returns the date constraint with the specified name and scope
String 
Returns the description of this fabric connection
Constraint.Domain 
getDomainConstraint(domainName, eventScope)
Returns the domain constraint with the specified name and scope
Accessor.DropBox 
Returns new Accessor.DropBox object which can be used for using dropbox features.
EventConsumer 
getEventAsyncConsumer(consumerName)
Finds and returns the asynchronous event consumer with the specified name
EventConsumer 
getEventConsumer(consumerName)
Finds and returns the event consumer with the specified name
EventDatagramFactory 
Returns new EventDatagramFactory object which is used for creating events and acknowledgements.
EventReceiver 
getEventReceiver(receiverName)
Finds and returns the receiver with the specified name
String 
Returns the event scope of the connection.
FabricAddress 
Returns the Fabric address of the connection.
Accessor.File 
Returns new Accessor.File object which can be used for getting files base64 content and raising file events.
String 
Returns the identifier of http-session generated for this connection.
Moderator 
Returns new Moderator object which can be used for getting different information about the connected Fabric node, its consumer, producers and so on.
String 
Returns the name of this fabric connection.
void 
Returns a time (in milliseconds) how long connection will work without reverse connection.
Constraint.NumericRange 
getNumericRangeConstraint(rangeName, eventScope)
Returns the numeric constraint with the specified name and scope
<static> Array 
HTTPFabricConnection.getOrganizations()
Returns the organizations list of the Fabric Runtime
void 
Returns a number of reconnect attempts that will be made by the Fabric Connection in a case of the remote node disconnection.
void 
Returns a time (in milliseconds) between successive reconnect attempts that will be made by the Fabric Connection in a case of the remote node disconnection.
EventConsumer 
getRequestConsumer(consumerName)
Finds and returns the request consumer with the specified name
void 
Returns a time (in milliseconds) between unsuccessful requests retries.
void 
Returns a count of unsuccessful request retries.
void 
getReverseConnectionHoldTimeout(reverseConnectionHoldTimeout)
Returns a time (in milliseconds) how long reverse connection will hold by the server.
<static> String 
HTTPFabricConnection.getRuntimeVersion()
Returns the version of the Fabric Runtime
SecurityManager 
Returns new SecurityManager object which can be used for managing users, groups and other security stuff.
void 
Returns a time (in milliseconds) how long server connection lost will not reported.
int 
Returns the TimeZone Offset of this fabric connection in minutes
Accessor.Service 
Asynchronously creates an accessor object to the specified service.
Accessor.Service 
getServiceAccessorForNode(nodeName, service)
Asynchronously creates an accessor object to the specified service on the specified Fabric node.
ConnectionStatistics 
Returns fabric conneciton statistics.
<static> String 
HTTPFabricConnection.getSysplexDomain()
Returns the Domain of the Fabric Runtime
int 
Returns the http timeout.
string 
Returns the TimeZone Display Name of this fabric connection in minutes
String 
Returns the type of the connection.
String 
Returns the URL of the connection.
String 
Returns the login name for this connection
<static> String 
HTTPFabricConnection.getVersion()
Returns the version of the Javascript API
boolean 
Checks if this connection has some bound event identifiers (see HTTPFabricConnection#bindProducerFor).
<static> Promise 
HTTPFabricConnection.initStatics(url)
Asynchronously initializes sysplex domain, runtime version and organizations list.
boolean 
isBoundEventId(eventId)
Checks if the specified event identifier is bound in Fabric (see HTTPFabricConnection#bindProducerFor).
boolean 
Returns whether this connection is opened or not.
undefined 
Returns if api key authentication should be used or not.
String 
Returns a list of all the event identifiers bound in Fabric for this connection (see HTTPFabricConnection#bindProducerFor).
void 
Asynchronously returns a list of all the event async consumers of this connection.
void 
Asynchronously returns a list of all the event consumers of this connection.
void 
Asynchronously returns a list of all the event receivers of this connection.
<static> void 
HTTPFabricConnection.listOrganizations(callback, url)
Asynchronously gets organizations list.
void 
Asynchronously returns a list of all the request consumers of this connection.
Promise 
open(noReverse)
Asynchronously opens this connection to Fabric.
void 
ping(callback)
Keeps the http-connection alive.
Promise 
raiseAcknowledgement(event, eventScope, timeToLive)
Raises the specified acknowledgement event.
Promise 
raiseAdvisory(event, eventScope)
Raises the specified advisory event.
Promise 
raiseDirectRequest(consumerName, request, timeout, callback)
Asynchronously sends the specified request event directly to the specified request consumer and waits for its reply for timeout milliseconds.
Promise 
raiseEvent(event, eventScope, timeToLive)
Raises the specified event.
void 
raiseException(event, eventScope)
Raises the specified exception event.
void 
raiseRequest(request, eventScope, distributionStrategy, matchStrategy, timeout, callback)
Asynchronously raises the specified non-direct request event to Fabric and waits for its acknowledgement for timeout milliseconds.
void 
removeEventCache(eventFilter)
Removes the event cache defined by the specified simple event filter.
void 
setClientId(clientId)
Sets the client id (see Security.ClientId) for the connection if it is not opened.
void 
setConnectionReopenInterval(connectionReopenInterval)
Sets a time (in milliseconds) between failed connection reopen attempts.
void 
Updates the date constraint of this Fabric connection with the specified one.
void 
setDescription(description)
Sets the description of the connection if it is not opened.
void 
Updates the domain constraint of this Fabric connection with the specified one.
void 
setEventScope(eventScope)
Sets the event scope of this connection (see HTTPFabricConnection#getEventScope for possible event scope values).
void 
Sets the lease period for this connection.
void 
setLinkMode(range)
Set the open or close link modes.
void 
setName(newName)
Sets the name of the connection if it is not opened.
void 
setNoReverseConnectionTimeout(noReverseConnectionTimeout)
Sets a time (in milliseconds) how long connection will work without reverse connection.
void 
Updates the numeric constraint of this Fabric connection with the specified one.
void 
setReconnectAttempts(reconnectAttempts)
Sets a number of reconnect attempts that will be made by the Fabric Connection in a case of the remote node disconnection.
void 
setReconnectInterval(reconnectInterval)
Sets a time (in milliseconds) between successive reconnect attempts that will be made by the Fabric Connection in a case of the remote node disconnection.
void 
setRetriesInterval(retriesInterval)
Sets a time (in milliseconds) between unsuccessful requests retries.
void 
setRetriesMaxCount(retriesMaxCount)
Sets a count of unsuccessful request retries.
void 
setReverseConnectionHoldTimeout(reverseConnectionHoldTimeout)
Sets a time (in milliseconds) how long reverse connection will hold by the server.
void 
setServerConnectionLostSilentTimeout(serverConnectionLostSilentTimeout)
Sets a time (in milliseconds) how long server connection lost will not reported.
void 
setTimeout(timeout)
Sets the maximal time for waiting of a server reply.
void 
setUseApiKeyAuthentication(useApiKeyAuthentication)
Sets should be used api key authentication or not.
void 
touch(callback)
Sets the access time for this connection to the current time.
void 
Unbinds the specified event identifier from Fabric, so that it can't be raised via this connection.
Class Detail
HTTPFabricConnection(user, password, exceptionHandler, url)
Creates a connection to Fabric. This connection object is used for sending to and receiving events from Fabric. Each http-client can create only one such connection and typically should do it in the following way:
    // Create connection
    fabricConnection = new HTTPFabricConnection();
    // Login to Fabric
    fabricConnection.authenticate(username, password, applicationName).then(function(response){
         // authentication is ok, open the connection
         fabricConnection.open().then(function(){
             // connection successfully opened
         }, function(error)
         {
             // connection open error
         });
     },
     function(error) {
         // authentication error
     });
Parameters:
{String} user
The user name which will be used to login to Fabric and in each message to ensure that it belongs to an authorized user.
{String} password
The password which will be used to login to Fabric and in each message to ensure that it belongs to an authorized user.
{Function} exceptionHandler
If function callback used then exceptionHandler will be called with the exception object returned from the server for a previously called method. This parameter can be omitted in which case an exception is passed to the callback function if it is specified as the last parameter of the called method. The exception object can have detailMessage field, in which case it contains the error message. Otherwise the exception object is the error message itself. Here is an example of a correct exception handler:
            var alertExceptionHandler = function(exception)
            {
                if ((exception != null) && (exception.detailMessage != null))
                    alert(exception.detailMessage);
                else
                    alert("ERROR: " + exception);
            }
        
If function callback not specified and promise is used, exceptionHandler will be called if some errors occurred in resolve/reject methods.
{String} url
The url to be used in fabric requests. If this parameter is not null, then a cross-domain mechanism is used for all the requests. Otherwise all the requests are sent to the current host and an ajax mechanism is used. The port can be not specified, in which case the default one (port 80) is used. When specified the port should be separated from the host by ':'. Examples: 'streamscape.com:8080', 'streamscape.com', window.location.hostname + ':81', 'streamscape.com:' + window.location.port
Method Detail
acknowledgeEvent(event, withSourceData, action, recipientId, eventScope, timeToLive)
Raises the acknowledgement for the specified event. Its event id should be bound in Fabric (see HTTPFabricConnection#bindProducerFor).
Parameters:
{Event.AbstractDataEvent} event
The event for which the acknowledgement should be raised
{boolean} withSourceData
If this flag is true, then the acknowledgement will be filled with some data from the specified source event
{String} action
The action which is performed when the acknowledgement is raised. Possible values are:
  • ACKNOWLEDGE: The event is acknowledged and no further action is taken. If the event is queued up it is left on the queue.
  • ACKNOWLEDGE_AND_FORWARD: The event is acknowledged and is forwarded to its next destination specified by forwardTo field.
  • ACKNOWLEDGE_AND_DISCARD: The event is acknowledged and then discarded. If the event is queued up it is removed from the queue.
  • ACKNOWLEDGE_AND_EXPIRE: The event is acknowledged and then marked as expired. The actual usage is implementation specific.
  • ACKNOWLEDGE_UNDELIVERED: The event is acknowledged with UNDELIVERED status.
  • ACKNOWLEDGE_AND_SUSPEND: The event is acknowledged and the recipient should suspend all further processing of this eventId. The status does specify how or when processing resumes.
  • RESCIND: Resets the event's status to whatever it was prior to any processing, essentially marking the event as new. This action results in the event potentially being re-processed.
  • RESCIND_AND_FORWARD: Resets the event's status to whatever it was prior to any processing and forwards it to it's next destination specified by forwardTo field.
  • RESCIND_AND_DISCARD: Resets the event's status to whatever it was prior to any processing and marks it as discard-able. A discard-able datagram should be removed from the processing component or queue.
{String} recipientId
The identifier of the acknowledgement recipient.
{String} eventScope
The scope of the acknowledgement to be raised. See HTTPFabricConnection#getEventScope for possible event scope values.
{number} timeToLive
The time interval (in milliseconds) within that the acknowledgement persists (in a queue, cache or fabric buffer) before it will be discarded. Non-positive value implies ignoring of this parameter.

addEventCache(eventFilter, maxSize, thresholdAction)
Adds a new event cache of maxSize size for the events which satisfy the specified simple eventFilter. When the cache threshold (maxSize) is reached, thresholdAction is performed for any new event. The simple filter is any filter which doesn't contain '&' symbol. In case of a complex filter user can divide it into several simple ones and create a separate cache for each simple filter.
Parameters:
{String} eventFilter
The event filter of the cache. This filter is actually an event id mask, which defines what event id can have a cached event. See HTTPFabricConnection#createEventConsumer for details.
{number} maxSize
The cache size (maximum number of events contained in the cache). A negative value means an unlimited cache.
{String} thresholdAction
The action which is performed when the cache threshold (maxSize) is reached. Possible values are:
  • LRE_DISCARD: LRE (Least Recent Event) is removed from the cache and the new event is put to it
  • MRE_DISCARD: The new event (which is MRE - Most Recent Event) is discarded, i.e. is not put to the cache

bindProducerFor(eventId)
Binds the specified event identifier in Fabric, so that it can then be raised via this connection. If the identifier of the event being raised is not bound in Fabric then methods raiseEvent(), raiseRequest(), raiseAdvisory(), raiseAcknowledgement(), raiseException(), acknowledgeEvent(), Accessor.Service.invoke*() throw FabricUnboundEventException.
Parameters:
{String} eventId
The event identifier to be bound in Fabric

clear()
Clears this connection parameters. Clears the pending requests queue. Clears bound event ids, consumers, receivers and accessors lists. Sets 'opened' flag to 'false'.

close()
Performs logout procedure and closes the connection to Fabric.

{Constraint.DateRange} createDateRangeConstraint(rangeName, minValue, maxValue, eventScope)
Creates a new date range constraint for this Fabric connection. The specified name should be unique in the specified scope. Changing of the returned object doesn't have effect until HTTPFabricConnection#setDateRangeConstraint is called.
Parameters:
{String} rangeName
The name of the constraint to be created
{String} minValue
The left boundary of the range constraint to be created. The date format is 'MM.DD.YYYY HH:mm:ss'.
{String} maxValue
The right boundary of the range constraint to be created. The date format is 'MM.DD.YYYY HH:mm:ss'.
{String} eventScope
The data scope of the constraint to be created. Possible values: 'LOCAL' (the current component scope), 'OBSERVABLE' (the current Fabric node scope), 'GLOBAL' (the whole Fabric scope).
Returns:
The created constraint object

{Constraint.Domain} createDomainConstraint(domainName, eventScope)
Creates a new domain constraint for this Fabric connection. The specified name should be unique in the specified scope. Changing of the returned object doesn't have effect until HTTPFabricConnection#setDomainConstraint is called.
Parameters:
{String} domainName
The name of the domain constraint to be created
{String} eventScope
The data scope of the domain constraint to be created. Possible values: 'LOCAL' (the current component scope), 'OBSERVABLE' (the current Fabric node scope), 'GLOBAL' (the whole Fabric scope).
Returns:
The created domain constraint object

{EventConsumer} createEventAsyncConsumer(consumerName, listener, eventFilter, eventSelector, eventScope, noLocal)
Asynchronously creates a new asynchronous event consumer and adds this consumer to the connection dispatcher. Asynchronous consumer doesn't start working after it is created. User should start the consumer himself by calling EventConsumer#start() method.
The consumer should have a unique name within Fabric. This name can be used then to get this consumer. The created consumer consumes all the events which come within its eventScope and within the scope of this connection, and satisfy its eventFilter, eventSelector and noLocal flag (if it is true then 'LOCAL' scope is subtracted from the consumer scope).
Event filter is used to filter the events by event id. Event selector is used to select only necessary events depending on the values of its specific properties.
When an event satisfies all the consumer conditions, then the consumer listener's onEvent() method is called for this event.
Parameters:
{String} consumerName
The name of the consumer, which should be unique within Fabric
{EventListener} listener
The listener associated with the consumer. All the consumed events are processed by the listener's onEvent() method.
{String} eventFilter
The event filter of the consumer. This filter is actually an event id mask, which defines what event id can have a consumed event. See HTTPFabricConnection#createEventConsumer for details.
{String} eventSelector
The event selector of the consumer. Selector allows to specify almost any conditions on event properties' values which should be satisfied for an event to be consumed. See Selector for details.
{String} eventScope
The scope of the created consumer. See HTTPFabricConnection#getEventScope for possible event scope values.
{boolean} noLocal
If this flag is true, then the created consumer doesn't consume local events (events raised by this connection itself).
Returns:
{Promise} promise success response callback will be called with created consumer object on success, otherwise error callback will be called

{EventConsumer} createEventConsumer(consumerName, listener, eventFilter, eventSelector, eventScope, noLocal)
Asynchronously creates a new event consumer and adds this consumer to the connection's dispatcher. The consumer should have a unique name within Fabric. This name can be used then to get this consumer. The created consumer consumes all the events which come within its eventScope and within the scope of this connection, and satisfy its eventFilter, eventSelector and noLocal flag (if it is true then 'LOCAL' scope is subtracted from the consumer scope).
Event filter is used to filter the events by event id. Event selector is used to select only necessary events depending on the values of its specific properties.
When an event satisfies all the consumer conditions, then the consumer listener's onEvent() method is called for this event.
Parameters:
{String} consumerName
The name of the consumer, which should be unique within Fabric
{EventListener} listener
The listener associated with the consumer. All the consumed events are processed by the listener's onEvent() method.
{String} eventFilter
The event filter of the consumer. This filter is actually an event id mask, which defines what event id can have a consumed event.
Event id is divided into parts by symbol '.'. Symbols '*', '#', '!', '&' have special meaning for an event filter. Symbol '*' means any non-empty set of characters within the current part of the event id. Symbol '#' means any non-empty set of any characters (including event id parts delimiter '.'). Symbol '!' means any set of characters within the current part of the event id except the set of characters coming after this symbol till the end of the part. Symbol '&' means that this filter is satisfied by both: event ids, which satisfy the filter expression before this symbol; and event ids, which satisfy the filter expression after this symbol.
Examples:
Filter Satisfies Not satisfies
event.http.cli* 'event.http.clip', 'event.http.client', 'event.http.cliaaa', 'event.http.cli123' 'event.http.cli', 'event.http.client.me'
event.http.* 'event.http.a', 'event.http.abcd', 'event.http.client', 'event.http.abbccc' 'event.http.', 'event.http.a.b'
event.http.cli# 'event.http.clip', 'event.http.client', 'event.http.cli.a', 'event.http.client.me' 'event.http', 'event.http.cli'
event.http.!cli* 'event.http.cli', 'event.http.client.me', 'event.http.cli.a', 'event.http.cli.me' 'event.http.client', 'event.http.cli1'
event.http.!cli# 'event.http.cli', 'event.http.clnt', 'event.http.clnt.me', 'event.http' 'event.http.clip', 'event.http.cli.me'
event.http.c*&event.http.j# 'event.http.cl', 'event.http.client', 'event.http.js', 'event.http.java', 'event.http.j.ack', 'event.http.j.ack.ok' 'event.http.c', 'event.http.c.you', 'event.http.client.me', 'event.http', 'event.http.j'
# any event id no event ids

{String} eventSelector
The event selector of the consumer. Selector allows to specify almost any conditions on event properties' values which should be satisfied for an event to be consumed. See Selector for details.
{String} eventScope
The scope of the created consumer. See HTTPFabricConnection#getEventScope for possible event scope values.
{boolean} noLocal
If this flag is true, then the created consumer doesn't consume local events (events raised by this connection itself).
Returns:
{Promise} promise success response callback will be called with created consumer object on success, otherwise error callback will be called

{EventReceiver} createEventReceiver(receiverName, eventFilter, eventSelector, eventScope, noLocal, receiver)
Asynchronously creates a new event receiver and adds this receiver to the connection dispatcher. The receiver should have a unique name within Fabric. This name can be used then to get this receiver. Receiver doesn't start working after it is created. User should start the receiver himself by calling EventReceiver#open() method.
The created receiver receives all the events which come within its eventScope and within the scope of this connection, and satisfy its eventFilter, eventSelector and noLocal flag (if it is true then 'LOCAL' scope is subtracted from the consumer scope).
Event filter is used to filter the events by event id. Event selector is used to select only necessary events depending on the values of its specific properties.
When an event satisfies all the receiver conditions, it is put to the queue of this receiver. User can call receive() or receiveNoWait() method to get this event from the queue.
Parameters:
{String} receiverName
The name of the receiver, which should be unique within Fabric
{String} eventFilter
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} eventSelector
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.
{String} eventScope
The scope of the created receiver. See HTTPFabricConnection#getEventScope for possible event scope values.
{boolean} noLocal
If this flag is true, then the created receiver doesn't receive local events (events raised by this connection itself).
receiver
Returns:
The receiver object. In case of some error at server side the exception handler is called and this receiver object becomes invalid. Calling of its asynchronous methods will cause exceptions

{Constraint.NumericRange} createNumericRangeConstraint(rangeName, minValue, maxValue, eventScope)
Creates a new numeric range constraint for this Fabric connection. The specified name should be unique in the specified scope. Changing of the returned object doesn't have effect until HTTPFabricConnection#setNumericRangeConstraint is called.
Parameters:
{String} rangeName
The name of the constraint to be created
{number} minValue
The left boundary of the range constraint to be created
{number} maxValue
The right boundary of the range constraint to be created
{String} eventScope
The data scope of the constraint to be created. Possible values: 'LOCAL' (the current component scope), 'OBSERVABLE' (the current Fabric node scope), 'GLOBAL' (the whole Fabric scope).
Returns:
The created constraint object

{EventConsumer} createRequestConsumer(consumerName, listener, eventScope)
Asynchronously creates a new request event consumer and adds this consumer to the connection dispatcher. The consumer should have a unique name within Fabric. This name can be used then to get this consumer. The created consumer consumes the requests which come within its eventScope and within the scope of this connection, but without 'LOCAL' scope if noLocal flag is set to true.
When the request satisfies these conditions, the consumer listener's onEvent() method is called for this request. This method returns a reply event for the processed request. The reply is then returned to the entity which has raised the request (see HTTPFabricConnection#raiseRequest method).
Parameters:
{String} consumerName
The name of the consumer, which should be unique within Fabric
{EventListener} listener
The listener associated with the consumer. The consumed requests are processed by the listener's onEvent() method, which returns a reply event for each request event.
{String} eventScope
The scope of the created consumer. See HTTPFabricConnection#getEventScope for possible event scope values. It can't have 'LOCAL' value.
Returns:
{Promise} promise success response callback will be called with created consumer object on success, otherwise error callback will be called

{Accessor.Service} createServiceAccessor(serviceType, serviceName)
Asynchronously creates a service accessor object which can be used to access the specified service. The service will be looked up in the current node of the connection. This method is equivalent to createServiceAccessor(null, serviceType, serviceName).
Parameters:
{String} serviceType
The service type
{String} serviceName
The service name
Returns:
The accessor object. In case of some error at server side the exception handler is called and this accessor object becomes invalid. In this case calling of its asynchronous methods will cause exceptions.

{Accessor.Service} createServiceAccessorForNode(nodeName, serviceType, serviceName)
Asynchronously creates a service accessor object which can be used to access the specified service. The service will be looked up in the node with the specified name.
Parameters:
{String} nodeName
The node name where the service is looked up
{String} serviceType
The service type
{String} serviceName
The service name
Returns:
The accessor object. In case of some error at server side the exception handler is called and this accessor object becomes invalid. In this case calling of its asynchronous methods will cause exceptions.

{Promise} createSLSession(callback)
Asynchronously creates a semantic language session to the current node of the connection. This method is equivalent to createSLSession(null).
The created session object is passed to the specified callback function when it is returned from server side or to promise callback if callback function not specified.
Parameters:
{Function} callback
The callback function called with the created session object. (See HTTPFabricConnection for a callback description). Callback object type: 'SLSession'.
Returns:
{Promise} if callback not specified

{Promise} createSLSessionForNode(nodeName, callback)
Asynchronously creates a semantic language session to the node with the specified name.
The created session object is passed to the specified callback function when it is returned from server side.
Parameters:
{String} nodeName
The name of the node to which the session is created.
{Function} callback
The callback function called with the created session object. (See HTTPFabricConnection for a callback description). Callback object type: 'SLSession'.
Returns:
{Promise} if callback not specified

createUser()
Asynchronously creates a new user in Fabric with the specified user object: { name, password, description, domain, vCard}. name field is required. Main difference with HTTPFabricConnection.createUser - node url of connection will be used. If connection was authenticated with "anonymous" user and this user doesn't have permisson to create a new user or if a user with the specified name already exists in Fabric, then an exception is returned by the server. If a new user is created then the corresponding User object is passed to the specified callback function or to promise callback when it is returned from server side. (See SecurityManager#updateUser for 'Security.User' class description).
NOTE: The created user can't send any requests to Fabric because it doesn't have a fabric connection. Use SecurityManager#createUser and SecurityManager#lookupUser to get a fully functional Security.User object.
Parameters:
{String} user.name
Required. The name of the user to be created
{String} user.password
The password of the user to be created
{String} user.description
The description of the user to be created
{String} user.domain
The domain in which the user should be created. This parameter can be omitted in which case the default domain is used.
{Object} user.vcard
vCard as per RFC 6350

<static> HTTPFabricConnection.createUser(name, password, description, domain, callback, callback)
This method should be considered as deprecated due to its limitations and exists for backward compatibility. Use HTTPFabricConnection instance 'createUser' method if possible. var connection = new HTTPFabricConnection(...); connection.createUser(...); Below is documentation for old method. Asynchronously creates a new user in Fabric with the specified login name, password and description. If user "anonymous" used for creating new user doesn't have rights to create a new user or if a user with the specified name already exists in Fabric, then an exception is returned by the server. If a new user is created then the corresponding User object is passed to the specified callback function or to promise callback when it is returned from server side. (See SecurityManager#updateUser for 'Security.User' class description).
NOTE: The created user can't send any requests to Fabric because it doesn't have a fabric connection. Use SecurityManager#createUser and SecurityManager#lookupUser to get a fully functional Security.User object.
Parameters:
{String} name
The name of the user to be created
{String} password
The password of the user to be created
{String} description
The description of the user to be created
{String} domain
The domain in which the user should be created. This parameter can be omitted in which case the default domain is used.
{Function} callback
The callback function called with the created user object. (See HTTPFabricConnection for a callback description). Callback object type: Security.User. Note that the created user can't send any requests to Fabric because it doesn't have a fabric connection. Use SecurityManager#createUser and SecurityManager#lookupUser to get a fully functional Security.User object. If not specified promise callbacks will be used.
callback

dropConsumer(consumerName)
Drops the consumer with the specified name from the dispatcher. This method is used when it is not known if this consumer is a common event consumer, request consumer or asynchronous event consumer. It is a little bit slower than the concrete drop methods.
Parameters:
{String} consumerName
The name of the consumer to be dropped

dropDateRangeConstraint(rangeName, eventScope)
Drops the specified constraint of this Fabric connection
Parameters:
{String} rangeName
The name of the constraint to be dropped
{String} eventScope
The data scope of the constraint to be dropped. Possible values: 'LOCAL' (the current component scope), 'OBSERVABLE' (the current Fabric node scope), 'GLOBAL' (the whole Fabric scope).

dropDomainConstraint(domainName, eventScope)
Drops the specified domain constraint of this Fabric connection
Parameters:
{String} domainName
The name of the domain constraint to be dropped
{String} eventScope
The data scope of the domain constraint to be dropped. Possible values: 'LOCAL' (the current component scope), 'OBSERVABLE' (the current Fabric node scope), 'GLOBAL' (the whole Fabric scope).

dropEventAsyncConsumer(consumerName)
Drops the asynchronous event consumer with the specified name from the dispatcher
Parameters:
{String} consumerName
The name of the consumer to be dropped

dropEventConsumer(consumerName)
Drops the event consumer with the specified name from the dispatcher
Parameters:
{String} consumerName
The name of the consumer to be dropped

dropEventReceiver(receiverName, withoutInvoke)
Drops the receiver with the specified name from the dispatcher
Parameters:
{String} receiverName
The name of the receiver to be dropped
withoutInvoke

dropNumericRangeConstraint(rangeName, eventScope)
Drops the specified constraint of this Fabric connection
Parameters:
{String} rangeName
The name of the constraint to be dropped
{String} eventScope
The data scope of the constraint to be dropped. Possible values: 'LOCAL' (the current component scope), 'OBSERVABLE' (the current Fabric node scope), 'GLOBAL' (the whole Fabric scope).

dropRequestConsumer(consumerName)
Drops the request consumer with the specified name from the dispatcher
Parameters:
{String} consumerName
The name of the consumer to be dropped

<static> {String} HTTPFabricConnection.getAcceptorName()
Returns HTTP Acceptor name
Returns:
Acceptor name

{Security.ClientId} getClientId()
Returns the client id of this fabric connection
Returns:
The client id of this connection

getConnectionReopenInterval(connectionReopenInterval)
Returns a time (in milliseconds) between failed connection reopen attempts. Default value is 30000ms.
Parameters:
{number} connectionReopenInterval
the value to be set in milliseconds.

{Constraint.DateRange} getDateRangeConstraint(rangeName, eventScope)
Returns the date constraint with the specified name and scope
Parameters:
{String} rangeName
The name of the date constraint to be returned
{String} eventScope
The data scope of the constraint to be returned. Possible values: 'LOCAL' (the current component scope), 'OBSERVABLE' (the current Fabric node scope), 'GLOBAL' (the whole Fabric scope).
Returns:
The constraint of this connection, which has the specified name and scope

{String} getDescription()
Returns the description of this fabric connection
Returns:
The description of this connection

{Constraint.Domain} getDomainConstraint(domainName, eventScope)
Returns the domain constraint with the specified name and scope
Parameters:
{String} domainName
The name of the domain constraint to be returned
{String} eventScope
The data scope of the domain constraint to be returned. Possible values: 'LOCAL' (the current component scope), 'OBSERVABLE' (the current Fabric node scope), 'GLOBAL' (the whole Fabric scope).
Returns:
The domain constraint of this connection, which has the specified name and scope

{Accessor.DropBox} getDropBoxAccessor()
Returns new Accessor.DropBox object which can be used for using dropbox features. See Accessor.DropBox for more information.
Returns:
A new Accessor.DropBox object

{EventConsumer} getEventAsyncConsumer(consumerName)
Finds and returns the asynchronous event consumer with the specified name
Parameters:
{String} consumerName
The name of the consumer to be returned
Returns:
The found consumer or null if no consumer is found

{EventConsumer} getEventConsumer(consumerName)
Finds and returns the event consumer with the specified name
Parameters:
{String} consumerName
The name of the consumer to be returned
Returns:
The found consumer or null if no consumer is found

{EventDatagramFactory} getEventDatagramFactory()
Returns new EventDatagramFactory object which is used for creating events and acknowledgements. See EventDatagramFactory for more information.
Returns:
A new EventDatagramFactory object

{EventReceiver} getEventReceiver(receiverName)
Finds and returns the receiver with the specified name
Parameters:
{String} receiverName
The name of the receiver to be returned
Returns:
The found receiver or null if no receiver is found

{String} getEventScope()
Returns the event scope of the connection. Possible values are:
Returns:
The event scope of the connection (it can be null if it is not opened yet)

{FabricAddress} getFabricAddress()
Returns the Fabric address of the connection. This address contains domain, cluster, node and component fields.
Returns:
The address of this connection component in Fabric if the connection is already opened and null otherwise.

{Accessor.File} getFileSpaceAccessor()
Returns new Accessor.File object which can be used for getting files base64 content and raising file events. See Accessor.File for more information.
Returns:
A new Accessor.File object

{String} getHttpSessionId()
Returns the identifier of http-session generated for this connection. This identifier is generated by the browser randomly.
Returns:
Http-session identifier

{Moderator} getModerator()
Returns new Moderator object which can be used for getting different information about the connected Fabric node, its consumer, producers and so on. See Moderator for more information.
Returns:
A new Moderator object

{String} getName()
Returns the name of this fabric connection. The name is given automatically to the connection when it is opened (see HTTPFabricConnection#open). The name can also be set (see HTTPFabricConnection#setName) directly before calling open() method.
Returns:
The name of this connection (it can be null if it is not opened yet)

getNoReverseConnectionTimeout()
Returns a time (in milliseconds) how long connection will work without reverse connection.
Returns:
number in milliseconds

{Constraint.NumericRange} getNumericRangeConstraint(rangeName, eventScope)
Returns the numeric constraint with the specified name and scope
Parameters:
{String} rangeName
The name of the numeric constraint to be returned
{String} eventScope
The data scope of the constraint to be returned. Possible values: 'LOCAL' (the current component scope), 'OBSERVABLE' (the current Fabric node scope), 'GLOBAL' (the whole Fabric scope).
Returns:
The constraint of this connection, which has the specified name and scope

<static> {Array} HTTPFabricConnection.getOrganizations()
Returns the organizations list of the Fabric Runtime
Returns:
organizations list

getReconnectAttempts()
Returns a number of reconnect attempts that will be made by the Fabric Connection in a case of the remote node disconnection.

Value 0 means that the connection will not attempt to reconnect.
Negative value means that the connection will try to reconnect infinitely (until successful connecting).
Default value is -1 that means to reconnect infinitely.

Returns:
the number of reconnect attempts.

getReconnectInterval()
Returns a time (in milliseconds) between successive reconnect attempts that will be made by the Fabric Connection in a case of the remote node disconnection.

Default value is 2000 millisecond.

Returns:
number time interval (in milliseconds) between reconnect attempts.

{EventConsumer} getRequestConsumer(consumerName)
Finds and returns the request consumer with the specified name
Parameters:
{String} consumerName
The name of the consumer to be returned
Returns:
The found consumer or null if no consumer is found

getRetriesInterval(a)
Returns a time (in milliseconds) between unsuccessful requests retries.
Parameters:
a
time in milliseconds.

getRetriesMaxCount()
Returns a count of unsuccessful request retries.
Returns:
number max count

getReverseConnectionHoldTimeout(reverseConnectionHoldTimeout)
Returns a time (in milliseconds) how long reverse connection will hold by the server.
Parameters:
reverseConnectionHoldTimeout
Returns:
the time (in milliseconds) how long reverse connection will hold by the server.

<static> {String} HTTPFabricConnection.getRuntimeVersion()
Returns the version of the Fabric Runtime
Returns:
Runtime version

{SecurityManager} getSecurityManager()
Returns new SecurityManager object which can be used for managing users, groups and other security stuff. See SecurityManager for more information.
Returns:
A new SecurityManager object

getServerConnectionLostSilentTimeout()
Returns a time (in milliseconds) how long server connection lost will not reported.
Returns:
number time (in milliseconds)

{int} getServerTimeZoneOffset()
Returns the TimeZone Offset of this fabric connection in minutes
Returns:
The timeZone offset in minutes (i.e. -180);

{Accessor.Service} getServiceAccessor(service)
Asynchronously creates an accessor object to the specified service. If an accessor to this service have already been created, then it is returned.
Parameters:
{String} service
The full name of the service: <service type>.<service name>
Returns:
The accessor object. In case of some error at server side the exception handler is called and this accessor object becomes invalid. In this case calling of its asynchronous methods will cause exceptions.

{Accessor.Service} getServiceAccessorForNode(nodeName, service)
Asynchronously creates an accessor object to the specified service on the specified Fabric node. If an accessor to this service have already been created, then it is returned.
Parameters:
{String} nodeName
The node name where the dataspace is looked up
{String} service
The full name of the service: <service type>.<service name>
Returns:
The accessor object. In case of some error at server side the exception handler is called and this accessor object becomes invalid. In this case calling of its asynchronous methods will cause exceptions.

{ConnectionStatistics} getStatistics()
Returns fabric conneciton statistics.
Returns:
{ConnectionStatistics}

<static> {String} HTTPFabricConnection.getSysplexDomain()
Returns the Domain of the Fabric Runtime
Returns:
Domain name

{int} getTimeout()
Returns the http timeout.
Returns:
{int} timeout in milliseconds

{string} getTimeZoneDisplayName()
Returns the TimeZone Display Name of this fabric connection in minutes
Returns:
The timeZone Display Name in minutes (i.e. Moscow Standard Time);

{String} getType()
Returns the type of the connection. This connection has 'Client_HTTP' type. Other types of fabric connection are 'Client_SLANG', 'Client_REST'.
Returns:
The type of this connection which is 'Client_HTTP'.

{String} getURL()
Returns the URL of the connection.
Returns:
The URL of this connection.

{String} getUserName()
Returns the login name for this connection
Returns:
The name of the user who is logged in to Fabric via this connection

<static> {String} HTTPFabricConnection.getVersion()
Returns the version of the Javascript API
Returns:
Javascript API version

{boolean} hasBoundEventIds()
Checks if this connection has some bound event identifiers (see HTTPFabricConnection#bindProducerFor).
Returns:
True if this connection has some bound event ids, false otherwise

<static> {Promise} HTTPFabricConnection.initStatics(url)
Asynchronously initializes sysplex domain, runtime version and organizations list.
Parameters:
url
Returns:
{Promise}

{boolean} isBoundEventId(eventId)
Checks if the specified event identifier is bound in Fabric (see HTTPFabricConnection#bindProducerFor).
Parameters:
{String} eventId
The event identifier to be checked
Returns:
boolean if eventId is bound for this connection in Fabric, and false otherwise

{boolean} isOpened()
Returns whether this connection is opened or not.
Returns:
True if this connection is opened and false otherwise

{boolean|*} isUseApiKeyAuthentication()
Returns if api key authentication should be used or not. If set to false default acceptor authentication will be used. If set to true api key authentication will be used if it is enabled in acceptor.
Returns:
{boolean|*}

{String[]} listBoundEventIds()
Returns a list of all the event identifiers bound in Fabric for this connection (see HTTPFabricConnection#bindProducerFor).
Returns:
A list of the bound event ids for this connection

listEventAsyncConsumers(callback)
Asynchronously returns a list of all the event async consumers of this connection. The list is passed to the specified callback function when it is returned from server side.
Parameters:
{Function} callback
The callback function called with the list of consumers. (See HTTPFabricConnection for a callback description). Callback object type: {String[]}.

listEventConsumers(callback)
Asynchronously returns a list of all the event consumers of this connection. The list is passed to the specified callback function when it is returned from server side.
Parameters:
{Function} callback
The callback function called with the list of consumers. (See HTTPFabricConnection for a callback description). Callback object type: {String[]}.

listEventReceivers(callback)
Asynchronously returns a list of all the event receivers of this connection. The list is passed to the specified callback function when it is returned from server side.
Parameters:
{Function} callback
The callback function called with the list of receivers. (See HTTPFabricConnection for a callback description). Callback object type: {String[]}.

<static> HTTPFabricConnection.listOrganizations(callback, url)
Asynchronously gets organizations list.
Parameters:
{Function} callback
The callback function called with the organizations list. (See HTTPFabricConnection for a callback description). Callback object type: String[].
url

listRequestConsumers(callback)
Asynchronously returns a list of all the request consumers of this connection. The list is passed to the specified callback function when it is returned from server side.
Parameters:
{Function} callback
The callback function called with the list of consumers. (See HTTPFabricConnection for a callback description). Callback object type: {String[]}.

{Promise} open(noReverse)
Asynchronously opens this connection to Fabric.
Note that the connection is opened asynchronously, which means that it remains not opened in the calling method and all the upper methods in the calling hierarchy. Any synchronous methods which return the parameters, set after the connection opening, can't be called right after the open() call. However all the asynchronous methods can be called safely in any place after open(). For calling synchronous methods promise callbacks should be used. Here is an example:

    function exceptionHandler(exception)
    {
      console.log("Unhandled Exception during open callbacks");
      console.log(exception);
    }

    function onEvent(event)
    {
        alert(Utilities.encode(event));
    }

    connection = new HTTPFabricConnection(exceptionHandler);
    connection.open().then(function(response){
      var time = (new Date()).getTime();
      var uniqueName = 'TestConsumer_' + time + '_' + Math.random();
      var listener = new EventListener(onEvent);
      consumer = connection.createEventAsyncConsumer(uniqueName, listener,
          'event.test.notify', null, 'INHERITED', false);
      consumer.start();
    },
    function(exception)
    {
      console.log("Open failed");
      console.log(exception);
    });


In case of an error an exception object is returned from the server it will be passed to promise exception handler.
Parameters:
{boolean} noReverse
If this parameter is specified and set to true, then no reverse connection is opened with Fabric. It means that no consumers can be created because consumers get events via a reverse connection from Fabric. If no events consuming is needed then this parameter should be set to true to save cpu and memory resources.
Returns:
{Promise}

ping(callback)
Keeps the http-connection alive. If no data is sent or received via the connection during the connection keep alive timeout (10 seconds by default), then http-server closes the http-connection associated with this connection to Fabric. String 'AVAILABLE' is passed to the specified callback function when it is returned from server side. If the server doesn't respond during the timeout (see HTTPFabricConnection.setTimeout) then a callback function is called with 'null' response and 'success' set to 'false': callback(null, sequenceId, false).
Parameters:
{Function} callback
The callback function called with 'AVAILABLE' string. (See HTTPFabricConnection for a callback description). Callback object type: {String}.

{Promise} raiseAcknowledgement(event, eventScope, timeToLive)
Raises the specified acknowledgement event. Its event id should be bound in Fabric (see HTTPFabricConnection#bindProducerFor).
Parameters:
{Event.AcknowledgementEvent} event
The acknowledgement event to be raised
{String} eventScope
The scope of the event to be raised. See HTTPFabricConnection#getEventScope for possible event scope values.
{number} timeToLive
The time interval (in milliseconds) within that the event persists (in a queue, cache or fabric buffer) before it will be discarded. Non-positive value implies ignoring of this parameter.
Returns:
{Promise} if callback not specified

{Promise} raiseAdvisory(event, eventScope)
Raises the specified advisory event. Its event id should be bound in Fabric (see HTTPFabricConnection#bindProducerFor).
Parameters:
{advisory} event
The advisory event to be raised.
{String} eventScope
The scope of the event to be raised. See HTTPFabricConnection#getEventScope for possible event scope values.
Returns:
{Promise}

{Promise} raiseDirectRequest(consumerName, request, timeout, callback)
Asynchronously sends the specified request event directly to the specified request consumer and waits for its reply for timeout milliseconds. Its request event id should be bound in Fabric (see HTTPFabricConnection#bindProducerFor).
The reply event for this request is passed to the specified callback function when it is returned from server side. If callback not specified promise is returned.
Parameters:
{String} consumerName
The name of the consumer to which the request is raised
{Event.AbstractDataEvent} request
The request event to be sent
{number} timeout
The time (in milliseconds) of waiting for the reply. Non-positive value is considered as eternal timeout.
{Function} callback
The callback function called with the reply event object. (See HTTPFabricConnection for a callback description). Callback object type: Event.AbstractDataEvent
Returns:
{Promise} if callback not specified

{Promise} raiseEvent(event, eventScope, timeToLive)
Raises the specified event. Its event id should be bound in Fabric (see HTTPFabricConnection#bindProducerFor).
Parameters:
{Event.AbstractDataEvent} event
The event to be raised.
{String} eventScope
The scope of the event to be raised. See HTTPFabricConnection#getEventScope for possible event scope values.
{number} timeToLive
The time interval (in milliseconds) within that the event persists (in a queue, cache or fabric buffer) before it will be discarded. Non-positive value implies ignoring of this parameter.
Returns:
{Promise} if callback not specified

raiseException(event, eventScope)
Raises the specified exception event. Its event id should be bound in Fabric (see HTTPFabricConnection#bindProducerFor).
Parameters:
{Event.ExceptionEvent} event
The exception event to be raised
{String} eventScope
The scope of the event to be raised. See HTTPFabricConnection#getEventScope for possible event scope values.

raiseRequest(request, eventScope, distributionStrategy, matchStrategy, timeout, callback)
Asynchronously raises the specified non-direct request event to Fabric and waits for its acknowledgement for timeout milliseconds. Its event id should be bound in Fabric (see HTTPFabricConnection#bindProducerFor). The request is raised as a common event and can be consumed by several non-direct consumers. Consumers process this event and then raise an acknowledgement event to Fabric. Only one acknowledgement is returned from the server according to the specified distributionStrategy. If matchStrategy is equal to 'REPLY_WITH_CORRELATION_ID' then only acknowledgements with the correlationId equal to the request correlationId are considered. The acknowledgement eventId should be equal to the request replyTo field if the latter is present.
The acknowledgement event for this request is passed to the specified callback function when it is returned from server side.
Parameters:
{Event.AbstractDataEvent} request
The request event to be raised
{String} eventScope
The scope of the event to be raised. See HTTPFabricConnection#getEventScope for possible event scope values.
{String} distributionStrategy
The strategy which defines to what consumer or consumers the request event will be distributed and what reply will be returned to the caller. Possible values are:
  • AUCTION: The first reply received from all the appropriate consumers is returned to the caller
  • FAIR: Not supported currently
  • WEIGHTED: Not supported currently
  • CYCLIC: Not supported currently
{String} matchStrategy
The strategy which defines what consumers' acknowledgements fit the raised request. Possible values are:
  • REPLY_TO: The acknowledgement eventId should be equal to the request replyTo field if the latter is present.
  • REPLY_WITH_CORRELATION_ID: Except the replyTo field the correlationId of the acknowledgement should be equal to the request correlationId.
{number} timeout
The time (in milliseconds) of waiting for the reply. Non-positive value is considered as eternal timeout.
{Function} callback
The callback function called with the acknowledgement event. (See HTTPFabricConnection for a callback description). Callback object type: Event.AcknowledgementEvent

removeEventCache(eventFilter)
Removes the event cache defined by the specified simple event filter.
Parameters:
{String} eventFilter
The event filter of the cache. This filter is actually an event id mask, which defines what event id can have a cached event. See HTTPFabricConnection#createEventConsumer for details.

setClientId(clientId)
Sets the client id (see Security.ClientId) for the connection if it is not opened. Does nothing if the connection is already opened.
Parameters:
{Security.ClientId} clientId
The client id to be set for this connection
Returns:
The new client id if the connection isn't opened or null otherwise

setConnectionReopenInterval(connectionReopenInterval)
Sets a time (in milliseconds) between failed connection reopen attempts. Default value is 30000ms.
Parameters:
{number} connectionReopenInterval
the value to be set in milliseconds.

setDateRangeConstraint(range)
Updates the date constraint of this Fabric connection with the specified one.
Parameters:
{Constraint.DateRange} range
The date constraint to be set for this Fabric connection

setDescription(description)
Sets the description of the connection if it is not opened. Does nothing if the connection is already opened. The description should be not more than 20 symbols long.
Parameters:
{String} description
The description to be set for this connection
Returns:
The new description if the connection is not opened and the description is not more than 20 symbols long or null otherwise

setDomainConstraint(domain)
Updates the domain constraint of this Fabric connection with the specified one.
Parameters:
{Constraint.Domain} domain
The domain constraint to be set for this Fabric connection

setEventScope(eventScope)
Sets the event scope of this connection (see HTTPFabricConnection#getEventScope for possible event scope values). The scope is set only if the connection is not opened.
Parameters:
{String} eventScope
The event scope to be set for this connection
Returns:
The new event scope if the connection is not opened or null otherwise.

setLeasePeriod(lease)
Sets the lease period for this connection. The lease period is the time interval after which the server closes the connection if there has been no activity. The lease period can be set only for a not-opened connection. For an opened connection the new lease period will be set only after its closing and then reopening. Value -1 means lease period equals to server session timeout.
Parameters:
{number} lease
The lease period in milliseconds which should be set for this connection. The default value is 300000 (5 minutes).

setLinkMode(range)
Set the open or close link modes. By default the open link mode is 'START' and the close link mode is 'STOP'.
The possible values for open link mode are: The possible values for close link mode are: To set both open and close link modes this method should be called twice as in the example:
   connection.setLinkMode('ATTACH');
   connection.setLinkMode('DETACH');
Parameters:
{Constraint.DateRange} range
The date constraint to be set for this Fabric connection

setName(newName)
Sets the name of the connection if it is not opened. Does nothing if the connection is already opened.
Parameters:
{String} newName
The name to be set for this connection
Returns:
The new connection name if it is not opened or null if it is

setNoReverseConnectionTimeout(noReverseConnectionTimeout)
Sets a time (in milliseconds) how long connection will work without reverse connection.

Value less or equals to 0 means that connection will work without reverse connection. Default value is 5 minutes.

Parameters:
{number} noReverseConnectionTimeout
the value to be set.

setNumericRangeConstraint(range)
Updates the numeric constraint of this Fabric connection with the specified one.
Parameters:
{Constraint.NumericRange} range
The numeric constraint to be set for this Fabric connection

setReconnectAttempts(reconnectAttempts)
Sets a number of reconnect attempts that will be made by the Fabric Connection in a case of the remote node disconnection.

Value 0 means that the connection will not attempt to reconnect.
Negative value means that the connection will try to reconnect infinitely (until successful connecting).
Default value is -1 that means to reconnect infinitely.

Parameters:
{number} reconnectAttempts
the value to be set.

setReconnectInterval(reconnectInterval)
Sets a time (in milliseconds) between successive reconnect attempts that will be made by the Fabric Connection in a case of the remote node disconnection.

Default value is 2000 millisecond.

Parameters:
{number} reconnectInterval
the value to be set.

setRetriesInterval(retriesInterval)
Sets a time (in milliseconds) between unsuccessful requests retries. Default value is 100 milliseconds.
Parameters:
{number} retriesInterval
the value to be set.

setRetriesMaxCount(retriesMaxCount)
Sets a count of unsuccessful request retries. Request will be retried if retriesMaxCount > 0 and retries count < retriesMaxCount and server returned status != 200 and connection was not time outed. Value less or equal to 0 means no retries. Default value is 2.
Parameters:
{number} retriesMaxCount
the value to be set.

setReverseConnectionHoldTimeout(reverseConnectionHoldTimeout)
Sets a time (in milliseconds) how long reverse connection will hold by the server. Default is 10000 milliseconds.
Parameters:
{number} reverseConnectionHoldTimeout
the value to be set.

setServerConnectionLostSilentTimeout(serverConnectionLostSilentTimeout)
Sets a time (in milliseconds) how long server connection lost will not reported. Default value is 0 means that server connection lost will be reported as soon as detected.
Parameters:
{number} serverConnectionLostSilentTimeout
the value to be set.

setTimeout(timeout)
Sets the maximal time for waiting of a server reply. For any request after the timeout is expired the provided callback function (if some) is called with 'null' response and 'success' flag set to 'false': callback(null, sequenceId, false).
If callback is not specified promise error callback will be called with timeout exception and timeouted flag set to true. Default value is 30000 milliseconds.
Parameters:
{number} timeout
The maximal time in milliseconds for which a server reply is waited

setUseApiKeyAuthentication(useApiKeyAuthentication)
Sets should be used api key authentication or not. If set to false default acceptor authentication will be used. If set to true api key authentication will be used if it is enabled in acceptor.
Parameters:
useApiKeyAuthentication

touch(callback)
Sets the access time for this connection to the current time. This method is used to prevent the connection closing because of the lease period expiration (5 minutes by default). An empty string answer is passed to the specified callback function when it is returned from server side. If the server doesn't respond during the timeout (see HTTPFabricConnection.setTimeout) then a callback function is called with 'null' response and 'success' set to 'false': callback(null, sequenceId, false).
Parameters:
{Function} callback
The callback function called with an empty string answer. (See HTTPFabricConnection for a callback description). Callback object type: {String}.

unbindProducerFor(eventId)
Unbinds the specified event identifier from Fabric, so that it can't be raised via this connection. If the identifier of the event being raised is not bound in Fabric then methods raiseEvent(), raiseRequest(), raiseAdvisory(), raiseAcknowledgement(), raiseException(), acknowledgeEvent() throw FabricUnboundEventException.
Parameters:
{String} eventId
The event identifier to be unbound from Fabric

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