Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Client

Hierarchy

  • Client

Index

Constructors

constructor

  • new Client(name?: string): Client
  • Parameters

    • Optional name: string

      Unique name for the client (important for queues and sow). It is strongly recommended to set a client name, but if it's not set, it'll be assigned automatically.

    Returns Client

Methods

ack

  • ack(message: Message, options?: string): void
  • ack(topic: string, bookmark: string, options?: string): void
  • This method ACKs a message queue message using the message object.

    client.ack(queueMessage);
    

    Parameters

    • message: Message

      AMPS message object.

    • Optional options: string

      A comma separated list of values indicating additional options, such as cancel, expire, or lease_extension=60s.

    Returns void


  • This method ACKs a message queue message using the topic and bookmark values.

    client.ack('queue-topic', '12290412031115262887|1484244707000000008|');
    

    Parameters

    • topic: string

      The topic of the message to ack.

    • bookmark: string

      The bookmark of the message to ack.

    • Optional options: string

      A comma separated list of values indicating additional options, such as cancel, expire, or lease_extension=60s.

    Returns void

ackBatchSize

  • ackBatchSize(): number
  • ackBatchSize(ackBatchSize: number): Client
  • This method is a setter/getter for the acknowledgement batch size of the client.

    Batching acknowledgements reduces the number of round-trips to AMPS, which reduces network traffic and improves overall performance. AMPS sends the batch of acknowledgements when the number of acknowledgements exceeds a specified size. By default, if not specified otherwise, it is equal to 0. If the batch size value is greater than 1, the automatic ack timeout will be assigned with the default value of 1000 ms, if not already set. To override this behavior and disable ack timeouts with the batch size > 1, explicitly set ack timeout value to 0 after setting the batch size.

    // create a client and assign a publish store to it
    var client = new amps.Client().ackBatchSize(100);
    
    // ... get the ack batch size later
    if (client.ackBatchSize() > 10) { ... }
    

    Returns number

    The client if a setter is called. The acknowledgement batch size otherwise.

  • Parameters

    • ackBatchSize: number

    Returns Client

ackTimeout

  • ackTimeout(): number
  • ackTimeout(ackTimeout: number): Client
  • This method is a setter/getter for the acknowledgement batch timeout of the client.

    Batching acknowledgements reduces the number of round-trips to AMPS, which reduces network traffic and improves overall performance. AMPS sends the batch of acknowledgements when the amount of time since the last batch was sent exceeds a specified timeout.

    // create a client and assign a acknowledgment batch timeout to it
    var client = new amps.Client().ackTimeout(100);
    
    // ... get the ack batch timeout later
    if (client.ackTimeout() > 1000) { ... }
    

    Returns number

    The client if a setter is called. The acknowledgement batch timeout value (if any) otherwise.

  • Parameters

    • ackTimeout: number

    Returns Client

addConnectionStateListener

  • addConnectionStateListener(connectionStateListener: function): number
  • This method adds a connection state listener that will be called every time a connection state has been changed.

    var client = new amps.Client();
    var listenerId = client.addConnectionStateListener(function(state) {
        console.log('state: ', state);
    });
    
    // ... later
    client.removeConnectionStateListener(listenerId);
    

    Parameters

    • connectionStateListener: function

      The callback function that will be invoked in case of a connection state change.

        • (connectionState: number): void
        • Parameters

          • connectionState: number

          Returns void

    Returns number

    The unique monotonically increasing listener id that can be used to remove the listener later.

autoAck

  • autoAck(): boolean
  • autoAck(autoAck: boolean): Client
  • This method is a setter/getter for the autoAck option of the client. The AMPS client allows you to specify that messages should be automatically acknowledged. When this mode is on, AMPS acknowledges the message automatically if the message handler returns without throwing an exception. It is false by default.

    // create a client and set autoAck to true
    var client = new amps.Client().autoAck(true);
    
    // ... check the autoAck option value later
    if (client.autoAck() === true) { ...  }
    

    Returns boolean

    The client if a setter is called. The autoAck otion value otherwise.

  • Parameters

    • autoAck: boolean

    Returns Client

