Options
All
  • Public
  • Public/Protected
  • All
Menu

Diffusion JavaScript API 6.11.5

Index

Enumerations

Classes

Interfaces

Type aliases

Events

Variables

Functions

Object literals

Type aliases

AnonymousConnectionAction

AnonymousConnectionAction: "deny" | "allow" | "abstain"

Callback

Callback: function

Type declaration

    • (error: any): U
    • Parameters

      • error: any

      Returns U

ConnectionOptions

ConnectionOptions: object

Type declaration

Credentials

Credentials: string | Uint8Array | null | undefined

Int64SourceType

Int64SourceType: string | number | Uint8Array | Int64

Json

Json: JSON

JsonDataType

JsonDataType: JSONDataType

ReconnectStrategy

ReconnectStrategy: function

Type declaration

    • (reconnect: function, abort: function): void
    • Parameters

      • reconnect: function
          • (): void
          • Returns void

      • abort: function
          • (): void
          • Returns void

      Returns void

Result

Result: Promise<R>

SessionOptions

SessionOptions: Options

StreamCallback

StreamCallback: function

Type declaration

    • (...args: any[]): void
    • Parameters

      • Rest ...args: any[]

      Returns void

StringSourceType

StringSourceType: string | object

TypedArray

TypedArray: Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Float32Array | Float64Array

Events

close

close: function

Type declaration

    • (reason?: undefined | string): void
    • Parameters

      • Optional reason: undefined | string

      Returns void

error

error: function

Type declaration

    • (err: Error): void
    • Parameters

      • err: Error

      Returns void

Variables

Const buffer

buffer: object = Buffer as any

Type declaration

  • constructor: function
    • new __type(str: string, encoding?: string | undefined): Buffer
    • new __type(size: number): Buffer
    • new __type(array: Uint8Array): Buffer
    • new __type(arrayBuffer: ArrayBuffer): Buffer
    • new __type(array: any[]): Buffer
    • new __type(buffer: Buffer): Buffer
    • Parameters

      • str: string
      • Optional encoding: string | undefined

      Returns Buffer

    • Parameters

      • size: number

      Returns Buffer

    • Parameters

      • array: Uint8Array

      Returns Buffer

    • Parameters

      • arrayBuffer: ArrayBuffer

      Returns Buffer

    • Parameters

      • array: any[]

      Returns Buffer

    • Parameters

      • buffer: Buffer

      Returns Buffer

  • poolSize: number
  • prototype: Buffer
  • alloc: function
    • alloc(size: number, fill?: string | number | Buffer | undefined, encoding?: string | undefined): Buffer
    • Parameters

      • size: number
      • Optional fill: string | number | Buffer | undefined
      • Optional encoding: string | undefined

      Returns Buffer

  • allocUnsafe: function
    • allocUnsafe(size: number): Buffer
    • Parameters

      • size: number

      Returns Buffer

  • allocUnsafeSlow: function
    • allocUnsafeSlow(size: number): Buffer
    • Parameters

      • size: number

      Returns Buffer

  • byteLength: function
    • byteLength(string: string | DataView | ArrayBuffer | Buffer, encoding?: string | undefined): number
    • Parameters

      • string: string | DataView | ArrayBuffer | Buffer
      • Optional encoding: string | undefined

      Returns number

  • compare: function
    • compare(buf1: Buffer, buf2: Buffer): number
    • Parameters

      • buf1: Buffer
      • buf2: Buffer

      Returns number

  • concat: function
    • concat(list: Buffer[], totalLength?: number | undefined): Buffer
    • Parameters

      • list: Buffer[]
      • Optional totalLength: number | undefined

      Returns Buffer

  • from: function
    • from(arrayBuffer: ArrayBuffer, byteOffset?: number | undefined, length?: number | undefined): Buffer
    • from(data: string | any[] | ArrayBuffer | Buffer): Buffer
    • from(str: string, encoding?: string | undefined): Buffer
    • Parameters

      • arrayBuffer: ArrayBuffer
      • Optional byteOffset: number | undefined
      • Optional length: number | undefined

      Returns Buffer

    • Parameters

      • data: string | any[] | ArrayBuffer | Buffer

      Returns Buffer

    • Parameters

      • str: string
      • Optional encoding: string | undefined

      Returns Buffer

  • isBuffer: function
    • isBuffer(obj: any): boolean
    • Parameters

      • obj: any

      Returns boolean

  • isEncoding: function
    • isEncoding(encoding: string): boolean
    • Parameters

      • encoding: string

      Returns boolean

