Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Command

The Command class encapsulates the AMPS Command entity. The JavaScript client sends Command objects to the server and receives Message objects from the server.

Hierarchy

  • Command

Index

Constructors

constructor

  • new Command(command: string): Command
  • Parameters

    • command: string

      The name of the command.

    Returns Command

Methods

ackType

  • ackType(value: string): Command
  • ackType(): string
  • Sets the acknowledgements requested for the command. Multiple ack types should be comma-delimited. The acknowledgement messages will be delivered to the message handler.

    Parameters

    • value: string

      The acknowledgement message type(s).

    Returns Command

    The updated Command object.


  • Returns the acknowledgement message type(s).

    Returns string

    The acknowledgement message type(s).

batchSize

  • batchSize(value: number): Command
  • batchSize(): number
  • Sets the number of messages that are batched together when returning a query result. If it's not set, it is 10 by default.

    Parameters

    • value: number

      The batch size value.

    Returns Command

    The updated Command object.


  • Returns the batch size value.

    Returns number

    The batch size value.

bookmark

  • bookmark(value: string): Command
  • bookmark(): string
  • Sets the client-originated identifier used to mark a location in journaled messages.

    Parameters

    • value: string

      The bookmark value.

    Returns Command

    The updated Command object.


  • Returns the bookmark value.

    Returns string

    The bookmark value.

command

  • command(value: string): Command
  • command(): string
  • Sets the command e.g. 'publish', 'sow_and_subscribe', to be executed. The following commands are available:

    • publish
    • delta_publish
    • subscribe
    • delta_subscribe
    • sow
    • sow_and_subscribe
    • sow_and_delta_subscribe
    • sow_delete
    • unsubscribe

    Parameters

    • value: string

      The command name value.

    Returns Command

    The updated Command object.


  • Returns the Command name.

    Returns string

    The Command name value.

commandId

  • commandId(value: string): Command
  • commandId(): string
  • Sets the Client-specified command id. The command id is returned by the engine in responses to commands to allow the client to correlate the response to the command.

    Parameters

    • value: string

      The command id value.

    Returns Command

    The updated Command object.


  • Returns the command id.

    Returns string

    The command id value.

correlationId

  • correlationId(value: string): Command
  • correlationId(): string
  • Sets the opaque token set by an application and returned with the message.

    Parameters

    • value: string

      The correlationId value.

    Returns Command

    The updated Command object.


  • Returns the correlationId value.

    Returns string

    The correlationId value.

data

  • data(value: any): Command
  • data(): any
  • Sets the command data (message payload). Makes sense only for publish, delta_publish, and sow_delete commands.

    Parameters

    • value: any

      The Command data (message payload).

    Returns Command

    The updated Command object.


  • Returns the Command data (message payload).

    Returns any

    The Command data (message payload).

expiration

  • expiration(value: number): Command
  • expiration(): number
  • Sets the SOW expiration time (in seconds) if used in publish.

    Parameters

    • value: number

      The command expiration value (in seconds).

    Returns Command

    The updated Command object.


  • Returns the command expiration value (in seconds).

    Returns number

    The command expiration value.

filter

  • filter(value: string): Command
  • filter(): string
  • Sets the content filter expression.

    Parameters

    • value: string

      The filter value.

    Returns Command

    The updated Command object.


  • Returns the filter value.

    Returns string

    The filter value.

options

  • options(value: string): Command
  • options(): string
  • Sets the (comma-delimited) string of options on a specific Command.

    Parameters

    • value: string

      The options (comma-delimited) string value.

    Returns Command

    The updated Command object.


  • Returns the options (comma-delimited) string value.

    Returns string

    The options (comma-delimited) string value.

orderBy

  • orderBy(value: string): Command
  • orderBy(): string
  • Sets the SOW topic key(s) by which to order SOW query.

    Parameters

    • value: string

      The orderBy value.

    Returns Command

    The updated Command object.


  • Returns the orderBy value.

    Returns string

    The orderBy value.

queryId

  • queryId(value: string): Command
  • queryId(): string
  • Sets the SOW Query identifier set by client to identify a query.

    Parameters

    • value: string

      The query id.

    Returns Command

    The updated Command object.


  • Returns the query id.

    Returns string

    The query id.

sequenceId

  • Sets the sequenceId value. SequenceId is an integer that corresponds to the publish message sequence number. For more information see the Replication section in the User Guide.

    Parameters

    Returns Command

    The updated Command object.


  • Returns the sequenceId value.

    Returns BigInteger

    The sequenceId value.

sowKey

  • sowKey(value: string): Command
  • sowKey(): string
  • Sets the sow key value. A SOW key will accompany each message returned in an SOW batch. A SowKey may also be added to messages coming in on a subscription when the published message matches a record in the SOW.

    Format:

    • string containing the digits of an unsigned long for AMPS-generated SOW keys

    OR

    • arbitrary string in the base64 character set for user-provided SOW keys.

    Parameters

    • value: string

      The sow key value.

    Returns Command

    The updated Command object.


  • Returns the sow key value.

    Returns string

    The sow key value.

sowKeys

  • sowKeys(value: string): Command
  • sowKeys(): string
  • Sets the sowKeys as a comma-delimited value.

    Parameters

    • value: string

      The sow keys value.

    Returns Command

    The updated Command object.


  • Returns the sowKeys value.

    Returns string

    The sowKeys value.

subId

  • subId(value: string): Command
  • subId(): string
  • Sets the subscription identifier set by server when processing a subscription.

    Parameters

    • value: string

      The subscription id.

    Returns Command

    The updated Command object.


  • Returns the subscription id.

    Returns string

    The subscription id.

subIds

  • subIds(value: string): Command
  • subIds(): string
  • Sets the subIds - a comma-separated list of subscription ids sent from AMPS engine to identify which client subscriptions match a given publish message.

    Parameters

    • value: string

      The subIds (comma-delimited) value.

    Returns Command

    The updated Command object.


  • Returns the subIds (comma-delimited) value.

    Returns string

    The subIds (comma-delimited) value.

topN

  • topN(value: number): Command
  • topN(): number
  • Sets the number of records to return. Note: If TopN is not equally divisible by the BatchSize value, then more records will be returned so that the total number of records is equally divisible by the BatchSize setting.

    deprecated

    provide the top_n=<value> value as a part of the options field instead.

    Parameters

    • value: number

      The top N value.

    Returns Command

    The updated Command object.


  • Returns the top N value.

    Returns number

    The top N value.

topic

  • topic(value: string): Command
  • topic(): string
  • Sets the topic value.

    Parameters

    • value: string

      The topic value.

    Returns Command

    The updated Command object.


  • Returns the topic value.

    Returns string

    The topic value.