bookmarkStore

  • This method is a setter/getter for the BookmarkStore object of the client. BookmarkStore interface is being used to to provide resumable subscriptions and client-side duplicate message handling.

    // create a client and assign a bookmark store to it
    var bookmarkStore = new amps.MemoryBookmarkStore();
    var client = new amps.Client().bookmarkStore(bookmarkStore);
    
    // ... access the bookmark store later
    client.bookmarkStore().purge();
    

    Returns BookmarkStore

    The client if a setter is called. The BookmarkStore object (if any) otherwise.

  • Parameters

    Returns Client

connect

  • This method connects the AMPS client to the server. It automatically calls logon() upon successful connection. If the ServerChooser is set, arguments are ignored.

    var client = new amps.Client('my-application');
    
    client.connect('ws://localhost:9100/amps/json')
        .then(function() {
            // now the client is ready to send and receive any commands
            // ...
        })
        .catch(function(err) {
            console.error('Connection error: ', err);
        });
    

    Parameters

    • Optional uri: string

      The URI containing all required credentials/addresses/types.

    • Optional authenticator: Authenticator

      The authenticator object for custom authentication scenarios. See Authenticator for details.

    • Optional logonOptions: string

      The logon options, such as pretty`.

    Returns Promise<Message>

    The promise object with the result of fullfilling/failing the connection promise.

delayStrategy

  • This method is a setter/getter for the DelayStrategy object of the client. AMPS provides FixedDelayStrategy and ExponentialDelayStrategy strategies that are used to define a delay between reconnection attempts. It is possible to implement a custom DelayStrategy. If it is not set, but the server chooser is used, the client will use ExponentialDelayStrategy with default settings.

    // create a client and assign a delay strategy to it
    var strategy = new amps.ExponentialDelayStrategy();
    var client = new amps.Client().delayStrategy(strategy);
    
    // ... access the delay strategy object later
    client.delayStrategy().reset();
    

    Returns DelayStrategy

    The client if a setter is called. The DelayStrategy object (if any) otherwise.

  • Parameters

    Returns Client

deltaPublish

  • deltaPublish(topic: string, data: any, params?: CommandParams): void
  • This method delta publishes a message to a SOW topic.

    client.deltaPublish('topic', {id: 1, text: 'Hello, World'});
    

    Parameters

    • topic: string

      the topic to publish data.

    • data: any

      the data to publish to a topic.

    • Optional params: CommandParams

      an object with params, like: {expiration: 30, ...}

    Returns void

deltaSubscribe

  • deltaSubscribe(onMessage: function, topic: string, filter?: string, params?: CommandParams): Promise<string>
  • This method performs the delta_subscribe command. The delta_subscribe command is like the subscribe command except that subscriptions placed through delta_subscribe will receive only messages that have changed between the SOW record and the new update. If delta_subscribe is used on a record which does not currently exist in the SOW or if it is used on a topic which does not have a SOW-topic store defined, then delta_subscribe behaves like a subscribe command.

    client.deltaSubscribe(function(message) { ... }, 'topic')
        .then(function(subId) { console.log(subId); })
        .catch(function(err) { console.error('err: ', err); });
    

    Parameters

    • onMessage: function

      a message handler that will be called each time a message is received.

    • topic: string

      The topic argument in sow.

    • Optional filter: string

      The filter argument in sow.

    • Optional params: CommandParams

      The params like ackType, bookmark, commandId, etc in an object.

    Returns Promise<string>

    The Promise object with the results of execution of the command.

disconnect

  • disconnect(): Promise<any>
  • This method disconnects the client from an AMPS server (if the connection existed).

    Returns Promise<any>

    The promise object.

disconnectHandler

  • disconnectHandler(): function
  • disconnectHandler(disconnectHandler: function): Client
  • This method sets/gets the disconnect handler that is in case of an unintentional disconnection.

    var disconnectHandler = function(client, err) {
        // when the Client unintentionally disconnects, this method is invoked.
        console.error('err: ', err);
    };
    
    var client = new amps.Client().disconnectHandler(disconnectHandler);
    

    Returns function

    The client if a setter called, the disconnect handler (if any) otherwise.

      • (client: Client, error: Error): void
      • Parameters

        Returns void

  • Parameters

    • disconnectHandler: function
        • (client: Client, error: Error): void
        • Parameters

          Returns void

    Returns Client

errorHandler

  • errorHandler(): function
  • errorHandler(errorHandler: function): Client
  • This method sets/gets the error handler for all general errors such as connection issues, exceptions, etc.

    var client = new amps.Client().errorHandler(function(err) {
        console.error('err: ', err);
    });
    

    Returns function

    The client if a setter called, the error handler (if any) otherwise.

      • (error: Error): void
      • Parameters

        • error: Error

        Returns void

  • Parameters

    • errorHandler: function
        • (error: Error): void
        • Parameters

          • error: Error

          Returns void

    Returns Client

execute

  • execute(command: Command, handler?: function, timeout?: number): Promise<string>
  • This is the command execution interface method that allows to send commands that don't have a convenience method or require additional settings that are not provided by the convenience methods. The purpose of the method is to execute Command objects.

    var subscribeCommand = new amps.Command('subscribe')
      .topic('messages')
      .filter('/id > 20');
    
    client.execute(subscribeCommand, function(message) {
        console.log('message: ', message.data);
    }).then(function(commandId) {
        console.log('commandId: ', commandId);
    });
    

    Parameters

    • command: Command

      a Command object.

    • Optional handler: function

      a callback to report the messages (including ack messages if they were requested).

    • Optional timeout: number

      a timeout value for the command execution in milliseconds.

    Returns Promise<string>

    The promise object fullfilled with the command id created.

flush

  • flush(timeout?: number): Promise<__type>
  • This method performs the flush command. It sends a command to AMPS that returns an acknowledgement when all previous messages from this client have been received and processed. This command helps applications that use AMPS determine when AMPS has received all of the messages that have been sent, making it safe for the client to exit.

    client.publish('topic', {id: 1});
    client.publish('topic', {id: 2});
    client.flush().then(...).catch(...);
    

    Parameters

    • Optional timeout: number

      the flush timeout in milliseconds.

    Returns Promise<__type>

    The Promise object with the results of execution of the command.

heartbeat

  • heartbeat(interval: number, timeout?: number): Client
  • This method sets up the heartbeat mode with the server. It sends a command to AMPS that starts or refreshes a heartbeat timer. When a heartbeat timer is active, AMPS publishes periodic heartbeat messages to AMPS and expects the client to respond with a heartbeat message. If the client does not provide a heartbeat within the time specified, AMPS logs an error and disconnects the connection.

    // Initialize a client with the heartbeat of 5 seconds
    var client = new amps.Client().heartbeat(5);
    

    Parameters

    • interval: number

      the heartbeat value in seconds.

    • Optional timeout: number

      the timeout value in seconds. By default it is the heartbeat interval value times 2.

    Returns Client

    The Client object.

logonCorrelationId

  • logonCorrelationId(): string
  • logonCorrelationId(logonCorrelationId: string): Client
  • This method is a setter/getter for the logon correlation id of the client. It must be a valid Base64 string.

    // assign a logon correlation id to the client object
    var client = new amps.Client().logonCorrelationId('L2p0vkn2');
    
    // ... access the logon correlation id later
    console.log(client.logonCorrelationId());
    

    Returns string

    The client if a setter is called. The logon correlation id (if any) otherwise.

  • Parameters

    • logonCorrelationId: string

    Returns Client

logonOptions

  • logonOptions(): string
  • logonOptions(logonOptions: string): Client
  • This method is a setter/getter for the logon options of the client. Logon options can also be set via the connect() method as an optional argument. Logon options can't be set after the client is connected and logged on.

    // create a client and set the logon options
    var client = new amps.Client().logonOptions('pretty,ack_conflation=300ms');
    
    // ... access the logon options later
    console.log(client.logonOptions());
    

    Returns string

    The client if a setter is called. The logon options (if any) otherwise.

  • Parameters

    • logonOptions: string

    Returns Client

name

  • name(name?: string): Client | string
  • This method is a setter/getter for the client's name. If logon has not been performed yet and the name was not set, returns null.

    Parameters

    • Optional name: string

      The name of the AMPS client instance.

    Returns Client | string

    The client object if the setter is called. The name of the AMPS client instance (if any) otherwise.

publish

  • publish(topic: string, data: any, params?: CommandParams): void
  • This method performs the publish command. The publish command is the primary way to inject messages into the AMPS processing stream. A publish command received by AMPS will be forwarded to other connected clients with matching subscriptions.

    client.publish('topic', {id: 1});
    

    Parameters

    • topic: string

      the topic to publish data.

    • data: any

      the data to publish to a topic.

    • Optional params: CommandParams

      an object with params, like: {expiration: 30, ...}

    Returns void

publishStore

  • This method is a setter/getter for the PublishStore object of the client. PublishStore interface is being used to to provide consistent publish functionality with guaranteed delivery.

    // create a client and assign a publish store to it
    var publishStore = new amps.MemoryPublishStore();
    var client = new amps.Client().publishStore(publishStore);
    
    // ... access the publish store later
    if (client.publishStore().unpersistedCount() == 0) {
        client.disconnect();
    }
    

    Returns PublishStore

    The client if a setter is called. The PublishStore object (if any) otherwise.

  • Parameters

    Returns Client

reconnectDelay

  • reconnectDelay(delay?: number): Client
  • This method sets a reconnection delay for the client. This is a convenience method that sets up a FixedDelayStrategy with a requested delay value.

    // create a client and set a reconnect delay
    var client = new amps.Client().reconnectDelay(5000);
    
    see

    Client.delayStrategy for more flexible controls over reconnection logic.

    Parameters

    • Default value delay: number = 200

    Returns Client

    The client object.

removeConnectionStateListener

  • removeConnectionStateListener(connectionStateListenerId: number): void
  • This method removes a connection state listener with the id provided.

    var client = new amps.Client();
    var listenerId = client.addConnectionStateListener(function(state) {
        console.log('state: ', state);
    });
    
    // ... later
    client.removeConnectionStateListener(listenerId);
    

    Parameters

    • connectionStateListenerId: number

    Returns void

serverChooser

  • This method is a setter/getter for the server chooser object of the client. ServerChooser interface is used to obtain a URI to connect. The chooser can only be set before the client is connected. Once a server chooser is set, the client is working in the High Availability mode and uses a DelayStrategy object to determine a delay between reconnection attempts. If no delay strategy was provided, the client will use ExponentialDelayStrategy with default settings. AMPS provides the DefaultServerChooser implementation.

    // create a server chooser and assign URIs
    var chooser = new amps.DefaultServerChooser();
    chooser.add('wss://localhost:9000/amps/json');
    chooser.add('wss://localhost:9100/amps/json');
    
    // create a client and assign a server chooser to it
    var client = new amps.Client().serverChooser(chooser);
    
    // ... access the chooser object later
    client.serverChooser().add('wss://backup_host:9200/amps/json');
    

    Returns ServerChooser

    The client if a setter is called. The server chooser(if any) otherwise.

  • Parameters

    Returns Client

serverVersion

  • serverVersion(): string
  • This method returns the server version returned by the AMPS server in the logon acknowledgement. If logon has not been performed yet, returns null.

    Returns string

    The version of the AMPS server.

serverVersionAsInt

  • serverVersionAsInt(): number
  • This method returns the server version returned by the AMPS server in the logon acknowledgement in a form of an integer XXYYZZWWW. For example, for 5.2.1.22 will be represented as 050201022. If logon has not been performed yet, returns 0.

    Returns number

    The version of the AMPS server.

sow

  • sow(onMessage: function, topic: string, filter?: string, params?: CommandParams): Promise<string>
  • This method performs the sow command. The sow command is use to query the contents of a previously defined SOW Topic. A sow command can be used to query an entire SOW Topic, or a filter can be used to further refine the results found inside a SOW Topic. For more information, see the State of the World and SOW Queries chapters in the AMPS User Guide.

    client.sow(function(message) { console.log(message); }, 'sow-topic')
        .then(function(subscriptionId) { console.log(subscriptionId); })
        .catch(function(err) { console.error('err: ', err); });
    

    Parameters

    • onMessage: function

      a message handler that will be called each time a message is received.

    • topic: string

      The topic argument in sow.

    • Optional filter: string

      The filter argument in sow.

    • Optional params: CommandParams

      The params like ackType, bookmark, commandId, etc in an object.

    Returns Promise<string>

    The Promise object with the results of execution of the command.

sowAndDeltaSubscribe

  • sowAndDeltaSubscribe(onMessage: function, topic: string, filter?: string, params?: CommandParams): Promise<string>
  • This method performs the sow_and_delta_subscribe command. A sow_and_delta_subscribe command is used to combine the functionality of commands sow and a delta_subscribe in a single command. The sow_and_delta_subscribe command is used

    • to query the contents of a SOW topic (this is the sow command); and
    • to place a subscription such that any messages matching the subscribed SOW topic and query filter will be published to the AMPS client (this is the delta_subscribe command).

    As with the delta_subscribe command, publish messages representing updates to SOW records will contain only the information that has changed. If a sow_and_delta_subscribe is issued on a record that does not currently exist in the SOW topic, or if it is used on a topic that does not have a SOW-topic store defined, then a sow_and_delta_subscribe will behave like a sow_and_subscribe command.

    client.sowAndDeltaSubscribe(function(message) { ... }, 'sow-topic')
        .then(function(subId) { console.log(subId); })
        .catch(function(err) { console.error('err: ', err); });
    

    Parameters

    • onMessage: function

      a message handler that will be called each time a message is received.

    • topic: string

      The topic argument in sow.

    • Optional filter: string

      The filter argument in sow.

    • Optional params: CommandParams

      The params like ackType, bookmark, commandId, etc in an object.

    Returns Promise<string>

    The Promise object with the results of execution of the command.

sowAndSubscribe

  • sowAndSubscribe(onMessage: function, topic: string, filter?: string, params?: CommandParams): Promise<string>
  • This method performs the sow_and_subscribe command. A sow_and_subscribe command is used to combine the functionality of sow and a subscribe command in a single command. The sow_and_subscribe command is used

    • to query the contents of a SOW topic (this is the sow command); and
    • to place a subscription such that any messages matching the subscribed SOW topic and query filter will be published to the AMPS client (this is the subscribe command). As with the subscribe command, publish messages representing updates to SOW records will contain only information that has changed.
    client.sowAndSubscribe(function(message) { ... }, 'sow-topic')
        .then(function(subId) { console.log(subId); })
        .catch(function(err) { console.error('err: ', err); });
    

    Parameters

    • onMessage: function

      a message handler that will be called each time a message is received.

    • topic: string

      The topic argument in sow.

    • Optional filter: string

      The filter argument in sow.

    • Optional params: CommandParams

      The params like ackType, bookmark, commandId, etc in an object.

    Returns Promise<string>

    The Promise object with the results of execution of the command.

sowDelete

  • sowDelete(topic: string, filter: string, options?: string): Promise<Message>
  • This method executes a SOW delete with a filter.

    client
        .sowDelete('sow-topic', '/status = "obsolete"')
        .then(function(message) {
            console.log(message.header.ackType(), ': ',  message.header.status());
        });
    

    Parameters

    • topic: string

      The topic to execute the SOW delete against.

    • filter: string

      The filter. To delete all records, set a filter that is always true: 1 = 1

    • Optional options: string

      A comma separated list of values indicating additional processing options.

    Returns Promise<Message>

    The promise object with the results of execution of the command.

sowDeleteByData

  • sowDeleteByData(topic: string, data: any): Promise<Message>
  • This method deletes a message from a SOW, using data supplied to locate a SOW entry with matching keys.

    var topic = sowMessage.header.topic();
    var data = sowMessage.data;
    
    client
        .sowDeleteByData(topic, data)
        .then(function(message) {
            console.log(message.header.ackType(), ': ',  message.header.status());
        });
    

    Parameters

    • topic: string

      The topic to execute the SOW delete against.

    • data: any

      The A message data whose keys match the message to be deleted in the server’s SOW.

    Returns Promise<Message>

    The promise object with the results of execution of the command.

sowDeleteByKeys

  • sowDeleteByKeys(topic: string, keys: string): Promise<Message>
  • This method executes a SOW delete with sow keys (supplied as a comma-separated values in a string). SOW keys are provided in the header of a SOW message, and are the internal identifier AMPS uses for that SOW message.

    var topic = sowMessage1.header.topic();
    var keys = sowMessage1.header.sowKey() + ',' + sowMessage2.header.sowKey();
    
    client
        .sowDeleteByKeys(topic, keys)
        .then(function(message) {
            console.log(message.header.ackType(), ': ',  message.header.status());
        });
    

    Parameters

    • topic: string

      The topic to execute the SOW delete against.

    • keys: string

      A comma separated list of SOW keys to be deleted. SOW keys are provided in the header of a SOW message, and are the internal identifier AMPS uses for that SOW message.

    Returns Promise<Message>

    The promise object with the results of execution of the command.

subscribe

  • subscribe(onMessage: function, topic: string, filter?: string, params?: CommandParams): Promise<string>
  • This method performs the subscribe command. The subscribe command is the primary way to retrieve messages from the AMPS processing stream. A client can issue a subscribe command on a topic to receive all published messages to that topic in the future. Additionally, content filtering can be used to choose which messages the client is interested in receiving.

    client.subscribe(function(message) { console.log(message); }, 'topic')
        .then(function(subscriptionId) { console.log(subscriptionId); })
        .catch(function(err) { console.error('err: ', err); });
    

    Parameters

    • onMessage: function

      a message handler that will be called each time a message is received.

    • topic: string

      The topic argument in subscribe.

    • Optional filter: string

      The filter argument in subscribe.

    • Optional params: CommandParams

      The params like ackType, bookmark, commandId, etc in an object.

    Returns Promise<string>

    The Promise object with the results of execution of the command.

subscriptionManager

  • This method is a setter/getter for the SubscriptionManager object of the client. AMPS provides DefaultSubscriptionManager that is used to restore subscriptions after an unintended disconnection. It is not set by default.

    // create a client and assign a subscription manager to it
    var subscriptionManager = new amps.DefaultSubscriptionManager();
    var client = new amps.Client().subscriptionManager(subscriptionManager);
    
    // ... access the subscription manager object later
    client.subscriptionManager().clear();
    

    Returns SubscriptionManager

    The client if a setter is called. The SubscriptionManager object (if any) otherwise.

  • Parameters

    Returns Client

transportFilter

  • transportFilter(): function
  • transportFilter(transportFilter: function): Client
  • This method sets/gets the transport filter to observe incoming and outgoing messages in the format they are sent and received on the network. This allows you to inspect or modify outgoing messages before they are sent to the network, and incoming messages as they arrive from the network. This can be especially useful when using SSL connections, since this gives you a way to monitor outgoing network traffic before it is encrypted, and incoming network traffic after it is decrypted.

    function printingFilter(data, outgoing) {
        if (outgoing) {
            console.log('OUTGOING ---> ', data);
        }
        else {
            console.log('INCOMING ---> ', data);
        }
    }
    
    var client = new amps.Client().transportFilter(printingFilter);
    

    Returns function

    The client if a setter called, the transport filter method (if any) otherwise.

      • (data: any, outgoing?: boolean): void
      • Parameters

        • data: any
        • Optional outgoing: boolean

        Returns void

  • Parameters

    • transportFilter: function
        • (data: any, outgoing?: boolean): void
        • Parameters

          • data: any
          • Optional outgoing: boolean

          Returns void

    Returns Client

unsubscribe

  • unsubscribe(subId?: string): Promise<string>
  • This method performs the unsubscribe command. The unsubscribe command unsubscribes the client from the topic which messages the client is is no more interested in receiving. If not subscription id is provided, the client will unsubscribe from all subscriptions.

    client.unsubscribe();  // unsubscribe from all
    client.unsubscribe('123');
    

    Parameters

    • Optional subId: string

      The id of the subscription.

    Returns Promise<string>

    The Promise object with the results of execution of the command.

Static createMemoryBacked

  • createMemoryBacked(name?: string): Client
  • This is a convenience static method that creates a memory-backed client that tracks bookmarks and subscriptions in memory. Subscriptions are automatically restored after a reconnection using DefaultSubscriptionManager object. MemoryBookmarkStore is enabled for bookmarks, MemoryPublishStore is enabled for publishing messages.

    Parameters

    • Optional name: string

      Unique name for the client (important for queues and sow). It is strongly recommended to set a client name, but if it's not set, it'll be assigned automatically.

    Returns Client

    a highly available Client instance.

Static version

  • version(): string
  • This static method returns a version of the AMPS client.

    Returns string

    The version of this AMPS client.

Object literals

Static Bookmarks

Bookmarks: object

EPOCH

EPOCH: string = "0"

MOST_RECENT

MOST_RECENT: string = "recent"

NOW

NOW: string = "0|1|"

Static ConnectionStateListener

ConnectionStateListener: object

Connected

Connected: number = 2

Disconnected

Disconnected: number = 0

HeartbeatInitiated

HeartbeatInitiated: number = 16

LoggedOn

LoggedOn: number = 4

PublishReplayed

PublishReplayed: number = 8

Resubscribed

Resubscribed: number = 32

Shutdown

Shutdown: number = 1

UNKNOWN

UNKNOWN: number = 16834