Const build

build: string = "fe8a54e4"

Const clients

clients: ClientControlOptionsNamespace = ClientControlOptions

Const datatypes

datatypes: DataTypes = DataTypesImpl

Const errors

errors: object = ErrorReason

Type declaration

Const keys

keys: string[] = ['PUBLISH_VALUES_ONLY','SCHEMA','VALIDATE_VALUES','TIDY_ON_UNSUBSCRIBE','TIME_SERIES_EVENT_VALUE_TYPE','TIME_SERIES_RETAINED_RANGE','TIME_SERIES_SUBSCRIPTION_RANGE','DONT_RETAIN_VALUE','PERSISTENT','REMOVAL','OWNER','COMPRESSION','CONFLATION','PRIORITY']

Const locks

locks: SessionLockOptionsNamespace = SessionLockOptions

Let onconnect

onconnect: function

Type declaration

    • (e: MessageEvent): void
    • Parameters

      • e: MessageEvent

      Returns void

Const selectors

selectors: TopicSelectors = new TopicSelectors()

Const topicUpdate

topicUpdate: TopicUpdateNamespace = TopicUpdateNamespace

Const topics

topics: TopicsNamespace = topicsNamespace

Const version

version: string = "6.11.5"

Functions

connect

  • connect(options: Options | string, sessionName?: undefined | string, workerJs?: undefined | string): Result<Session>
  • Parameters

    • options: Options | string
    • Optional sessionName: undefined | string
    • Optional workerJs: undefined | string

    Returns Result<Session>

    a Result for this operation

connectShared

  • connectShared(sessionName: string, workerJs: string): Result<Session>
  • Parameters

    • sessionName: string
    • workerJs: string

    Returns Result<Session>

    a Result for this operation

escape

  • escape(s: string): string
  • Parameters

    • s: string

    Returns string

    the string value with escape characters inserted as appropriate

log

  • log(level: LogLevel | keyof LogLevel): void
  • Parameters

    Returns void

newBranchMappingTableBuilder

newRemoteServerBuilder

newSessionEventParametersBuilder

newSessionMetricCollectorBuilder

newTopicMetricCollectorBuilder

rolesToString

  • rolesToString(roles: Set<string> | string[]): string
  • Parameters

    • roles: Set<string> | string[]

    Returns string

    a string representing the supplied roles, formatted as required by the $Roles session property

stringToRoles

  • stringToRoles(s: string): Set<string>
  • Parameters

    • s: string

    Returns Set<string>

    set of roles

updateConstraints

Object literals

Const ClientControlOptions

ClientControlOptions: object

ANONYMOUS

ANONYMOUS: string = ""

CloseReason

CloseReason: object = CloseReasonEnum

Type declaration

PropertyKeys

PropertyKeys: object = Object.freeze({/*** This constant can be used instead of a property key in requests for* session property values to indicate that <b>all</b> fixed session* properties are required.*/ALL_FIXED_PROPERTIES: ['*F'],/*** This constant can be used instead of a property key in requests for* session property values to indicate that <b>all</b> user defined session* properties are required.*/ALL_USER_PROPERTIES: ['*U'],/*** This constant can be used instead of a property key in requests for* session property values to indicate that <b>all</b> session* properties are required.*/ALL_PROPERTIES: ['*F', '*U'],/*** Session property key for session identifier.** @since 6.2*/SESSION_ID: '$SessionId',/*** Session property key for principal.** @since 6.2*/PRINCIPAL: '$Principal',/*** Session property key for connector name.** @since 6.2*/CONNECTOR: '$Connector',/*** Session property key for transport.** @since 6.2*/TRANSPORT: '$Transport',/*** Session property key for client type.** @since 6.2*/CLIENT_TYPE: '$ClientType',/*** Session property key for country code.** @since 6.2*/COUNTRY: '$Country',/*** Session property key for language code.** @since 6.2*/LANGUAGE: '$Language',/*** Session property key for server name.** @since 6.2*/SERVER_NAME: '$ServerName',/*** Session property key for client IP address.** @since 6.2*/CLIENT_IP: '$ClientIP',/*** Session property key for client latitude.** @since 6.2*/LATITUDE: '$Latitude',/*** Session property key for client longitude.** @since 6.2*/LONGITUDE: '$Longitude',/*** Session property key for client start time.** @since 6.2*/START_TIME: '$StartTime',/*** Session property key for session roles.** @since 6.2*/ROLES: '$Roles',/*** Session property key for MQTT client ID.** @since 6.6*/MQTT_CLIENT_ID: '$MQTTClientId',/*** Session property key for Gateway Client type.** @since 6.6*/GATEWAY_TYPE: '$GatewayType',/*** Session property key for Gateway Client identifier.** @since 6.6*/GATEWAY_ID: '$GatewayId',/*** Session property key for client environment.** @since 6.11*/ENVIRONMENT: '$Environment'})

Type declaration

SessionEventStreamEventType

SessionEventStreamEventType: SessionEventStreamEventType = SessionEventStreamEventType

SessionState

SessionState: SessionState = SessionState

Const CloseReasonEnum

CloseReasonEnum: object

ACCESS_DENIED

ACCESS_DENIED: CloseReasonImpl = new CloseReasonImpl(99, 'The connection attempt was rejected by the server because authentication failed', false)

CLOSED_BY_CLIENT

CLOSED_BY_CLIENT: CloseReasonImpl = new CloseReasonImpl(0, 'The session was closed by the client', false)

CLOSED_BY_SERVER

CLOSED_BY_SERVER: CloseReasonImpl = new CloseReasonImpl(1, 'The session was closed by the server', false)

CONNECTION_ERROR

CONNECTION_ERROR: CloseReasonImpl = new CloseReasonImpl(7, 'The client could not establish a connection to the server', true)

CONNECTION_TIMEOUT

CONNECTION_TIMEOUT: CloseReasonImpl = new CloseReasonImpl(3, 'The connection attempt timed out', false)

HANDSHAKE_ERROR

HANDSHAKE_ERROR: CloseReasonImpl = new CloseReasonImpl(5, 'There was an error parsing the handshake response', false)

HANDSHAKE_REJECTED

HANDSHAKE_REJECTED: CloseReasonImpl = new CloseReasonImpl(4, 'The connection handshake was rejected by the server', false)

IDLE_CONNECTION

IDLE_CONNECTION: CloseReasonImpl = new CloseReasonImpl(8, 'The activity monitor detected the connection was idle', true)

LICENSE_EXCEEDED

LICENSE_EXCEEDED: CloseReasonImpl = new CloseReasonImpl(18, 'The license limit was exceeded', false)

LOST_MESSAGES

LOST_MESSAGES: CloseReasonImpl = new CloseReasonImpl(16, 'Loss of messages has been detected', false)

PROTOCOL_VERSION_MISMATCH

PROTOCOL_VERSION_MISMATCH: CloseReasonImpl = new CloseReasonImpl(17,'Client version rejected : Client should be downgraded to use server compatible version ' +'or server upgraded to client version in use',false)

RECONNECT_ABORTED

RECONNECT_ABORTED: CloseReasonImpl = new CloseReasonImpl(2, 'Client aborted a reconnect attempt', false)

TRANSPORT_ERROR

TRANSPORT_ERROR: CloseReasonImpl = new CloseReasonImpl(6, 'There was an unexpected error with the connection', true)

Const ErrorReason

ErrorReason: object

ACCESS_DENIED

ACCESS_DENIED: ErrorReason = new ErrorReasonImpl(103, 'Access denied')

CALLBACK_EXCEPTION

CALLBACK_EXCEPTION: ErrorReason = new ErrorReasonImpl(105, 'An application callback threw an exception. Check logs for more information')

CLUSTER_REPARTITION

CLUSTER_REPARTITION: ErrorReason = new ErrorReasonImpl(110, 'The cluster was repartitioning and the request could not be routed.')

CLUSTER_ROUTING

CLUSTER_ROUTING: ErrorReason = new ErrorReasonImpl(112, 'The cluster operation could not be routed.')

COMMUNICATION_FAILURE

COMMUNICATION_FAILURE: ErrorReason = new ErrorReasonImpl(100, 'Communication with server failed')

HANDLER_CONFLICT

HANDLER_CONFLICT: ErrorReason = new ErrorReasonImpl(201, 'Conflict with an existing handler')

INCOMPATIBLE_DATATYPE

INCOMPATIBLE_DATATYPE: ErrorReason = new ErrorReasonImpl(108, 'Data type is incompatible')

INCOMPATIBLE_STATE

INCOMPATIBLE_STATE: ErrorReason = new ErrorReasonImpl(111,'Topic operation not performed because it is managed by a component that prohibits external updates')

INVALID_DATA

INVALID_DATA: ErrorReason = new ErrorReasonImpl(106, 'Invalid data')

INVALID_PATH

INVALID_PATH: ErrorReason = new ErrorReasonImpl(202, 'Invalid path')

NO_SUCH_SESSION

NO_SUCH_SESSION: ErrorReason = new ErrorReasonImpl(107, 'A requested session could not be found')

REJECTED_REQUEST

REJECTED_REQUEST: ErrorReason = new ErrorReasonImpl(9003, 'A request has been rejected by the recipient session')

REQUEST_TIME_OUT

REQUEST_TIME_OUT: ErrorReason = new ErrorReasonImpl(102, 'Request time out')

SESSION_CLOSED

SESSION_CLOSED: ErrorReason = new ErrorReasonImpl(101, 'Session is closed')

TOPIC_TREE_REGISTRATION_CONFLICT

TOPIC_TREE_REGISTRATION_CONFLICT: ErrorReason = new ErrorReasonImpl(200, 'A conflicting registration exists on the same branch of the topic tree')

UNHANDLED_MESSAGE

UNHANDLED_MESSAGE: ErrorReason = new ErrorReasonImpl(109, 'A message was not handled')

UNSUPPORTED

UNSUPPORTED: ErrorReason = new ErrorReasonImpl(104, 'Unsupported service')

Const SessionLockOptions

SessionLockOptions: object

SessionLockScope

SessionLockScope: SessionLockScope = SessionLockScope

Const TopicAddFailReasonEnum

TopicAddFailReasonEnum: object

CLUSTER_REPARTITION

CLUSTER_REPARTITION: TopicAddFailReason = new TopicAddFailReason(10, 'When trying to create the topic the cluster was migrating the partition that owns the topic')

EXCEEDED_LICENSE_LIMIT

EXCEEDED_LICENSE_LIMIT: TopicAddFailReason = new TopicAddFailReason(11, 'Adding the topic failed because of a license limit')

EXISTS

EXISTS: TopicAddFailReason = new TopicAddFailReason(1, 'The topic already exists with the same details')

EXISTS_INCOMPATIBLE

EXISTS_INCOMPATIBLE: TopicAddFailReason = new TopicAddFailReason(14, 'Adding the topic failed because a topic is already bound to the specified' +'path but the caller does not have the rights to manage it')

EXISTS_MISMATCH

EXISTS_MISMATCH: TopicAddFailReason = new TopicAddFailReason(2, 'The topic already exists, with different details')

INVALID_DETAILS

INVALID_DETAILS: TopicAddFailReason = new TopicAddFailReason(4, 'The topic details are invalid')

INVALID_NAME

INVALID_NAME: TopicAddFailReason = new TopicAddFailReason(15, 'The supplied topic path is invalid.')

PERMISSIONS_FAILURE

PERMISSIONS_FAILURE: TopicAddFailReason = new TopicAddFailReason(7, 'Invalid permissions to add a topic at the specified path')

UNEXPECTED_ERROR

UNEXPECTED_ERROR: TopicAddFailReason = new TopicAddFailReason(9, 'An unexpected error occured while creating the topic')

Const TopicTypeEnum

TopicTypeEnum: object

BINARY

BINARY: TopicType = new TopicType(14, true, false)

DOUBLE

DOUBLE: TopicType = new TopicType(19, true, false)

INT64

INT64: TopicType = new TopicType(18, true, false)

JSON

JSON: TopicType = new TopicType(15, true, false)

RECORD_V2

RECORD_V2: TopicType = new TopicType(20, true, false)

STRING

STRING: TopicType = new TopicType(17, true, false)

TIME_SERIES

TIME_SERIES: TopicType = new TopicType(16, true, false)

UNKNOWN_TOPIC_TYPE

UNKNOWN_TOPIC_TYPE: TopicType = new TopicType(21, false, false)

Const TopicUpdateNamespace

TopicUpdateNamespace: object

TopicCreationResult

TopicCreationResult: TopicCreationResult = TopicCreationResult

UpdateConstraintOperator

UpdateConstraintOperator: UpdateConstraintOperator = UpdateConstraintOperator

Const UnsubscribeReasonEnum

UnsubscribeReasonEnum: object

AUTHORIZATION

AUTHORIZATION: UnsubscribeReason = new UnsubscribeReason(3, 'Not authorized to subscribe to this topic')

BACK_PRESSURE

BACK_PRESSURE: UnsubscribeReason = new UnsubscribeReason(5, 'The server has unsubscribed due to a backlog of messages')

BRANCH_MAPPINGS

BRANCH_MAPPINGS: UnsubscribeReason = new UnsubscribeReason(6, 'Branch mapping rules have changed')

CONTROL

CONTROL: UnsubscribeReason = new UnsubscribeReason(1, 'The server or another client unsubscribed this client')

REMOVED

REMOVED: UnsubscribeReason = new UnsubscribeReason(2, 'The topic was removed')

REQUESTED

REQUESTED: UnsubscribeReason = new UnsubscribeReason(0, 'The unsubscription was requested by this client')

STREAM_CHANGE

STREAM_CHANGE: UnsubscribeReason = new UnsubscribeReason(undefined, 'A more specific stream has been registered to the same path')

SUBSCRIPTION_REFRESH

SUBSCRIPTION_REFRESH: UnsubscribeReason = new UnsubscribeReason(undefined, 'The server has re-subscribed this session')

UNKNOWN_UNSUBSCRIBE_REASON

UNKNOWN_UNSUBSCRIBE_REASON: UnsubscribeReason = new UnsubscribeReason(4, 'Unknown unsubscribe reason')

Const UpdateFailReasonEnum

UpdateFailReasonEnum: object

CLUSTER_REPARTITION

CLUSTER_REPARTITION: UpdateFailReason = new UpdateFailReason(9, 'When trying to update the topic the cluster was migrating the partition that owns the topic')

DELTA_WITHOUT_VALUE

DELTA_WITHOUT_VALUE: UpdateFailReason = new UpdateFailReason(8, 'An attempt has been made to apply a delta to a topic that does not yet have a value')

EXCLUSIVE_UPDATER_CONFLICT

EXCLUSIVE_UPDATER_CONFLICT: UpdateFailReason = new UpdateFailReason(7, 'An exclusive update source is already registered for the topic branch')

INCOMPATIBLE_STATE

INCOMPATIBLE_STATE: UpdateFailReason = new UpdateFailReason(10, 'An update could not be performed because the topic is managed by' +'a component (e.g fan-out) that prohibits updates from the caller')

INCOMPATIBLE_UPDATE

INCOMPATIBLE_UPDATE: UpdateFailReason = new UpdateFailReason(1, 'Update type is incompatible with topic type')

INVALID_UPDATER

INVALID_UPDATER: UpdateFailReason = new UpdateFailReason(3, 'Updater is invalid for updating')

INVALID_UPDATE_STREAM

INVALID_UPDATE_STREAM: UpdateFailReason = new UpdateFailReason(-2, 'The topic update failed because the update stream is no longer valid')

MISSING_TOPIC

MISSING_TOPIC: UpdateFailReason = new UpdateFailReason(4, 'Topic does not exist')

UNSATISFIED_CONSTRAINT

UNSATISFIED_CONSTRAINT: UpdateFailReason = new UpdateFailReason(-1, 'The topic update failed because the constraint was not satisfied')

UPDATE_FAILED

UPDATE_FAILED: UpdateFailReason = new UpdateFailReason(2, 'Update failed - possible content incompatibility')

Const topicsNamespace

topicsNamespace: object

FetchRequest

FetchRequest: FetchRequest = FetchRequest

TopicAddFailReason

TopicAddFailReason: object = TopicAddFailReasonEnum

Type declaration

TopicSpecification

TopicSpecification: TopicSpecification = TopicSpecification

TopicType

TopicType: object = TopicTypeEnum

Type declaration

UnsubscribeReason

UnsubscribeReason: object = UnsubscribeReasonEnum

Type declaration

UpdateFailReason

UpdateFailReason: object = UpdateFailReasonEnum

Type declaration