Options
All
  • Public
  • Public/Protected
  • All
Menu

Diffusion JavaScript API 6.6.0-preview.1

Index

Enumerations

Classes

Interfaces

Type aliases

Events

Variables

Functions

Object literals

Type aliases

AdapterFactory

AdapterFactory: function

Type declaration

AnonymousConnectionAction

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

Action to be taken by the system authentication handler for connection attempts that do not provide a principal name and credentials.

CBORBaseValue

CBORBaseValue: CBORObject | TokenValueType

CBORValue

Callback

Callback: function

Type declaration

    • (error: any): U
    • Parameters

      • error: any

      Returns U

CborTypePredicate

CborTypePredicate: function

Type declaration

    • Parameters

      Returns boolean

ConnectionActivityMonitorFactory

ConnectionActivityMonitorFactory: function

Type declaration

ConnectionFactory

ConnectionFactory: function

Type declaration

ConnectionOptions

ConnectionOptions: object

A complete map of ConnectionOptions to values.

Type declaration

ConversationSetFactory

ConversationSetFactory: function

Type of the factory function to create a new conversation set

Type declaration

Credentials

Credentials: string | Buffer | null | undefined

The credentials that a session uses to authenticate itself

Deregistration

Deregistration: function

A callback that should initiate a deregistration from the server

Type declaration

EmitterEvent

EmitterEvent: function

Type declaration

    • (): void
    • Returns void

FieldData

FieldData: string | null

Field model data Record V2 field schema data

Typically created from a schema using {@link FieldData.modelValue}.

This type can be serialised and deserialised to JSON

max

max: number

The maximum number of occurrences of the node within its parent

min

min: number

The minimum number of occurrences of the node within its parent

name

name: string

The name of the field

Optional scale

scale: undefined | number

An optional scale for decimal field types

type

type: Type

The datatype of the field

IdGenerator

IdGenerator: function

Type declaration

Int64ImplSourceType

Int64ImplSourceType: string | number | Buffer | Int64Impl

The source type for reading integers

Int64SourceType

Int64SourceType: string | number | Buffer | Int64

InternalUpdateStreamFactory

InternalUpdateStreamFactory: function

A factory function creating internal update streams that act as a delegate

Type declaration

Json

Json: JSON

Alias for the JSON interface to keep compatibility with old TypeScript definitions

JsonDataType

JsonDataType: JSONDataType

Alias for the JSONDataType interface to keep compatibility with old TypeScript definitions

LockAction

Matcher

Matcher: function
brief

Utility functions for regular expressions

Type declaration

    • (s: string): boolean | null
    • Parameters

      • s: string

      Returns boolean | null

MessageCallback

MessageCallback: function

A callback that is called when a Message is successfully parsed

Type declaration

    • (e: Error | null, msg: Message | null): void
    • Parameters

      • e: Error | null
      • msg: Message | null

      Returns void

MessageSender

MessageSender: function

A function definition for sending a message

Type declaration

ReconnectStrategy

ReconnectStrategy: function

Type declaration

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

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

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

      Returns void

RecordChanges

RecordChanges: Array<boolean | number>

RecordData

RecordData: FieldData[]

Record data stored as array of field model data Record V2 record schema data

Typically created from a schema using RecordImpl.createModel.

This type can be serialised and deserialised to JSON

fields

fields: FieldData[]

The schema data of the fields contained in the record

max

max: number

The maximum number of occurrences of the node within its parent

min

min: number

The minimum number of occurrences of the node within its parent

name

name: string

The name of the field

ScriptOperation

ScriptOperation: function

Type declaration

    • (script: EditScript, start: number, length: number): boolean
    • Parameters

      Returns boolean

Segment

SerialiserMap

SerialiserMap: Map<any, Serialiser<any>>

A map of serialisers indexed by their value type

Service

Service: function

Client service

Type declaration

onRequest

  • Request handler

    Parameters

    Returns void

ServiceCallback

ServiceCallback: function

A callback function for a service

Type declaration

    • (error: any, response?: Response): void
    • Parameters

      • error: any
      • Optional response: Response

      Returns void

ServiceListener

ServiceListener: function

A listener callback that listens to service commands

Type declaration

ServiceRegistryListener

ServiceRegistryListener: function

Type declaration

SessionOptions

SessionOptions: Options

Alias for the Options interface to keep compatibility with old TypeScript definitions

StreamAction

StreamCallback

StreamCallback: function

A callback function type for Streams

Type declaration

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

      • Rest ...args: any[]

      Returns void

StringSourceType

StringSourceType: string | object

TokenValueType

TokenValueType: boolean | number | string | Buffer | null | undefined

Const TopicPermission

TopicPermission: PathPermission = PathPermission

Permissions that are applied on a path Permissions that are applied on a path

deprecated

since 6.5 Replaced by PathPermission

deprecated

since 6.5 Replaced by PathPermission

TypedArray

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

WorkerCommandResponse

WorkerCommandResponse: function

Type declaration

    • (response: Array<string | undefined>): void
    • Parameters

      • response: Array<string | undefined>

      Returns void

WorkerLockResponse

WorkerLockResponse: function

Type declaration

    • (lockName: string, action: string, data: any): void
    • Parameters

      • lockName: string
      • action: string
      • data: any

      Returns void

WorkerMessageResponse

WorkerMessageResponse: function

Type declaration

    • (cid: ConversationId, error?: undefined | string, response?: undefined | string): void
    • Parameters

      • cid: ConversationId
      • Optional error: undefined | string
      • Optional response: undefined | string

      Returns void

WorkerStreamResponse

WorkerStreamResponse: function

Type declaration

    • (adapterid: ConversationId, event: string, error?: undefined | string, response?: undefined | string): void
    • Parameters

      • adapterid: ConversationId
      • event: string
      • Optional error: undefined | string
      • Optional response: undefined | string

      Returns void

Events

close

close: function

Emitted when the Stream has been closed through completion or the underlying session has been closed. No further events will be emitted after this.

param

the reason why the stream was closed

Type declaration

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

      • Optional reason: undefined | string

      Returns void

error

error: function

Emitted when an error occurs in the Stream or in any of its listeners. No further events will be emitted after this.

Type declaration

    • (err: Error): void
    • the error that occurred

      Parameters

      • err: Error

      Returns void

Variables

Const ABSTAIN

ABSTAIN: object = Object.freeze(new AuthenticatorResponse(TypeCode.ABSTAIN))

An AuthenticatorResponse that abstains

Type declaration

Const AUTHOR_ENCODING

AUTHOR_ENCODING: 3 = 3

Const AddAndSetTopicRequestSerialiser

AddAndSetTopicRequestSerialiser: AddAndSetTopicRequestSerialiserClass = new AddAndSetTopicRequestSerialiserClass()

Const AddTopicResultSerialiser

AddTopicResultSerialiser: AddTopicResultSerialiserClass = new AddTopicResultSerialiserClass()

The AddTopicResultSerialiser singleton

Const ApplyJsonPatchRequestSerialiser

ApplyJsonPatchRequestSerialiser: ApplyJsonPatchRequestSerialiserClass = new ApplyJsonPatchRequestSerialiserClass()

Const AuthenticatorRegistrationParametersSerialiser

AuthenticatorRegistrationParametersSerialiser: AuthenticatorRegistrationParametersSerialiserClass = new AuthenticatorRegistrationParametersSerialiserClass()

Const AuthenticatorRegistrationRequestSerialiser

AuthenticatorRegistrationRequestSerialiser: AuthenticatorRegistrationRequestSerialiserClass = new AuthenticatorRegistrationRequestSerialiserClass()

Const AuthenticatorRequestSerialiser

AuthenticatorRequestSerialiser: AuthenticatorRequestSerialiserClass = new AuthenticatorRequestSerialiserClass()

Const AuthenticatorResponseSerialiser

AuthenticatorResponseSerialiser: AuthenticatorResponseSerialiserClass = new AuthenticatorResponseSerialiserClass()

Const BAIL_OUT_FACTOR

BAIL_OUT_FACTOR: 10000 = 10000

Const BINARY_DELTA_TYPE

BINARY_DELTA_TYPE: any = new BinaryDeltaTypeImpl<RecordV2, RecordV2 | Buffer, RecordV2>(RecordV2Impl, fromValue, identity)

A unique binary delta type instance to calculate deltas of BinaryImpl A unique binary delta type instance to calculate deltas of JSONImpl A unique binary delta type instance to calculate deltas of RecordV2Impl

Const BREAK_FLAG

BREAK_FLAG: Error = new Error()

Const BooleanSerialiser

BooleanSerialiser: BooleanSerialiserClass = new BooleanSerialiserClass()

The BooleanSerialiser singleton

Const BufferSerialiser

BufferSerialiser: BufferSerialiserClass = new BufferSerialiserClass()

The BufferSerialiser singleton

Const BytesSerialiser

BytesSerialiser: BytesSerialiserClass = new BytesSerialiserClass()

The BytesSerialiserClass singleton

Const CIDSerialiser

CIDSerialiser: CIDSerialiserClass = new CIDSerialiserClass()

The CIDSerialiser singleton

CLOSED

CLOSED: any

Const CLOSE_TIMEOUT

CLOSE_TIMEOUT: number = (global as any).DIFFUSION_CLOSE_TIMEOUT || 1000

The amount of time to wait for the server to close the connection after a req is sent.

CLOSING

CLOSING: any

CONNECTED

CONNECTED: any

CONNECTING

CONNECTING: any

Const CONNECT_TIMEOUT

CONNECT_TIMEOUT: number = (global as any).DIFFUSION_CONNECT_TIMEOUT || 10000

The amount of time waiting for a connection to occur.

Const ChangeAuthorisationRolesFilterRequestSerialiser

ChangeAuthorisationRolesFilterRequestSerialiser: ChangeAuthorisationRolesFilterRequestSerialiserClass = new ChangeAuthorisationRolesFilterRequestSerialiserClass()

Const ChangeAuthorisationRolesRequestSerialiser

ChangeAuthorisationRolesRequestSerialiser: ChangeAuthorisationRolesRequestSerialiserClass = new ChangeAuthorisationRolesRequestSerialiserClass()

Const ChangePrincipalRequestSerialiser

ChangePrincipalRequestSerialiser: ChangePrincipalRequestSerialiserClass = new ChangePrincipalRequestSerialiserClass()

Const CheckRemoteServerResultSerialiser

CheckRemoteServerResultSerialiser: CheckRemoteServerResultSerialiserClass = new CheckRemoteServerResultSerialiserClass()

Const ClientFilterSubscribeRequestSerialiser

ClientFilterSubscribeRequestSerialiser: ClientFilterSubscribeRequestSerialiserClass = new ClientFilterSubscribeRequestSerialiserClass()

Const ClientFilterSubscribeResponseSerialiser

ClientFilterSubscribeResponseSerialiser: ClientFilterSubscribeResponseSerialiserClass = new ClientFilterSubscribeResponseSerialiserClass()

Const ClientSubscribeRequestSerialiser

ClientSubscribeRequestSerialiser: ClientSubscribeRequestSerialiserClass = new ClientSubscribeRequestSerialiserClass()

Const CloseClientRequestSerialiser

CloseClientRequestSerialiser: CloseClientRequestSerialiserClass = new CloseClientRequestSerialiserClass()

The {@link SecurityCommandScriptResultSerialiser} singleton

Const CommandHeaderSerialiser

CommandHeaderSerialiser: CommandHeaderSerialiserClass = new CommandHeaderSerialiserClass()

The CommandHeaderSerialiser singleton

Const ControlGroupSerialiser

ControlGroupSerialiser: ControlGroupSerialiserClass = new ControlGroupSerialiserClass()

The ControlGroupSerialiser singleton

Const ControlRegistrationParamsSerialiser

ControlRegistrationParamsSerialiser: ControlRegistrationParamsSerialiserClass = new ControlRegistrationParamsSerialiserClass()

Const CountOrParserErrorsSerialiser

CountOrParserErrorsSerialiser: CountOrParserErrorsSerialiserClass = new CountOrParserErrorsSerialiserClass()

Const CreateRemoteServerResultSerialiser

CreateRemoteServerResultSerialiser: CreateRemoteServerResultSerialiserClass = new CreateRemoteServerResultSerialiserClass()

Const CreateTopicViewResultSerialiser

CreateTopicViewResultSerialiser: CreateTopicViewResultSerialiserClass = new CreateTopicViewResultSerialiserClass()

Const CreateUpdateStreamAndSetRequestSerialiser

CreateUpdateStreamAndSetRequestSerialiser: CreateUpdateStreamAndSetRequestSerialiserClass = new CreateUpdateStreamAndSetRequestSerialiserClass()

Const CreateUpdateStreamRequestSerialiser

CreateUpdateStreamRequestSerialiser: CreateUpdateStreamRequestSerialiserClass = new CreateUpdateStreamRequestSerialiserClass()

Const CreateUpdateStreamResponseSerialiser

CreateUpdateStreamResponseSerialiser: CreateUpdateStreamResponseSerialiserClass = new CreateUpdateStreamResponseSerialiserClass()

Const DEFAULT

DEFAULT: object = Object.freeze(new ControlGroup('default'))

A default Control Group

Type declaration

Const DEFAULT_ACTIVITY_MONITOR

DEFAULT_ACTIVITY_MONITOR: true = true

Const DEFAULT_HOST

DEFAULT_HOST: string = (typeof window !== 'undefined' && window.location.hostname)? window.location.hostname: 'localhost'

Const DEFAULT_MAX_MESSAGE_SIZE

DEFAULT_MAX_MESSAGE_SIZE: 2147483647 = 2147483647

Const DEFAULT_PASSWORD

DEFAULT_PASSWORD: "" = ""

Const DEFAULT_PATH

DEFAULT_PATH: "/diffusion" = "/diffusion"

Const DEFAULT_PORT

DEFAULT_PORT: number = (typeof window !== 'undefined'&& window.location.protocol === 'http:'&& window.location.port)? parseInt(window.location.port, 10): 80

Const DEFAULT_PRINCIPAL

DEFAULT_PRINCIPAL: "" = ""

Const DEFAULT_RANGE

DEFAULT_RANGE: Range = new Range(Point.atStart(), Point.offset(0))

A unique range covering the complete time series

Const DEFAULT_RANGE_QUERY

DEFAULT_RANGE_QUERY: object = Object.freeze(new RangeQueryParameters(QueryTypes.VALUES,DEFAULT_RANGE,DEFAULT_RANGE,MAX_SAFE_INTEGER))

A default range query

Type declaration

Const DEFAULT_RECONNECT_TIMEOUT

DEFAULT_RECONNECT_TIMEOUT: 60000 = 60000

Const DEFAULT_SECURE

DEFAULT_SECURE: boolean = typeof window === 'undefined' || window.location.protocol !== 'http:'

Const DEFAULT_SECURE_PORT

DEFAULT_SECURE_PORT: number = (typeof window !== 'undefined'&& window.location.protocol === 'https:'&& window.location.port)? parseInt(window.location.port, 10): 443

Const DEFAULT_TRANSPORTS

DEFAULT_TRANSPORTS: string[] = typeof window === 'undefined' ? ['WEBSOCKET'] : ['WEBSOCKET', 'XHR']

Const DELIMITER

DELIMITER: "////" = "////"

Const DENY

DENY: object = Object.freeze(new AuthenticatorResponse(TypeCode.DENY))

An AuthenticatorResponse that denies authenticator

Type declaration

DISCONNECTED

DISCONNECTED: any

Const DataTypesSingleton

DataTypesSingleton: DataTypesImpl = new DataTypesImpl()

Const DescendantQualifier

DescendantQualifier: object = Object.freeze({MATCH: new DQ(false),DESCENDANTS_OF_MATCH: new DQ(true),MATCH_AND_DESCENDANTS: new DQ(true)})

An enum like object containing descendant qualifiers

Type declaration

Const EDIT_EVENT

EDIT_EVENT: 1 = 1

Const EMPTY

EMPTY: JSONPointerMap = new JSONPointerMap()

An empty JSONPointerMap

Const EMPTY_BUFFER

EMPTY_BUFFER: Buffer = Buffer.alloc(0)

Const EMPTY_FIELD

EMPTY_FIELD: 3 = 3

Byte indicating an empty field

Const EMPTY_FIELD_STRING

EMPTY_FIELD_STRING: string = String.fromCharCode(EMPTY_FIELD)

String representation of a byte indicating an empty field

Const EntriesFetchRequestSerialiser

EntriesFetchRequestSerialiser: EntriesFetchRequestSerialiserClass = new EntriesFetchRequestSerialiserClass()

Const EntriesFetchResponseSerialiser

EntriesFetchResponseSerialiser: EntriesFetchResponseSerialiserClass = new EntriesFetchResponseSerialiserClass()

Const ErrorReasonSerialiser

ErrorReasonSerialiser: ErrorReasonSerialiserClass = new ErrorReasonSerialiserClass()

The ErrorReasonSerialiser singleton

Const ErrorReportListSerialiser

ErrorReportListSerialiser: ErrorReportListSerialiserClass = new ErrorReportListSerialiserClass()

Const ErrorReportSerialiser

ErrorReportSerialiser: ErrorReportSerialiserClass = new ErrorReportSerialiserClass()

The ErrorReportSerialiser singleton

Const EventMetadataImplSerialiser

EventMetadataImplSerialiser: EventMetadataImplSerialiserClass = new EventMetadataImplSerialiserClass()

Const FALLBACK_SELECTOR

FALLBACK_SELECTOR: any = new SelectorSet([])

Const FIELD_DELIMITER

FIELD_DELIMITER: 2 = 2

Delimiter byte for fields

Const FIELD_DELIMITER_STRING

FIELD_DELIMITER_STRING: string = String.fromCharCode(FIELD_DELIMITER)

String representation of a delimiter byte for fields

Const FIELD_MU

FIELD_MU: 5 = 5

Byte indicating a single field

Const FIELD_MU_STRING

FIELD_MU_STRING: string = String.fromCharCode(FIELD_MU)

String representation of a byte indicating a single field

Const FetchQueryResultSerialiser

FetchQueryResultSerialiser: FetchQueryResultSerialiserClass = new FetchQueryResultSerialiserClass()

Const FetchQuerySerialiser

FetchQuerySerialiser: FetchQuerySerialiserClass = new FetchQuerySerialiserClass()

The {@link FetchRequestSerialiser} singleton

Const GetSessionPropertiesRequestSerialiser

GetSessionPropertiesRequestSerialiser: GetSessionPropertiesRequestSerialiserClass = new GetSessionPropertiesRequestSerialiserClass()

Const GetSessionPropertiesResponseSerialiser

GetSessionPropertiesResponseSerialiser: GetSessionPropertiesResponseSerialiserClass = new GetSessionPropertiesResponseSerialiserClass()

Const INDEX0

INDEX0: IndexSegment = new IndexSegment(0)

INITIALISING

INITIALISING: any

Const JMXObjectNamesSerialiser

JMXObjectNamesSerialiser: JMXObjectNamesSerialiserClass = new JMXObjectNamesSerialiserClass()

The singleton

Const JsonPatchResultSerialiser

JsonPatchResultSerialiser: JsonPatchResultSerialiserClass = new JsonPatchResultSerialiserClass()

Const LOG

LOG: any = logger.create('Conversation Set')

Const ListGlobalPermissionsResultSerialiser

ListGlobalPermissionsResultSerialiser: ListGlobalPermissionsResultSerialiserClass = new ListGlobalPermissionsResultSerialiserClass()

Const ListPathPermissionsResultSerialiser

ListPathPermissionsResultSerialiser: ListPathPermissionsResultSerialiserClass = new ListPathPermissionsResultSerialiserClass()

Const ListRemoteServersResultSerialiser

ListRemoteServersResultSerialiser: ListRemoteServersResultSerialiserClass = new ListRemoteServersResultSerialiserClass()

Const ListTopicViewsResultSerialiser

ListTopicViewsResultSerialiser: ListTopicViewsResultSerialiserClass = new ListTopicViewsResultSerialiserClass()

Const MAXIMUM_STORAGE

MAXIMUM_STORAGE: 2147483647 = 2147483647

Const MAX_INT32

MAX_INT32: 2147483647 = 2147483647

Maximum 32 bit integer value: 2^32 - 1

Const MAX_SAFE_INTEGER

MAX_SAFE_INTEGER: 9007199254740991 = 9007199254740991

Maximum safe integer value for JavaScript numbers: 2^53 - 1

Const MBeanValuesSerialiser

MBeanValuesSerialiser: MBeanValuesSerialiserClass = new MBeanValuesSerialiserClass()

The singleton

Const MESSAGE_TYPE_MASK

MESSAGE_TYPE_MASK: 11000000 = 11000000

Bitmask for the message type

Const METADATA_OFFSETS

METADATA_OFFSETS: 2 = 2

Const MIN_MAX_MESSAGE_SIZE

MIN_MAX_MESSAGE_SIZE: 1024 = 1024

Const MIN_SAFE_INTEGER

MIN_SAFE_INTEGER: -9007199254740991 = -9007199254740991

Const MeasuredEntityClassMetricsSerialiser

MeasuredEntityClassMetricsSerialiser: MeasuredEntityClassMetricsSerialiserClass = new MeasuredEntityClassMetricsSerialiserClass()

The singleton

Const MessageReceiverControlRegistrationParamsSerialiser

MessageReceiverControlRegistrationParamsSerialiser: MessageReceiverControlRegistrationParamsSerialiserClass = new MessageReceiverControlRegistrationParamsSerialiserClass()

Const MessageReceiverControlRegistrationRequestSerialiser

MessageReceiverControlRegistrationRequestSerialiser: MessageReceiverControlRegistrationRequestSerialiserClass = new MessageReceiverControlRegistrationRequestSerialiserClass()

Const MessagingClientForwardSendRequestSerialiser

MessagingClientForwardSendRequestSerialiser: MessagingClientForwardSendRequestSerialiserClass = new MessagingClientForwardSendRequestSerialiserClass()

Const MessagingClientSendRequestSerialiser

MessagingClientSendRequestSerialiser: MessagingClientSendRequestSerialiserClass = new MessagingClientSendRequestSerialiserClass()

Const MessagingFilterResponseSerialiser

MessagingFilterResponseSerialiser: MessagingFilterResponseSerialiserClass = new MessagingFilterResponseSerialiserClass()

Const MessagingFilterSendRequestSerialiser

MessagingFilterSendRequestSerialiser: MessagingFilterSendRequestSerialiserClass = new MessagingFilterSendRequestSerialiserClass()

Const MessagingFilterSendResponseSerialiser

MessagingFilterSendResponseSerialiser: MessagingFilterSendResponseSerialiserClass = new MessagingFilterSendResponseSerialiserClass()

Const MessagingResponseSerialiser

MessagingResponseSerialiser: MessagingResponseSerialiserClass = new MessagingResponseSerialiserClass()

Const MessagingSendRequestSerialiser

MessagingSendRequestSerialiser: MessagingSendRequestSerialiserClass = new MessagingSendRequestSerialiserClass()

Const MetricCollectorNameSerialiser

MetricCollectorNameSerialiser: MetricCollectorNameSerialiserClass = new MetricCollectorNameSerialiserClass()

The singleton

Const MissingTopicRequestSerialiser

MissingTopicRequestSerialiser: MissingTopicRequestSerialiserClass = new MissingTopicRequestSerialiserClass()

Const NEXT_ADAPTER_ID

NEXT_ADAPTER_ID: function = (() => {let id = new Long(0);return () => {id = id.add(1);return new ConversationId(id);};})()

A generator for creating sequential adapter IDs across an arbitrary number of stream registries.

Type declaration

Const NEXT_CID

NEXT_CID: IdGenerator = (() => {let id = new Long(0);return async () => {id = id.add(1);return new ConversationId(id);};})()

A generator for creating sequential conversation IDs across an arbitrary number of conversation sets.

Const NEXT_RID

NEXT_RID: function = (() => {let id = new Long(0);return () => {id = id.add(1);return new ConversationId(id);};})()

Type declaration

Const NO_CHANGE

NO_CHANGE: NoChange = new NoChange()

Global no-change constant Instance of the NoChange RecordV2 delta

Const NULL_CBOR

NULL_CBOR: any = new BytesImpl(Buffer.from([0xf6]))

Const NamedTopicViewSpecificationSerialiser

NamedTopicViewSpecificationSerialiser: NamedTopicViewSpecificationSerialiserClass = new NamedTopicViewSpecificationSerialiserClass()

Const NodeWebSocket

NodeWebSocket: any = require('ws')

Const ONEWAY_CID

ONEWAY_CID: ConversationId = new ConversationId(Long.fromNumber(0))

A special conversation ID for one-way conversations

Const ORIGINAL_EVENT

ORIGINAL_EVENT: 0 = 0

Const P16

P16: number = 1 << 16

Const P24

P24: number = 1 << 24

Const P32

P32: number = P16 * P16

Const PADDING

PADDING: "0000000000000000" = "0000000000000000"

Const PATH_SEPARATOR

PATH_SEPARATOR: "/" = "/"

The topic path separator character.

RECONNECTING

RECONNECTING: any

Const RECORD_DELIMITER

RECORD_DELIMITER: 1 = 1

Delimiter byte for records

Const RECORD_DELIMITER_STRING

RECORD_DELIMITER_STRING: string = String.fromCharCode(RECORD_DELIMITER)

String representation of a delimiter byte for records

Const RECORD_MU

RECORD_MU: 4 = 4

Byte indicating a single record

Const RECORD_MU_STRING

RECORD_MU_STRING: string = String.fromCharCode(RECORD_MU)

String representation of a byte indicating a single record

Const RECOVERY_BUFFER_INDEX_SIZE

RECOVERY_BUFFER_INDEX_SIZE: number = (global as any).DIFFUSION_RECOVERY_BUFFER_INDEX_SIZE || 8

The default recovery buffer index size

Const REPLACE

REPLACE: 1 = 1

Const ROOT

ROOT: JSONPointer = new JSONPointer([])

JSONPointer representing the root

Const RangeQueryRequestSerialiser

RangeQueryRequestSerialiser: RangeQueryRequestSerialiserClass = new RangeQueryRequestSerialiserClass()

Const RangeQueryResultSerialiser

RangeQueryResultSerialiser: RangeQueryResultSerialiserClass = new RangeQueryResultSerialiserClass()

Const RemoteServerDefinitionSerialiser

RemoteServerDefinitionSerialiser: RemoteServerDefinitionSerialiserClass = new RemoteServerDefinitionSerialiserClass()

Const RemoveTopicSerialiser

RemoveTopicSerialiser: RemoveTopicSerialiserClass = new RemoveTopicSerialiserClass()

The RemoveTopicSerialiser singleton

Const ReplaceLicenceResponseSerialiser

ReplaceLicenceResponseSerialiser: ReplaceLicenceResponseSerialiserClass = new ReplaceLicenceResponseSerialiserClass()

Const ResponseCommandHeaderSerialiser

ResponseCommandHeaderSerialiser: ResponseCommandHeaderSerialiserClass = new ResponseCommandHeaderSerialiserClass()

Const START_POINT

START_POINT: Point = new Point(0, Types.ABSOLUTE_START)

A unique start point

Const SUCCESS

SUCCESS: 0 = 0

Const SecurityCommandScriptSerialiser

SecurityCommandScriptSerialiser: SecurityCommandScriptSerialiserClass = new SecurityCommandScriptSerialiserClass()

Const SecurityConfigurationSerialiser

SecurityConfigurationSerialiser: SecurityConfigurationSerialiserClass = new SecurityConfigurationSerialiserClass()

Const ServerMetricsSerialiser

ServerMetricsSerialiser: ServerMetricsSerialiserClass = new ServerMetricsSerialiserClass()

The singleton

Const SessionIdSerialiser

SessionIdSerialiser: SessionIdSerialiserClass = new SessionIdSerialiserClass()

The BooleanSerialiser singleton

Const SessionLockAcquisitionSerialiser

SessionLockAcquisitionSerialiser: SessionLockAcquisitionSerialiserClass = new SessionLockAcquisitionSerialiserClass()

Const SessionLockRequestSerialiser

SessionLockRequestSerialiser: SessionLockRequestSerialiserClass = new SessionLockRequestSerialiserClass()

Const SessionMetricCollectorListSerialiser

SessionMetricCollectorListSerialiser: SessionMetricCollectorListSerialiserClass = new SessionMetricCollectorListSerialiserClass()

The singleton

Const SessionMetricCollectorSerialiser

SessionMetricCollectorSerialiser: SessionMetricCollectorSerialiserClass = new SessionMetricCollectorSerialiserClass()

The singleton

Const SessionPropertiesEventBatchSerialiser

SessionPropertiesEventBatchSerialiser: SessionPropertiesEventBatchSerialiserClass = new SessionPropertiesEventBatchSerialiserClass()

Const SessionPropertiesEventSerialiser

SessionPropertiesEventSerialiser: SessionPropertiesEventSerialiserClass = new SessionPropertiesEventSerialiserClass()

Const SessionPropertyValidationSerialiser

SessionPropertyValidationSerialiser: SessionPropertyValidationSerialiserClass = new SessionPropertyValidationSerialiserClass()

Const SetClientConflationFilterRequestSerialiser

SetClientConflationFilterRequestSerialiser: SetClientConflationFilterRequestSerialiserClass = new SetClientConflationFilterRequestSerialiserClass()

Const SetClientConflationRequestSerialiser

SetClientConflationRequestSerialiser: SetClientConflationRequestSerialiserClass = new SetClientConflationRequestSerialiserClass()

Const SetSessionPropertiesFilterRequestSerialiser

SetSessionPropertiesFilterRequestSerialiser: SetSessionPropertiesFilterRequestSerialiserClass = new SetSessionPropertiesFilterRequestSerialiserClass()

Const SetSessionPropertiesListenerSerialiser

SetSessionPropertiesListenerSerialiser: SetSessionPropertiesListenerSerialiserClass = new SetSessionPropertiesListenerSerialiserClass()

Const SetSessionPropertiesRequestSerialiser

SetSessionPropertiesRequestSerialiser: SetSessionPropertiesRequestSerialiserClass = new SetSessionPropertiesRequestSerialiserClass()

Const SetSessionPropertiesResultSerialiser

SetSessionPropertiesResultSerialiser: SetSessionPropertiesResultSerialiserClass = new SetSessionPropertiesResultSerialiserClass()

Const SetTopicRequestSerialiser

SetTopicRequestSerialiser: SetTopicRequestSerialiserClass = new SetTopicRequestSerialiserClass()

Const StringSerialiser

StringSerialiser: StringSerialiserClass = new StringSerialiserClass()

The StringSerialiser singleton

Const Subtransports

Subtransports: object = Object.freeze({/*** WebSocket subtransport. Supports detection of availability and construction when available.*/WS : websocketSubTransportFactoryProvider(),/*** HTTP polling subtransport. Supports detection of availability and construction when available.*/XHR : xhrSubTransportFactoryProvider(),/*** WebSocket subtransport. Supports detection of availability and construction when available.*/WEBSOCKET : websocketSubTransportFactoryProvider(),/*** HTTP polling subtransport. Supports detection of availability and construction when available.*/HTTP_POLLING : xhrSubTransportFactoryProvider()})

Support the detection and creation of WebSocket and XmlHttpRequest objects in an environment independent way. Each subtransport object provides an enabled field that indicates if the subtransport works and if it works the environment specific constructor for the object.

The subtransports will be looked up by transport name.

Type declaration

Const SystemAuthenticationConfigurationSerialiser

SystemAuthenticationConfigurationSerialiser: SystemAuthenticationConfigurationSerialiserClass = new SystemAuthenticationConfigurationSerialiserClass()

Const SystemPrincipalSerialiser

SystemPrincipalSerialiser: SystemPrincipalSerialiserClass = new SystemPrincipalSerialiserClass()

Const TIMESTAMP_ROUNDING

TIMESTAMP_ROUNDING: 10 = 10

How many bits of a timestamp to discard. The default rounds to approximately 1 second.

see

roundTimeStamp

Const TIME_SERIES_DATA_TYPE

TIME_SERIES_DATA_TYPE: any = TimeSeriesEventDataType.create<any, any, any>({name: () => 'event data type',readValue: (buffer: Buffer) => buffer,toBytes: (val: any): BytesImpl => val} as any)

Const TOKEN_LENGTH

TOKEN_LENGTH: 24 = 24

The buffer length os a session token

Const TWO_POW_32

TWO_POW_32: 4294967296 = 4294967296

Const TimeSeriesAppendRequestSerialiser

TimeSeriesAppendRequestSerialiser: TimeSeriesAppendRequestSerialiserClass = new TimeSeriesAppendRequestSerialiserClass()

Const TimeSeriesEditRequestSerialiser

TimeSeriesEditRequestSerialiser: TimeSeriesEditRequestSerialiserClass = new TimeSeriesEditRequestSerialiserClass()

Const TimeSeriesTimestampAppendRequestSerialiser

TimeSeriesTimestampAppendRequestSerialiser: TimeSeriesTimestampAppendRequestSerialiserClass = new TimeSeriesTimestampAppendRequestSerialiserClass()

Const TopicAddRequestSerialiser

TopicAddRequestSerialiser: TopicAddRequestSerialiserClass = new TopicAddRequestSerialiserClass()

Const TopicAddResponseSerialiser

TopicAddResponseSerialiser: TopicAddResponseSerialiserClass = new TopicAddResponseSerialiserClass()

Const TopicControlRegistrationParamsSerialiser

TopicControlRegistrationParamsSerialiser: TopicControlRegistrationParamsSerialiserClass = new TopicControlRegistrationParamsSerialiserClass()

Const TopicControlRegistrationRequestSerialiser

TopicControlRegistrationRequestSerialiser: TopicControlRegistrationRequestSerialiserClass = new TopicControlRegistrationRequestSerialiserClass()

Const TopicMetricCollectorListSerialiser

TopicMetricCollectorListSerialiser: TopicMetricCollectorListSerialiserClass = new TopicMetricCollectorListSerialiserClass()

The singleton

Const TopicMetricCollectorSerialiser

TopicMetricCollectorSerialiser: TopicMetricCollectorSerialiserClass = new TopicMetricCollectorSerialiserClass()

The singleton

Const TopicNotificationDeregistrationRequestSerialiser

TopicNotificationDeregistrationRequestSerialiser: TopicNotificationDeregistrationRequestSerialiserClass = new TopicNotificationDeregistrationRequestSerialiserClass()

Const TopicNotificationDescendantEventSerialiser

TopicNotificationDescendantEventSerialiser: TopicNotificationDescendantEventSerialiserClass = new TopicNotificationDescendantEventSerialiserClass()

Const TopicNotificationDeselectionSerialiser

TopicNotificationDeselectionSerialiser: TopicNotificationDeselectionSerialiserClass = new TopicNotificationDeselectionSerialiserClass()

Const TopicNotificationEventSerialiser

TopicNotificationEventSerialiser: TopicNotificationEventSerialiserClass = new TopicNotificationEventSerialiserClass()

Const TopicNotificationSelectionSerialiser

TopicNotificationSelectionSerialiser: TopicNotificationSelectionSerialiserClass = new TopicNotificationSelectionSerialiserClass()

Const TopicSelectorSerialiser

TopicSelectorSerialiser: TopicSelectorSerialiserClass = new TopicSelectorSerialiserClass()

The TopicSelectorSerialiser singleton

Const TopicSpecificationInfoSerialiser

TopicSpecificationInfoSerialiser: TopicSpecificationInfoSerialiserClass = new TopicSpecificationInfoSerialiserClass()

Const TopicWillParametersSerialiser

TopicWillParametersSerialiser: TopicWillParametersSerialiserClass = new TopicWillParametersSerialiserClass()

Const UnsubscriptionNotificationSerialiser

UnsubscriptionNotificationSerialiser: UnsubscriptionNotificationSerialiserClass = new UnsubscriptionNotificationSerialiserClass()

Const UpdateStreamAddTopicRequestSerialiser

UpdateStreamAddTopicRequestSerialiser: UpdateStreamAddTopicRequestSerialiserClass = new UpdateStreamAddTopicRequestSerialiserClass()

Const UpdateStreamAddTopicResponseSerialiser

UpdateStreamAddTopicResponseSerialiser: UpdateStreamAddTopicResponseSerialiserClass = new UpdateStreamAddTopicResponseSerialiserClass()

Const UpdateStreamIdSerialiser

UpdateStreamIdSerialiser: UpdateStreamIdSerialiserClass = new UpdateStreamIdSerialiserClass()

The UpdateStreamIdSerialiser singleton

Const UpdateStreamRequestSerialiser

UpdateStreamRequestSerialiser: UpdateStreamRequestSerialiserClass = new UpdateStreamRequestSerialiserClass()

Const WillRegistrationResultSerialiser

WillRegistrationResultSerialiser: WillRegistrationResultSerialiserClass = new WillRegistrationResultSerialiserClass()

Const ZLIB_TYPE_FLAGS

ZLIB_TYPE_FLAGS: 128 = 128

A flag indicating a zlib compressed message

Const build

build: string = "73633"

The build version of this client library

Let cacheBytesRead

cacheBytesRead: number

Let cachedHash

cachedHash: Buffer

Const cachedParse

cachedParse: function = disableTopicCache ? parseSelector : memoize(parseSelector, {}, memoizeMatcher)

Wrap the parse function to cache results

Type declaration

Let cachedTopicSpecification

cachedTopicSpecification: TopicSpecification

Const clients

clients: ClientControlOptionsNamespace = ClientControlOptions

Access to PropertyKeys

Const datatypes

datatypes: DataTypes = DataTypesImpl

Access to the datatypes namespace

Const disableTopicCache

disableTopicCache: boolean = process && process.env && (process.env.DISABLE_TOPIC_CACHE === 'true')

Const emitterEventQueue

emitterEventQueue: EmitterEventQueue = new EmitterEventQueue()

Const encoder

encoder: any = new Encoder()

Global CBOR encoder

Const errors

errors: object = ErrorReason

The ErrorReason enum

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',]

Valid TopicSpecification keys

Const knownTransports

knownTransports: object = Object.freeze({WS : WSTransport,XHR : XHRTransport,WEBSOCKET : WSTransport,HTTP_POLLING : XHRTransport})

The known transports. Will be looked up by name.

Type declaration

  • [name: string]: object

Const locks

locks: SessionLockOptionsNamespace = SessionLockOptions

Access to the locks namespace

Const logger

logger: any = Logger.create('Message')

Const metaChars

metaChars: string[] = ['*', '.', '+', '?', '^', '$', '{', '}', '(', ')', '[', ']', '\\', '|']

Invalid characters for a topic path to contain

Let onconnect

onconnect: function

Type declaration

    • (e: MessageEvent): void
    • Parameters

      • e: MessageEvent

      Returns void

Const pingTimeoutFactor

pingTimeoutFactor: 2 = 2

The client will wait a maximum of two system ping periods for a ping from the server before declaring the connection idle and closing it.

Const selectors

selectors: TopicSelectors = new TopicSelectors()

Access to the selectors namespace

Const setLevel

setLevel: setLevel = logger.setLevel

Disables logging below the given level.

Export is forwarded from loglevel.setLevel.

see

https://www.npmjs.com/package/loglevel

Const sharedWorkers

sharedWorkers: object

The SharedWorker message routers indexed by the URL of the worker JS file

Type declaration

Const topicUpdate

topicUpdate: TopicUpdateNamespace = TopicUpdateNamespace

Access to the topicUpdate namespace

Const topics

topics: TopicsNamespace = topicsNamespace

Access to the topics namespace

Const unconstrained

unconstrained: any = new Unconstrained()

An unconstrained topic constraint that is sent to the server when no other constraint has been specified.

Const updateConstraintFactory

updateConstraintFactory: object = Object.freeze(new UpdateConstraintFactoryImpl())

The UpdateConstraintFactory singleton instance

Type declaration

Const version

version: string = "6.6.0-preview.1"

The version of this client library in the form major.minor.patch

Const workerSessionRegistry

workerSessionRegistry: WorkerSessionRegistry = new WorkerSessionRegistry(WorkerSessionAdapter.create)

Const x7F

x7F: Long = Long.fromNumber(0x7F)

Const x7FInv

x7FInv: Long = x7F.not()

Const x80

x80: Long = Long.fromNumber(0x80)

Let zlib

zlib: any

Functions

Const DEFAULT_ABORT_STRATEGY

  • DEFAULT_ABORT_STRATEGY(start: function, abort: function): void
  • Parameters

    • start: function
        • (): void
        • Returns void

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

    Returns void

Const DEFAULT_RECONNECT_STRATEGY

  • DEFAULT_RECONNECT_STRATEGY(start: function): void
  • Parameters

    • start: function
        • (): void
        • Returns void

    Returns void

EDIT_RANGE

INSERT

  • INSERT(script: EditScript, start: number, length: number): boolean
  • Parameters

    Returns boolean

MATCH

  • MATCH(script: EditScript, start: number, length: number): boolean
  • Parameters

    Returns boolean

VIEW_RANGE

addField

  • addField(bytes: Buffer, records: RecordData[], startPos: number, endPos: number, fields: RecordData): boolean
  • Add a field to the array of fields

    Parameters

    • bytes: Buffer

      the buffer to parse

    • records: RecordData[]

      a reference to the records that will be constructed.

    • startPos: number

      the start position in the buffer of the last field

    • endPos: number

      the end position in the buffer of the last field

    • fields: RecordData

    Returns boolean

    true if the fields have been added to the records.

approximateSquareRoot

  • approximateSquareRoot(value: number): number
  • Cheap approximation to a square root.

    Parameters

    • value: number

      the argument of the square-root function

    Returns number

    a power of two that approximates the square root of a value

bytesToEvent

  • bytesToEvent<V>(bytesToValue: function, bytes: Bytes): Event<V>
  • A converter function that converts bytes data to an event

    Type parameters

    • V

    Parameters

    • bytesToValue: function

      a converter function that converts bytes data to an underlying value

        • (bytes: Buffer): V
        • Parameters

          • bytes: Buffer

          Returns V

    • bytes: Bytes

      the bytes containing the event in binary form

    Returns Event<V>

    the event that was extracted from the bytes

bytesToString

  • bytesToString(bytes: number[] | Buffer, offset: number, length: number): string
  • Convert a buffer or array of bytes containing Record V2 data into a string

    Parameters

    • bytes: number[] | Buffer

      the bytes to convert

    • offset: number

      the starting position in the buffer

    • length: number

      the number of bytes to convert

    Returns string

    a string representation of the bytes

callWithArguments

  • callWithArguments(fn: function, args: any[]): any
  • Call a function with arguments passed in as an array

    Optimisation of Function.apply for small number of arguments

    Function.apply is more than 20 times slower than direct function calls see https://jsperf.com/function-versus-function-call-versus-function-apply

    Parameters

    • fn: function

      the function to call

        • (...a: any[]): any
        • Parameters

          • Rest ...a: any[]

          Returns any

    • args: any[]

      the arguments in n array

    Returns any

    the return value of the function call

canReadAs

  • Indicates whether a specified topic type can be read as a specified data type.

    function

    diffusion.topics.FetchRequestImpl#canReadAs

    Parameters

    Returns any

    true if the topic type can be read as the data type

canonicalise

  • canonicalise(path: string): string
  • Provide a canonical representation of a given path, stripping leading and trailing path separators

    Parameters

    • path: string

      the path

    Returns string

    the canonicalised path

cborCost

  • cborCost(i: number): number
  • The CBOR cost of an unsigned integer in bytes. It's cheaper to calculate than flush the encoder and check the number of written bytes.

    Parameters

    • i: number

      the integer to check

    Returns number

    byte cost

checkBounds

  • checkBounds(buffer: Buffer, offset: number, length: number): void
  • Parameters

    • buffer: Buffer
    • offset: number
    • length: number

    Returns void

checkMultiplicity

  • checkMultiplicity(name: string, min: number, max: number): void
  • Check if min and max values specify a valid multiplicity

    throws

    an error if min and max values specify an invalid multiplicity

    Parameters

    • name: string

      the name of the Field or Record to check

    • min: number

      the minimum number of times the field should occur within the record

    • max: number

      the maximum number of times the field should occur within the record

    Returns void

checkSatisfiability

  • Check the satisfiability of applying a number of constraints.

    throws

    an error if multiple constraints constrain the topic value

    Parameters

    Returns void

checkScale

  • checkScale(name: string, scale: number): void
  • Check if scale values specify a valid multiplicity

    throws

    an error if scale<1

    Parameters

    • name: string

      the name of the Field

    • scale: number

      the scale of the field (number of decimal places). This must be positive.

    Returns void

cidFromHeaders

  • Get the conversation id from the message headers

    Parameters

    • headers: string[]

      the message headers

    Returns ConversationId

    the conversation ID

coalesce

  • Parameters

    • delegate: EditScript
    • aOffset: number
    • bOffset: number

    Returns CoalescingScript

code

  • Create a new response code

    Parameters

    • id: number

      the respnse code id

    • message: string

      the message

    Returns ResponseCode

    a new response code

collectionToString

  • collectionToString(values: Set<string> | string[]): string
  • Converts a set of values to a canonicalised property string representation, escaping as required.

    Uses comma separators and single quotes.

    Parameters

    • values: Set<string> | string[]

      a set of strings

    Returns string

    a string with each of the members escaped, quoted and concatenated

comparingSequenceNumbers

  • comparingSequenceNumbers(e1: Event<any>, e2: Event<any>): number
  • Compare two Events by their sequence numbers

    Sorts first by originalEvent.sequence. Events with equal originalEvent.sequence are sorted according to their sequence field.

    Parameters

    • e1: Event<any>

      the first event to compare

    • e2: Event<any>

      the second event to compare

    Returns number

    +1 if the first event has a larger sequence number than the second event, -1 otherwise

completeReadUpdateEvent

conflatableMatch

  • conflatableMatch(matchStart: number, matchLength: number, insertLength: number): boolean
  • Check if a match should be conflated with an insert

    Parameters

    • matchStart: number

      the starting position of the match

    • matchLength: number

      the number of bytes in the match

    • insertLength: number

      the number of bytes to be instered

    Returns boolean

    true if it is worth conflating a match with an adjacent insert

connect

  • connect(options: Options | string, sessionName?: undefined | string, workerJs?: undefined | string): Result<Session>
  • Connect to a specified Diffusion server. This will return a Result that will complete successfully if a session can be connected, or fail if an error was encountered.

    If the result is successful, the fulfilled handler will be called with a Session instance. This session will be in a connected state and may be used for subsequent API calls.

    If the result fails, the rejected handler will be called with an error reason.

    If sessionName and workerJs is supplied, then the call will create a shared session inside a shared WebWorker. If a shared session with that name already exists, this function will return an instance of the existing session. Shared sessions can only be created when running in a browser environment that supports the SharedWorker. For more information regarding shared sessions, see connectShared.

    Example:

    diffusion.connect('example.server.com').then(function(session) {
        // Connected with a session
        console.log('Connected!', session);
    }, function(error) {
        // Connection failed
        console.log('Failed to connect', error);
    });

    Parameters

    • options: Options | string

      the options to construct the session with. If a string is supplied, it will be interpreted as the host option.

    • Optional sessionName: undefined | string

      the name of the shared session

    • Optional workerJs: undefined | string

      the location of the diffusion worker script

    Returns Result<Session>

    a Result for this operation

connectShared

  • connectShared(sessionName: string, workerJs: string): Result<Session>
  • Connect to a specified Diffusion server using a shared WebWorker session. This will return a Result that will complete successfully if a session can be connected, or fail if an error was encountered. Shared sessions can only be created when running in a browser environment that supports the SharedWorker.

    Shared sessions are identified by a name. If a shared session with that name already exists, this function will return an instance of the existing session. Otherwise the call will fail. Sessions can only be shared across scripts originating from a single domain. Otherwise the browser will create independent shared workers resulting in one shared session for each domain.

    The shared session will stay alive as long as there is an open browser tab that initiated a connection through the shared session. When the last tab is closed the shared worker holding the shared session will be terminated. The shared session is also expected to be terminated when the only tab holding a reference to the session is reloaded or experiences a page navigation. The exact behavior may be browser dependent.

    The workerJs argument must be set to the URL of the diffusion-worker.js supplied with the JavaScript distribution. The same-origin policy of the shared worker requires the calling script and the diffusion-worker.js to reside on the same domain.

    If the result is successful, the fulfilled handler will be called with a Session instance. This session will be in a connected state and may be used for subsequent API calls.

    If the result fails, the rejected handler will be called with an error reason.

    Example:

    diffusion.connectShared('some-session', 'diffusion-worker.js')
    .then(function(session) {
        // Connected with a session
        console.log('Connected!', session);
    }, function(error) {
        // Connection failed
        console.log('Failed to connect', error);
    });

    Parameters

    • sessionName: string

      the name of the shared session

    • workerJs: string

      the location of the diffusion worker script

    Returns Result<Session>

    a Result for this operation

connectionActionFromString

  • Get a connection action from a string

    Parameters

    Returns ConnectionAction

    a connection action obtained from the string

connectionActivityMonitorFactory

  • Factory for connection activity monitors.

    Parameters

    Returns ConnectionActivityMonitor

connectionResponse

  • connectionResponse(onHandshakeSuccess: function, onHandshakeError: function, message: Buffer): ConnectionResponse | null
  • Connection response parser. Wraps the connection response deserialiser and takes callbacks for successful and failed parsing of the buffer.

    Parameters

    Returns ConnectionResponse | null

    the parsed response or null if parsing failed

constructURI

  • Construct a valid websocket URI from the given options.

    Parameters

    Returns string

    the connection URI

corner

  • corner(d: number, length: number): number
  • Limit a diagonal by the length of an input.

    If d is greater than the length, return the diagonal to use instead. This is used to constrain the forward vector entries to an (n+1) * (m+1) rectangle, and the reverse vector entries to an (m+1) * (n+1) rectangle.

    Parameters

    • d: number
    • length: number

    Returns number

create

createInternal

  • Create a new internal session

    Parameters

    • Optional options: OptionsImpl

      the options passed to the session

    Returns InternalSessionImpl

    a new internal session

createShared

  • createShared(name: string, workerJs: string): function

createTransport

  • Create the selected transport if enabled.

    Parameters

    • subtransports: object

      the subtransports that can be made

    • options: OptionsImpl

      the options used to connect

    • name: string

      the name of the subtransport to use

    Returns Transport

    an available transport if enabled

curryR

  • curryR(fn: function, ...args: any[]): function
  • Basic curry-right; provides partial application with arguments on the right

    Parameters

    • fn: function

      the function to call

        • (...a: any[]): any
        • Parameters

          • Rest ...a: any[]

          Returns any

    • Rest ...args: any[]

      the arguments passed to the function as the trailing arguments

    Returns function

    the curried function

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

        • Rest ...args: any[]

        Returns any

decimalModelValue

  • decimalModelValue(field: FieldImpl): string
  • Returns a model string representation of the field's data type for the decimal type.

    Parameters

    • field: FieldImpl

      the field providing the type information

    Returns string

    the zero value formatted according to the data type and scale

decode

  • Recursive token-parsing function; will evaluate tokens and build up complete object representations in order.

    Parameters

    Returns CBORValue

decodeAsString

  • Unpack V5 credentials from a string.

    Parameters

    • s: string

      the string

    Returns Credentials

    the v5 credentials

decompressSync

  • decompressSync(input: string | Buffer | DataView): Buffer
  • Thin wrapper around zlib.inflateSync

    Parameters

    • input: string | Buffer | DataView

      the compressed input

    Returns Buffer

    the decompressed output

defaultValidator

  • defaultValidator(): void
  • A validator that doesn't validate

    Returns void

deltaForAllNewRecords

  • deltaForAllNewRecords(newBytes: Buffer, newOffset: number, newLength: number): any
  • Create a RecordV2DeltaImpl that contains only new records

    Parameters

    • newBytes: Buffer

      the buffer of the new record

    • newOffset: number

      the offset in the buffer of the new record

    • newLength: number

      the number of bytes in the new record

    Returns any

    a new RecordV2DeltaImpl

deltaForEmptyNewValue

  • Create a new RecordV2DeltaImpl for an empty value

    Returns RecordV2DeltaImpl

    a new RecordV2DeltaImpl

deltaForOldSingleEmptyRecord

  • deltaForOldSingleEmptyRecord(newBytes: Buffer, newOffset: number, newLength: number): any
  • Return a delta for when the old value is a single empty record. This assumes that the new record is neither empty nor a single empty record.

    Parameters

    • newBytes: Buffer

      the buffer of the new record

    • newOffset: number

      the offset in the buffer of the new record

    • newLength: number

      the number of bytes in the new record

    Returns any

    a new RecordV2DeltaImpl

deltaForSingleEmptyRecordNewValue

  • deltaForSingleEmptyRecordNewValue(oldRecordCount: number): any
  • Create a new RecordV2DeltaImpl for a single record with no fields

    Parameters

    • oldRecordCount: number

    Returns any

    a new RecordV2DeltaImpl

deserialise

  • Deserialise connection responses according to the V5 protocol.

    Parameters

    • buffer: Buffer

      the Buffer to deserialise

    Returns ConnectionResponse

deserialiseTopicSpecification

  • deserialiseTopicSpecification(specification: string): any
  • Parameters

    • specification: string

    Returns any

deserialiseValue

  • Parameters

    Returns any

diffField

  • diffField(oldBytes: Buffer, oldOffset: number, oldLength: number, newBytes: Buffer, newOffset: number, newLength: number, result: DiffResult): void
  • Calculate the differences between two fields

    Parameters

    • oldBytes: Buffer

      the buffer of the old record

    • oldOffset: number

      the offset in the buffer of the old record

    • oldLength: number

      the number of bytes in the old record

    • newBytes: Buffer

      the buffer of the new record

    • newOffset: number

      the offset in the buffer of the new record

    • newLength: number

      the number of bytes in the new record

    • result: DiffResult

      the result recording the difference between the buffers

    Returns void

diffRecord

  • diffRecord(recordIndex: number, oldBytes: Buffer, oldOffset: number, oldLength: number, newBytes: Buffer, newOffset: number, newLength: number, result: DiffResult): void
  • Calculate the differences between two record entries

    Parameters

    • recordIndex: number

      the index of the record

    • oldBytes: Buffer

      the buffer of the old record

    • oldOffset: number

      the offset in the buffer of the old record

    • oldLength: number

      the number of bytes in the old record

    • newBytes: Buffer

      the buffer of the new record

    • newOffset: number

      the offset in the buffer of the new record

    • newLength: number

      the number of bytes in the new record

    • result: DiffResult

      the result recording the difference between the buffers

    Returns void

diffRecordFields

  • diffRecordFields(recordIndex: number, oldBytes: Buffer, oldOffset: number, oldLength: number, newBytes: Buffer, newOffset: number, newLength: number, result: DiffResult): void
  • Calculate the differences between the fields of two record entries

    Parameters

    • recordIndex: number

      the index of the record

    • oldBytes: Buffer

      the buffer of the old record

    • oldOffset: number

      the offset in the buffer of the old record

    • oldLength: number

      the number of bytes in the old record

    • newBytes: Buffer

      the buffer of the new record

    • newOffset: number

      the offset in the buffer of the new record

    • newLength: number

      the number of bytes in the new record

    • result: DiffResult

      the result recording the difference between the buffers

    Returns void

diffRecords

  • diffRecords(oldBytes: Buffer, oldOffset: number, oldLength: number, newBytes: Buffer, newOffset: number, newLength: number): DiffResult
  • Calculate the differences between two records

    Parameters

    • oldBytes: Buffer

      the buffer of the old record

    • oldOffset: number

      the offset in the buffer of the old record

    • oldLength: number

      the number of bytes in the old record

    • newBytes: Buffer

      the buffer of the new record

    • newOffset: number

      the offset in the buffer of the new record

    • newLength: number

      the number of bytes in the new record

    Returns DiffResult

    the difference between the buffers

diffWhenNewIsSingleEmptyField

  • diffWhenNewIsSingleEmptyField(recordIndex: number, oldBytes: Buffer, oldOffset: number, oldLength: number, result: DiffResult): void
  • Calculate the differences between two record entries when the new record contains a single empty field

    Parameters

    • recordIndex: number

      the index of the record

    • oldBytes: Buffer
    • oldOffset: number
    • oldLength: number
    • result: DiffResult

      the result recording the difference between the buffers

    Returns void

diffWhenOldIsSingleEmptyField

  • diffWhenOldIsSingleEmptyField(recordIndex: number, newBytes: Buffer, newOffset: number, newLength: number, result: DiffResult): void
  • Calculate the differences between two record entries when the old record contains a single empty field

    Parameters

    • recordIndex: number

      the index of the record

    • newBytes: Buffer
    • newOffset: number
    • newLength: number
    • result: DiffResult

      the result recording the difference between the buffers

    Returns void

drainToBuffer

  • drainToBuffer(messages: Buffer[]): Buffer
  • Create a single buffer containing multiple messages

    Parameters

    • messages: Buffer[]

      the messages to conflate

    Returns Buffer

    a single buffer containing all messages

encodeAsString

  • Tunnel a V5 credentials object as an encoded string within v4 password.

    Currently only supports an empty or string password.

    This implementation encapsulates code from both V4CredentialsTunnel and CredentialsSerialiser in the Java client.

    Parameters

    Returns string

    an encoded password

ensureOctetArray

  • ensureOctetArray(value: number[]): void
  • Ensure that the array contains only octet numbers

    throws

    an error if any entry in the array is not a number or out of range

    Parameters

    • value: number[]

      the array to check

    Returns void

entityCount

  • entityCount(bytes: number[] | Buffer, offset: number, length: number, mu: number, delimiter: number): number
  • Count the number of records or fields in the raw Record V2 data

    Parameters

    • bytes: number[] | Buffer

      the bytes to check

    • offset: number

      the starting position in the buffer

    • length: number

      the number of bytes to convert

    • mu: number

      the token indicating an empty set

    • delimiter: number

      the token separating two entities

    Returns number

    the number of records in the data

enumerize

  • enumerize<T>(obj: T): void
  • Add reverse lookup to an enum-like object in order to imitate TypeScript style enums. Each value must be an object that defines a numeric id property.

    Example:

    const enumLike = {
      FOO: { id: 0, msg: 'This is a Foo'},
      BAR: { id: 1, msg: 'This is a Bar'}
    }
    
    enumerize(enumLike);
    
    // enumLike = {
    //  FOO: { id: 0, msg: 'This is a Foo'},
    //  BAR: { id: 1, msg: 'This is a Bar'},
    //  0: 'FOO',
    //  1: 'BAR'
    // }

    Type parameters

    • T: object

    Parameters

    • obj: T

      the enum-like object

    Returns void

escape

  • escape(s: string): any
  • Escapes special characters in a string that is to be used within a topic property or a session filter.

    This is a convenience method which inserts an escape character '' before any of the special characters ' " or .

    since

    6.1

    Parameters

    • s: string

      the string to be escaped

    Returns any

    the string value with escape characters inserted as appropriate

escapeKey

  • escapeKey(key: string): string
  • Escape special characters in the JSON pointer key string

    Parameters

    • key: string

      the key string to escape

    Returns string

    the escaped string

eventToBytes

  • A converter function that converts an event to bytes data

    Type parameters

    • V

    Parameters

    • valueToBytes: function

      a converter function that converts an underlying value to bytes data

    • event: Event<V>

      the event to convert

    Returns BytesImpl

    the bytes containing the event

extractCommonPrefix

  • Extract the longest common prefix from a set of topic selectors

    Parameters

    Returns string

    the longest common prefix

extractPrefixFromRegex

  • extractPrefixFromRegex(remainder: string): string
  • Extract the largest possible topic path prefix from a string that may contain a regular expression.

    Parameters

    • remainder: string

      The remainder (i.e expression minus prefix)

    Returns string

    The maximum topic path that could be extracted

fieldCount

  • fieldCount(bytes: number[] | Buffer, offset: number, length: number): number
  • Count the number of fields in the raw Record V2 data

    Parameters

    • bytes: number[] | Buffer

      the bytes to check

    • offset: number

      the starting position in the buffer

    • length: number

      the number of bytes to convert

    Returns number

    the number of fields in the data

fieldEquals

  • fieldEquals(oldBytes: Buffer, oldOffset: number, newBytes: Buffer, newOffset: number, length: number): boolean
  • Check if two non-empty fields are equal

    Parameters

    • oldBytes: Buffer

      the buffer of the old record

    • oldOffset: number

      the offset in the buffer of the old record

    • newBytes: Buffer

      the buffer of the new record

    • newOffset: number

      the offset in the buffer of the new record

    • length: number

    Returns boolean

    true if the two fields are equal

fieldsAreEqual

  • fieldsAreEqual(oldBytes: Buffer, oldOffset: number, oldLength: number, newBytes: Buffer, newOffset: number, newLength: number): boolean
  • Check if two fields are equal. The fields may be empty.

    Parameters

    • oldBytes: Buffer

      the buffer of the old record

    • oldOffset: number

      the offset in the buffer of the old record

    • oldLength: number

      the number of bytes in the old record

    • newBytes: Buffer

      the buffer of the new record

    • newOffset: number

      the offset in the buffer of the new record

    • newLength: number

      the number of bytes in the new record

    Returns boolean

    true if the two fields are equal

fill

  • fill<T>(array: T[], value: T, start?: number, end?: number): void
  • Fill an array with a given value, within an optional range

    Type parameters

    • T

    Parameters

    • array: T[]

      the array to fill

    • value: T

      the value to fill the array with

    • Default value start: number = 0

      optional range start

    • Default value end: number = array.length

      optional range end

    Returns void

filterTransports

  • filterTransports(requestedTransports: string[], subtransports: object): string[]
  • Filter a list of transport names, removing any unknown or disabled transports.

    Parameters

    • requestedTransports: string[]

      array of transport names

    • subtransports: object

      the available subtransports

    Returns string[]

    the filtered array of transport names

findDelimiter

  • findDelimiter(bytes: number[] | Buffer, startIndex: number, endIndex: number, delimiter: number): number
  • Find a delimiter in the raw Record V2 data. Returns the position of the within the range [startIndex, endIndex). If the delimiter is not found, endIndex will be returned.

    Parameters

    • bytes: number[] | Buffer

      the bytes to check

    • startIndex: number

      the first index to begin searching

    • endIndex: number

      the last index to stop searching

    • delimiter: number

      the delimiter to search for

    Returns number

    the index of the delimiter

findNextPowerOfTwo

  • findNextPowerOfTwo(value: number): number
  • Find the next integer, equal or higher to the value, which is a power of two.

    Parameters

    • value: number

      the value to search from

    Returns number

    the next power of two

fromValue

  • Create a new BinaryImpl object from a buffer or BinaryImpl. If a BinaryImpl is passed as argument it is simply returned.

    throws

    an error if an incompatible datatype was supplied

    Parameters

    • value: Binary | Buffer

      the object to create a JSON from

    Returns BinaryImpl

    the record created

getBytes

  • getBytes(content: any): Buffer
  • Creates a Buffer from any data type

    If the content is a BufferSlice then getBytes returns the sliced data. If the content is a Buffer, it is returned unchanged. Otherwise a new Buffer is created from the content's toString() representation.

    Parameters

    • content: any

      the content

    Returns Buffer

    a Buffer containing the content

getComponents

  • Extract a component group from a single expression

    Parameters

    • expression: string

      the selector expression

    Returns TopicPathComponents

    an object containing parsed properties

getF

  • getF(v: number[], k: number): number
  • Parameters

    • v: number[]
    • k: number

    Returns number

getHeaderString

  • getHeaderString(message: Message): string
  • Construct a header string

    Parameters

    • message: Message

      the message from which to construct the header string

    Returns string

    the string to be serialised in the header

getInt32

  • getInt32(buffer: Buffer, high: boolean): number
  • Read a 32 bit integer from the buffer

    Parameters

    • buffer: Buffer

      the buffer to write into

    • high: boolean

      a flag indicating whether to read the high or the low bits of the buffer

    Returns number

    the integer that was read from the buffer

getR

  • getR(v: number[], k: number): number
  • Parameters

    • v: number[]
    • k: number

    Returns number

getSharedConversationSetFactory

  • A factory for conversation sets with conversation IDs obtained from the shared session.

    Parameters

    Returns (Anonymous function)

getSharedWorker

  • Get a shared worker message router

    Parameters

    • workerJs: string

      the JS file name that contains the worker code, should contain the path to the diffusion-worker.js file.

    Returns SharedWorkerMessageRouter

    An interface to the shared worker that allows communicating with named shared sessions

getType

  • getType(expression: string): Type | null
  • Determine the Topic Selector type of a given expression.

    Parameters

    • expression: string

      the selector expression

    Returns Type | null

    the topic selector type, or null

identity

  • identity<T>(val: T): T
  • The identity function

    Type parameters

    • T

    Parameters

    • val: T

      a value

    Returns T

    the input value val

int64Replacer

  • int64Replacer(key: string, value: any): any
  • Replacer function for JSON.stringify that replaces Int64Impl objects with their string representation

    Parameters

    • key: string

      the object key (this argument is ignored)

    • value: any

      the value to replace

    Returns any

    if value is an Int64Impl then the string representation is returned. Otherwise value is returned unchanged.

intBitsToFloat

  • intBitsToFloat(bytes: number): number

isAny

  • isAny(): boolean
  • Allow any CBOR types

    Returns boolean

    will always return true

isCascadableResponse

  • Check if a response code indicates that the client should attempt to cascade

    Parameters

    Returns boolean

    true if the client should attempt to cascade on receiving a response

isConstraintOnTopic

  • Check if the constraint constrains the topic value

    Parameters

    Returns boolean

    true if the constraint type is one of 'BINARY_VALUE', 'NO_VALUE', 'NO_TOPIC', 'PARTIAL_JSON'

isDouble

  • isDouble(cborType: types): boolean
  • Allow only floating point CBOR types

    Parameters

    • cborType: types

      the CBOR type

    Returns boolean

    true if the type is a floating point number

isInt64

  • isInt64(cborType: types): boolean
  • Allow only int CBOR types

    Parameters

    • cborType: types

      the CBOR type

    Returns boolean

    true if the type is an integer

isObjectAs

  • isObjectAs<T>(o: any): boolean
  • Cheap type guard for a specific type

    Check is a variable is an object and assume that it is of a given type

    Type parameters

    • T

      the type that is assumed if o is an object

    Parameters

    • o: any

      the object to check

    Returns boolean

    true if o is an object

isPartOf

  • Check if a BufferSlice contains the same bytes as the original Bytes

    Parameters

    • original: BytesImpl

      the original bytes

    • other: BufferSlice

      the buffer to compare to

    • start: number

      the offset of the first byte to compare in the buffer

    • length: number

      the number of bytes to compare

    Returns boolean

    true if the slice of the other buffer is equal to the bytes contained in original

isQuote

  • isQuote(c: string): boolean
  • check if the string is a quote mark

    Parameters

    • c: string

      the string to check

    Returns boolean

    true if the string is either a single ' or double " quote

isSingleEmptyRecord

  • isSingleEmptyRecord(bytes: number[] | Buffer, offset: number, length: number): boolean
  • Checks if the data contains a single empty record

    Parameters

    • bytes: number[] | Buffer

      the bytes to check

    • offset: number

      the starting position in the buffer

    • length: number

      the number of bytes to convert

    Returns boolean

    true if the data contains a single empty record

isString

  • isString(cborType: types): boolean
  • Allow only string CBOR types

    Parameters

    • cborType: types

      the CBOR type

    Returns boolean

    true if the type is a string

isStructEnd

  • isStructEnd(token: tokens): boolean
  • Utility function to check for ending tokens of arrays, maps, or strings

    Parameters

    • token: tokens

      the token to check

    Returns boolean

    true if the token ends a structure

isStructStart

  • isStructStart(token: tokens): boolean
  • Utility function to check for starting tokens of arrays, maps, or strings

    Parameters

    • token: tokens

      the token to check

    Returns boolean

    true if the token starts a structure

isSuccess

  • Check if the response code indicates a success

    Parameters

    Returns boolean

    true if the response code indicates a success

isTopicPath

  • Determine if a component group can be treated as a topic path.

    Parameters

    Returns boolean

    if the components represent a topic path selector

isTypedArray

  • isTypedArray(obj?: any): boolean
  • Check if the argument is a typed array

    Parameters

    • Optional obj: any

      the object to check

    Returns boolean

    true if the object is an instance of a typed array

isZlibBundleLoaded

  • isZlibBundleLoaded(): boolean
  • Check if the zlib library is installed

    Returns boolean

    true if the zlib module is provided

keyF

  • keyF(k: number): number
  • Parameters

    • k: number

    Returns number

keyR

  • keyR(k: number): number
  • Parameters

    • k: number

    Returns number

leadingZeros

  • leadingZeros(i: number): number
  • Calculate the number of leading zeros in the binary representation of a number using the minimal amount of bit-shifting

    Parameters

    • i: number

      the number to analyse

    Returns number

    the number of leading binary zeros

Const log

  • log(level: LogLevel | keyof LogLevel): void
  • Set the level of logging used by Diffusion. This will default to silent. Log levels are strings that represent different degrees of information to be logged. Available options are:

    • silent
    • error
    • warn
    • info
    • debug
    • trace

    Parameters

    • level: LogLevel | keyof LogLevel

      the logging level

    Returns void

    a logging function that writes verbose output

mask

  • mask(p: number, capacity: number): number
  • Apply a bitmask to a number to calculate the modulo of a power of two. This is used to determine the position in a circular buffer

    Parameters

    • p: number

      the number to mask

    • capacity: number

      the capacity, must be a power of two

    Returns number

    the reduced value

memoize

  • memoize(f: function, cache?: object, matcher?: function): c
  • Wrap a function with an automatic memoization layer.

    Parameters

    • f: function
        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    • Default value cache: object = {}

      the internal cache to use.

      • [key: string]: any
    • Default value matcher: function = identity

      the matcher function to return a cache key from an array of arguments

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

          • Rest ...args: any[]

          Returns string

    Returns c

    the memoized function

memoizeMatcher

  • memoizeMatcher(args: any): string
  • A matcher function to memoize arguments for the parseSelector function

    Parameters

    • args: any

      the arguments

    Returns string

    a JSON string of the arguments

nextF

  • nextF(v: number[], k: number): number
  • Parameters

    • v: number[]
    • k: number

    Returns number

nextR

  • nextR(v: number[], k: number): number
  • Parameters

    • v: number[]
    • k: number

    Returns number

nonNull

  • nonNull(e: Event<any> | null): boolean
  • Check is a value is not null or undefined

    Parameters

    • e: Event<any> | null

      the value to check

    Returns boolean

    true if the value is truthy

normal

  • normal(c: string): boolean
  • Validate characters in a normal parsing mode

    Parameters

    • c: string

      the character to check

    Returns boolean

    true if the character is a normal path character

normalise

  • normalise(field: FieldImpl, value: string): string
  • Returns a validated value in the format indicated by the field

    Parameters

    • field: FieldImpl

      the field providing the type information

    • value: string

      the value to convert

    Returns string

    a string representation of the value

ofSize

  • ofSize<T>(size: number, initialValue?: T): T[]
  • Create an array of a given size, optionally pre-filled with a specified initial value.

    Type parameters

    • T

    Parameters

    • size: number

      the size of the array to create

    • Optional initialValue: T

      if specified, the initial will be assigned to each element

    Returns T[]

parse

  • parse(bytes: Buffer, offset?: number, length?: number): RecordData[]
  • Parse a buffer of Record V2 data and split it into records and fields

    Parameters

    • bytes: Buffer

      the buffer to parse

    • Default value offset: number = 0

      the starting position in the buffer

    • Default value length: number = bytes.length

      the number of bytes to convert

    Returns RecordData[]

    an array of records, each containing an array of fields

parseClientTopicMessage

  • Helper function to create a client topic message

    Parameters

    Returns void

parseSelector

  • Parse a selector expression into a specific TopicSelector implementation.

    Parameters

    Returns AbstractTopicSelector

    a new topic selector

parseServiceMessage

  • Helper function to create a service message

    Parameters

    Returns Message

    the newly constructed message

parseSessionId

  • parseSessionId(str: string): SessionId | false
  • Returns a session ID if parseable, else false.

    Parameters

    • str: string

      the string containing the session ID

    Returns SessionId | false

    the session ID or false

permissionsToString

  • permissionsToString(permissions: string[]): string
  • Convert an array of permissions to a single formatted string

    Parameters

    • permissions: string[]

      an array of permissions

    Returns string

    a string containing the concatenated permissions, surrounded by brackets

processEnd

  • processEnd(bytes: Buffer, records: RecordData[], startPos: number, endPos: number, fields: RecordData): void
  • Process the end of the record data

    Parameters

    • bytes: Buffer

      the buffer to parse

    • records: RecordData[]

      a reference to the records that will be constructed. A new record will be added to this array.

    • startPos: number

      the start position in the buffer of the last field

    • endPos: number

      the end position in the buffer of the last field

    • fields: RecordData

    Returns void

processRecordDelimiter

  • processRecordDelimiter(bytes: Buffer, records: RecordData[], startPos: number, endPos: number, fields: RecordData): void
  • Process a record delimiter

    Parameters

    • bytes: Buffer

      the buffer to parse

    • records: RecordData[]

      a reference to the records that will be constructed. A new record will be added to this array.

    • startPos: number

      the start position in the buffer of the last field

    • endPos: number

      the end position in the buffer of the last field

    • fields: RecordData

    Returns void

putInt32

  • putInt32(value: number, buffer: Buffer, high: boolean): void
  • Store a 32 bit integer in the buffer

    Parameters

    • value: number

      the 32 bit integer to store

    • buffer: Buffer

      the buffer to write into

    • high: boolean

      a flag indicating whether to store the integer in the high or the low bits of the buffer

    Returns void

putNegativeNumber

  • putNegativeNumber(value: number, buffer: Buffer): void
  • Store a negative number in the buffer

    Parameters

    • value: number

      the number to store

    • buffer: Buffer

      the buffer to write into

    Returns void

putPositiveNumber

  • putPositiveNumber(value: number, buffer: Buffer): void
  • Store a positive number in the buffer

    Parameters

    • value: number

      the number to store

    • buffer: Buffer

      the buffer to write into

    Returns void

putString

  • putString(value: string, radix: number, buffer: Buffer): void
  • Store an integer represented by a string in the buffer

    Parameters

    • value: string

      the string containing the number to store

    • radix: number

      the radix of the number representation

    • buffer: Buffer

      the buffer to write into

    Returns void

quoteAndEscape

  • quoteAndEscape(str: string): string
  • Quote any necessary characters within a string

    Parameters

    • str: string

      the string to escape

    Returns string

    a quoted and escaped string

quoted

  • quoted(): boolean
  • Validated characters within a quoted block (\Q \E)

    Returns boolean

    true

read

  • Read content from an input stream

    The enum values must all lie between 0 and 63 inclusive.

    The enum values must all lie between 0 and 63 inclusive.

    Parameters

    Returns Buffer

    a Buffer containing the content

readAuthorEncoding

  • Read the author encoding an store it in the codeToAuthor map

    Parameters

    • bis: BufferInputStream

      the input stream

    • codeToAuthor: object

      a mapping between author codes and authors

      • [code: string]: string

    Returns void

readBoolean

  • Read a boolean value

    Parameters

    Returns boolean

    the boolean that was read

readByte

  • Read a single byte from the input

    throws

    an error if no more data is available

    Parameters

    Returns number

    the next byte in the input stream

readBytes

  • Read bytes as a Buffer

    Parameters

    Returns Buffer

    the bytes that were read

readCollection

  • Read a collection of objects, using a specific reader function

    Type parameters

    • T

      the type of data in the collection

    Parameters

    Returns T[]

    an array of read values

readDictionary

  • Read a dictionary of strings and values of a given type

    Type parameters

    • T

      the type of data stored in the dictionary

    Parameters

    Returns object

    a dictionary of values

    • [key: string]: T

readEditEvent

  • Read an edit event

    Parameters

    • bis: BufferInputStream

      the input stream

    • offsets: Offsets

      the offsets of the range in the result

    • codeToAuthor: object

      a mapping between author codes and authors

      • [code: string]: string

    Returns EventImpl<any>

    the edit event that was read

readFetchTopicResult

readInt32

  • Read an encoded Int32

    throws

    an error if an int32 is malformed and cannot be read

    Parameters

    Returns number

    the Int32 that was read

readInt64

  • Read an encoded Int64

    This will return the value as a Long instance.

    throws

    an error if an int64 is malformed and cannot be read

    Parameters

    Returns Long

    the decoded Int64, represented as Long

readMap

  • readMap<K, V>(bis: BufferInputStream, keyReader: function, valueReader: function): Map<K, V>

readMetadata

  • Read event metadata

    Parameters

    • input: BufferInputStream
    • offsets: Offsets

      the offsets of the range in the result

    • codeToAuthor: object

      a mapping between author codes and authors

      • [code: string]: string

    Returns EventMetadataImpl

    the metadata that was read

readMetadataOffsets

  • Read time series offsets

    Parameters

    Returns Offsets

    the offsets of the range in the result that were read

readObject

  • readObject<T, K>(bis: BufferInputStream, keyReader: function, valueReader: function): object
  • Read a map of keys/values as an object

    Type parameters

    • T

      the type of data stored in the object

    • K: string | number

      the type of the object keys

    Parameters

    Returns object

    the read map

    • [key: string]: T

readOriginalEvent

  • Read an original event

    Parameters

    • bis: BufferInputStream

      the input stream

    • offsets: Offsets

      the offsets of the range in the result

    • codeToAuthor: object

      a mapping between author codes and authors

      • [code: string]: string

    Returns EventImpl<any>

    the original event that was read

readPoint

  • Read a Point from the stream

    Parameters

    Returns Point

    the Point that was read

readProperties

  • Read a property map from the stream

    Parameters

    Returns object

    the property map that was read

    • [key: string]: string

readRange

  • Read a Range from the stream

    Parameters

    Returns Range

    the Range that was read

readRemoteServer

  • Read a remote server from the stream

    Parameters

    Returns RemoteServer

    the RemoteServer that was read

readRemoteServerStatus

readSessionToken

readString

  • Read a UTF-8 encoded String

    Parameters

    Returns string

    the string that was read

readStringArrayMap

  • readStringArrayMap<V>(bis: BufferInputStream, valueReader: function): Map<string[], V>
  • Type parameters

    • V

    Parameters

    Returns Map<string[], V>

readTopicView

  • Read a topic view from the stream

    Parameters

    Returns TopicView

    the TopicView that was read

reconnect

  • reconnect(token: string, availableClientSequence: number, lastServerSequence: number): ReconnectionRequest
  • Create a reconnection request with provided options

    Parameters

    • token: string

      the session token

    • availableClientSequence: number

      the available client sequence number

    • lastServerSequence: number

      the last server sequence number

    Returns ReconnectionRequest

    a new reconnection request

recordCount

  • recordCount(bytes: number[] | Buffer, offset: number, length: number): number
  • Count the number of records in the raw Record V2 data

    Parameters

    • bytes: number[] | Buffer

      the bytes to check

    • offset: number

      the starting position in the buffer

    • length: number

      the number of bytes to convert

    Returns number

    the number of records in the data

recordIsSingleEmptyField

  • recordIsSingleEmptyField(bytes: number[] | Buffer, offset: number, length: number): boolean
  • Checks if the data contains a single empty field

    Parameters

    • bytes: number[] | Buffer

      the bytes to check

    • offset: number

      the starting position in the buffer

    • length: number

      the number of bytes to convert

    Returns boolean

    true if the data contains a single empty field

regex

  • regex(s: string | RegExp, context?: string): Matcher
  • Create a regex matcher function for a given regex expression, with an optional context for RegEx construction error messages.

    The returned function will evaluate the generated regex across the entire region of the given input. This is equivalent to Matcher.matches in Java.

    throws

    an error if the regex couldn't be created

    Parameters

    • s: string | RegExp

      the regular expression

    • Default value context: string = ""

      the optional context message

    Returns Matcher

    the tester function

registerHandler

  • registerHandler<Parameters>(internal: InternalSession, params: Parameters, adapter: RegistrationAdapter, reg: Services.ServiceDefinition<object, null>, dereg: Services.ServiceDefinition<Parameters, null>): Promise<void>
  • Register a handler with the conversation set.

    Type parameters

    • Parameters

    Parameters

    • internal: InternalSession

      the internal session

    • params: Parameters

      the registration parameters to send to the server

    • adapter: RegistrationAdapter

      the registration adapter

    • reg: Services.ServiceDefinition<object, null>

      the registration service that is used to register with the server

    • dereg: Services.ServiceDefinition<Parameters, null>

      the deregistration service that is used to deregister with the server

    Returns Promise<void>

registerMessageHandler

registerRequestHandler

registerTopicHandler

registrationCallback

  • Create a registration callback function

    Parameters

    • conversationSet: ConversationSet

      the conversation set

    • cid: ConversationId

      the conversation ID

    • resolve: function
        • (): void
        • Returns void

    • reject: function
        • (err: any): void
        • Parameters

          • err: any

          Returns void

    Returns function

    a new registration callback function

      • (err: any): void
      • Parameters

        • err: any

        Returns void

remove

  • remove<T>(array: T[], element: T): boolean
  • Remove an element from an array.

    Type parameters

    • T

      the type of the elements stored in the array

    Parameters

    • array: T[]
    • element: T

      the object to remove

    Returns boolean

    true if the element was present in the array

replace

  • Create a delta that contains only the new value

    Parameters

    Returns BinaryDeltaImpl

    the resulting delta

replaceWithLatest

  • replaceWithLatest(allEvents: Array<Event<any>>): (Anonymous function)
  • Get a function that replaces an Event with the latest event in the same sequence.

    Parameters

    • allEvents: Array<Event<any>>

      an array of events to act as original events in the sequence

    Returns (Anonymous function)

    a function that replaces events

requireNonNegative

  • requireNonNegative(i: number | null | undefined, what: string): number
  • Require that a number is defined and is not negative

    throws

    an error if the number is not defined or negative

    Parameters

    • i: number | null | undefined

      the value to check

    • what: string

      description to include in thrown error

    Returns number

    the number

requireNonNull

  • requireNonNull<T>(value: T | null | undefined, what: string): T
  • Throw an error if the checked value is null/undefined.

    throws

    an error if value is null or undefined

    Type parameters

    • T

    Parameters

    • value: T | null | undefined

      the value to check

    • what: string

      description to include in thrown error

    Returns T

    the checked value

resolveFieldIndex

  • Get the absolute index of a field in the schema

    throws

    a error if the index is not found

    Parameters

    • field: FieldImpl

      the field to inspect

    • fields: FieldData[]

      the array of field that contains the record

    • index: number

      an index offset

    Returns any

    the absolute index of the field in the schema

resolveRecordIndex

  • Get the absolute index of a record in the schema

    throws

    a error if the index is not found

    Parameters

    • record: RecordImpl

      the record to inspect

    • records: RecordData[]

      the array of records that contains the record

    • index: number

      an index offset

    Returns any

    the absolute index of the record in the schema

responseHandler

  • Create a new response handler

    Type parameters

    • Response

    Parameters

    Returns ResponseHandler

    a new response handler

responseSuccess

  • responseSuccess<Response>(err: any, response: Response | undefined): boolean
  • Type guard for responses from a ServiceSender.

    Type parameters

    • Response

    Parameters

    • err: any

      the response error, if present

    • response: Response | undefined

      the response data

    Returns boolean

    returns true if the error is falsy. In this case, the ServiceSender should have called the response callback with a valid response.

rolesToString

  • rolesToString(roles: Set<string> | string[]): any
  • Utility method which converts a set of authorisation roles to the string format required by the $Roles session property.

    Uses comma separators and single quotes.

    since

    6.2

    Parameters

    • roles: Set<string> | string[]

      a set of strings

    Returns any

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

roundTimeStamp

  • roundTimeStamp(timestamp: number): number
  • Reduce the accuracy of a timestamp

    Parameters

    • timestamp: number

      the time stamp to round

    Returns number

    the reduced accuracy time stamp

serialise

  • serialise(value: Number | undefined | null, encoder: Encoder): void
  • Serialise an double value into a CBOR encoder

    Parameters

    • value: Number | undefined | null

      the value to serialise

    • encoder: Encoder

      the encoder

    Returns void

setF

  • setF(v: number[], k: number, i: number): void
  • Parameters

    • v: number[]
    • k: number
    • i: number

    Returns void

setR

  • setR(v: number[], k: number, i: number): void
  • Parameters

    • v: number[]
    • k: number
    • i: number

    Returns void

setToString

  • setToString(stringSet: string[]): string
  • Convert an array of strings to a single formatted string

    Parameters

    • stringSet: string[]

      an array of strings

    Returns string

    a string containing each string in quotes, concatenated and surrounded by brackets

split

  • split(path: string): string[]
  • Split a path into parts.

    This differs from String.split in two ways:

    • If the input string is empty, this function will return an empty array, not a single-element array containing an empty string.
    • The string will be split into substrings that terminate with the specified delimiter, rather than splitting immediately when a delimiter is found.

    Example:

    split("foo/bar/", "/"); // Returns ["foo", "bar"];

    Example:

    split("foo///", "//"); // Returns ["foo/"];

    Parameters

    • path: string

      the path

    Returns string[]

    the parts

stringToArray

  • stringToArray(stringValue: string): string[]
  • Converts a formatted multi value property to an array.

    Unescapes any escaped characters in the string.

    Parameters

    • stringValue: string

      the string with quoted substrings separated by whitespace or commas

    Returns string[]

    array of strings

stringToRoles

  • stringToRoles(s: string): any
  • Utility method which converts a string of the format required by the $Roles session property into a mutable set of strings.

    Unescapes any escaped characters in the string.

    since

    6.2

    Parameters

    • s: string

      the string with quoted substrings separated by whitespace or commas

    Returns any

    set of roles

stringToSet

  • stringToSet(stringValue: string): Set<string>
  • Converts a formatted multi value property to an immutable set.

    Unescapes any escaped characters in the string.

    Parameters

    • stringValue: string

      the string with quoted substrings separated by whitespace or commas

    Returns Set<string>

    set of strings

toBuffer

  • Write record data to a buffer

    Parameters

    Returns Buffer

    the buffer containing the serialised data

toJSON

  • Convert the record schema to a raw data object

    Parameters

    Returns RecordData

    a data object that can be serialised with using JSON

updateConstraints

  • Returns an update constraint factory.

    function

    diffusion#updateConstraints

    since

    6.2

    Returns UpdateConstraintFactory

    update constraint factory

validateField

  • Validate Record V2 model data of a single field against the schema field

    throws

    an error if the model data is found to be invalid

    Parameters

    • schemaRecord: RecordImpl

      the field schema to validate against

    • recordIndex: number

      the record index

    • schemaField: FieldImpl
    • index: number

      the field index

    • value: FieldData

      the field model data

    Returns void

validateModel

  • Validate Record V2 model data against a schema

    throws

    an error if the model data is found to be invalid

    Parameters

    Returns void

validateRecord

  • Validate Record V2 model data of a single record against the schema record

    throws

    an error if the model data is found to be invalid

    Parameters

    • schemaRecord: RecordImpl

      the record schema to validate against

    • recordIndex: number

      the record index

    • record: RecordData

      the individual record data

    Returns void

websocketSubTransportFactoryProvider

  • Optionally environment specific websockets.

    Returns Subtransport

workerOnConnect

  • workerOnConnect(event: MessageEvent): void
  • Handler for the shared worker's onconnect event

    Parameters

    • event: MessageEvent

      the incoming message event

    Returns void

write

  • Write content to an output stream

    If the content is a BufferSlice then only the sliced data is written. Otherwise a new Buffer is written that is created from the content's toString() representation.

    Parameters

    Returns void

writeBoolean

  • Write a boolean value

    Parameters

    • bos: BufferOutputStream

      the output stream to write to

    • value: boolean

      the boolean value to write

    Returns void

writeByte

  • Write a single signed byte

    Parameters

    • bos: ByteWriter

      the output stream to write to

    • value: number

      the byte value to write. Must be between 0 and 255

    Returns void

Const writeByteViaString

  • writeByteViaString(bos: ByteWriter, sb: string): any
  • Parameters

    Returns any

writeBytes

  • Write multiple bytes

    Parameters

    • bos: BufferOutputStream

      the output stream to write to

    • value: Buffer

      the bytes to be written

    Returns void

writeCollection

  • Write a collection of objects, using a specific writer function

    Type parameters

    • T

      the type of data in the collection

    Parameters

    Returns void

writeDictionary

  • Write a dictionary of strings and values

    Type parameters

    • T

      the type of data stored in the dictionary

    Parameters

    Returns void

writeInt32

  • Write an encoded Int32

    Parameters

    • bos: BufferOutputStream

      the output stream to write to

    • value: number

      the number to write as an int32

    Returns void

writeInt64

  • Write an encoded Int64

    Writes a number as an Int64 to the given Output stream.

    Parameters

    • bos: BufferOutputStream

      the output stream to write to

    • value: number | Long

      the number to write

    Returns void

writeLimit

  • Write a Limit to the stream

    Parameters

    Returns void

writeMap

  • writeMap<K, V>(bos: BufferOutputStream, map: Map<K, V>, keyWriter: function, valueWriter: function): void
  • Write an object of keys/values

    Type parameters

    • K

      the type of the map keys

    • V

    Parameters

    Returns void

writeObject

  • writeObject<T, K>(bos: BufferOutputStream, dict: object, keyWriter: function, valueWriter: function): void
  • Write an object of keys/values

    Type parameters

    • T

      the type of data stored in the object

    • K: string | number

      the type of the object keys

    Parameters

    Returns void

writePoint

  • Write a Point to the stream

    Parameters

    Returns void

writeRange

writeString

  • Write a string using UTF-8 encoding

    Parameters

    Returns void

writeStringArrayMap

  • writeStringArrayMap<V>(bos: BufferOutputStream, value: Map<string[], V>, valueWriter: function): void
  • Type parameters

    • V

    Parameters

    Returns void

writeToBuffer

  • Serialise a message into a buffer

    Parameters

    Returns void

writeValue

  • writeValue<V>(valueToBytes: function, event: Event<V>): Buffer
  • A converter function that converts an event to buffer data

    Type parameters

    • V

    Parameters

    • valueToBytes: function

      a converter function that converts an underlying value to bytes data

    • event: Event<V>

      the event to convert

    Returns Buffer

    the buffer containing the event

xhrSubTransportFactoryProvider

  • Optionally provide environment specific XHR.

    Returns Subtransport

Object literals

Const ACQUIRE_SESSION_LOCK

ACQUIRE_SESSION_LOCK: object

id

id: number = 114

request

request: any = SessionLockRequestSerialiser

response

response: any = SessionLockAcquisitionSerialiser

Const ADD_AND_SET_TOPIC

ADD_AND_SET_TOPIC: object

id

id: number = 122

request

request: any = AddAndSetTopicRequestSerialiser

response

response: any = AddTopicResultSerialiser

Const APPLY_JSON_PATCH

APPLY_JSON_PATCH: object

id

id: number = 151

request

request: any = ApplyJsonPatchRequestSerialiser

response

response: any = JsonPatchResultSerialiser

Const AUTHENTICATOR

AUTHENTICATOR: object

id

id: number = 120

request

request: any = AuthenticatorRequestSerialiser

response

response: any = AuthenticatorResponseSerialiser

Const AUTHENTICATOR_DEREGISTRATION

AUTHENTICATOR_DEREGISTRATION: object

id

id: number = 121

request

request: any = AuthenticatorRegistrationParametersSerialiser

response

response: any = NullSerialiser

Const AUTHENTICATOR_REGISTRATION

AUTHENTICATOR_REGISTRATION: object

id

id: number = 119

request

request: any = AuthenticatorRegistrationRequestSerialiser

response

response: any = NullSerialiser

Const CHANGE_AUTHORISATION_ROLES

CHANGE_AUTHORISATION_ROLES: object

id

id: number = 123

request

request: any = ChangeAuthorisationRolesRequestSerialiser

response

response: any = NullSerialiser

Const CHANGE_AUTHORISATION_ROLES_FILTER

CHANGE_AUTHORISATION_ROLES_FILTER: object

id

id: number = 124

request

request: any = ChangeAuthorisationRolesFilterRequestSerialiser

response

response: any = CountOrParserErrorsSerialiser

Const CHANGE_PRINCIPAL

CHANGE_PRINCIPAL: object

id

id: number = 5

request

request: any = ChangePrincipalRequestSerialiser

response

response: any = BooleanSerialiser

Const CHECK_REMOTE_SERVER

CHECK_REMOTE_SERVER: object

id

id: number = 165

request

request: any = StringSerialiser

response

response: any = CheckRemoteServerResultSerialiser

Const CHECK_UPDATE_STREAM

CHECK_UPDATE_STREAM: object

id

id: number = 127

request

request: any = UpdateStreamIdSerialiser

response

response: any = NullSerialiser

Const CLOSE_CLIENT

CLOSE_CLIENT: object

id

id: number = 14

request

request: any = CloseClientRequestSerialiser

response

response: any = NullSerialiser

Const CLOSE_CLIENT_FILTER

CLOSE_CLIENT_FILTER: object

id

id: number = 162

request

request: any = StringSerialiser

response

response: any = CountOrParserErrorsSerialiser

Const CONNECTION_ACTION

CONNECTION_ACTION: object

An enum-like object containing all possible connection actions

ABSTAIN

ABSTAIN: object

id

id: number = 2

value

value: string = "abstain"

ALLOW

ALLOW: object

id

id: number = 0

value

value: string = "allow"

DENY

DENY: object

id

id: number = 1

value

value: string = "deny"

Const CREATE_REMOTE_SERVER

CREATE_REMOTE_SERVER: object

id

id: number = 157

request

request: any = RemoteServerDefinitionSerialiser

response

response: any = CreateRemoteServerResultSerialiser

Const CREATE_TOPIC_VIEW

CREATE_TOPIC_VIEW: object

id

id: number = 138

request

request: any = NamedTopicViewSpecificationSerialiser

response

response: any = CreateTopicViewResultSerialiser

Const CREATE_UPDATE_STREAM

CREATE_UPDATE_STREAM: object

id

id: number = 125

request

request: any = CreateUpdateStreamRequestSerialiser

response

response: any = CreateUpdateStreamResponseSerialiser

Const CREATE_UPDATE_STREAM_AND_SET

CREATE_UPDATE_STREAM_AND_SET: object

id

id: number = 126

request

request: any = CreateUpdateStreamAndSetRequestSerialiser

response

response: any = CreateUpdateStreamResponseSerialiser

Const ClientControlOptions

ClientControlOptions: object

ANONYMOUS

ANONYMOUS: string = ""

Value returned by Session.getPrincipal if no principal name is associated with the session.

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'})

Dictionary containing standard session property keys

Example:

// Get the ALL_FIXED_PROPERTIES key
var props = diffusion.clients.PropertyKeys.ALL_FIXED_PROPERTIES;

Example:

// Get all user and fixed properties
var props = diffusion.clients.PropertyKeys.ALL_FIXED_PROPERTIES
     .concat(diffusion.clients.PropertyKeys.ALL_USER_PROPERTIES);

Type declaration

Const CloseReasonEnum

CloseReasonEnum: object

Enum representing the reason that the session has been closed.

Example:

diffusion.connect({...}).then(function(session) {...}, function(err) {
  switch(err) {
      case diffusion.clients.CloseReason.CLOSED_BY_CLIENT:
      // Do something
      case diffusion.clients.CloseReason.ACCESS_DENIED:
      // Do something else
      ...
  }
});

ACCESS_DENIED

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

The connection attempt failed due to a security restraint or due to invalid credentials.

CLOSED_BY_CLIENT

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

The client requested close. Not recoverable.

CLOSED_BY_SERVER

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

The session has been closed by the server, or another session using the ClientControl feature.

CONNECTION_ERROR

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

The client could not establish a connection to the server.

An error was thrown while the client was attempting to connect to the server.

CONNECTION_TIMEOUT

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

The connection attempt timed out, waiting for a response from the server.

The reconnection timeout can be controlled by the reconnect options.

HANDSHAKE_ERROR

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

There was an error parsing the handshake response.

The client received a handshake response from the server but the response was malformed and could not be deserialised.

HANDSHAKE_REJECTED

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

The connection handshake was rejected by the server.

The server responded with an unknown error code when the client attempted to connect.

IDLE_CONNECTION

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

The client detected that the connection was idle.

The client has not received a ping message from the server for an extended period of time.

LICENSE_EXCEEDED

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

The connection request was rejected because the license limit was reached.

LOST_MESSAGES

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

Loss of messages from the client has been detected. For example, whilst waiting for the arrival of missing messages in a sequence of messages a timeout has occurred.

HTTP based transports use multiple TCP connections. This can cause the messages to be received out of order. To reorder the messages those sent to the server may contain a sequence number indicating the correct order.

If a message is received out of order there is a short time for the earlier messages to be received. If the messages are not received in this time the client is closed.

Missing, invalid or duplicate sequence numbers will also close the client for this reason.

This cannot be recovered from as the client and the server are in inconsistent states.

PROTOCOL_VERSION_MISMATCH

PROTOCOL_VERSION_MISMATCH: any = new CloseReasonImpl(17, 'There was a mismatch in the protocol versions', false)

The handshake response contained an incompatible protocol version.

The server does not support the client's protocol version.

RECONNECT_ABORTED

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

Whilst disconnected, the client explicitly aborted a reconnect attempt.

TRANSPORT_ERROR

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

There was an unexpected error with the network connection.

The underlying transport (Websocket, XHR) received an error that could not be handled.

Const EncodingType

EncodingType: object

NO_ENCODING

NO_ENCODING: MessageEncoding = new MessageEncoding(0x00, 0x00)

ZLIB

ZLIB: MessageEncoding = new MessageEncoding(0x12, 0x01)

Const FETCH_JMX_VALUES

FETCH_JMX_VALUES: object

id

id: number = 149

request

request: any = JMXObjectNamesSerialiser

response

response: any = MBeanValuesSerialiser

Const FETCH_LOG_ENTRIES_SERVICE

FETCH_LOG_ENTRIES_SERVICE: object

id

id: number = 132

request

request: any = EntriesFetchRequestSerialiser

response

response: any = EntriesFetchResponseSerialiser

Const FETCH_QUERY

FETCH_QUERY: object

id

id: number = 117

request

request: any = FetchQuerySerialiser

response

response: any = FetchQueryResultSerialiser

Const FETCH_SESSION_METRIC_COLLECTORS

FETCH_SESSION_METRIC_COLLECTORS: object

id

id: number = 137

request

request: any = NullSerialiser

response

response: any = SessionMetricCollectorListSerialiser

Const FETCH_TOPIC_METRIC_COLLECTORS

FETCH_TOPIC_METRIC_COLLECTORS: object

id

id: number = 148

request

request: any = NullSerialiser

response

response: any = TopicMetricCollectorListSerialiser

Const FILTER_RESPONSE

FILTER_RESPONSE: object

id

id: number = 103

request

request: any = MessagingFilterResponseSerialiser

response

response: any = NullSerialiser

Const FILTER_SUBSCRIBE

FILTER_SUBSCRIBE: object

id

id: number = 65

request

request: any = ClientFilterSubscribeRequestSerialiser

response

response: any = ClientFilterSubscribeResponseSerialiser

Const FILTER_UNSUBSCRIBE

FILTER_UNSUBSCRIBE: object

id

id: number = 66

request

request: any = ClientFilterSubscribeRequestSerialiser

response

response: any = ClientFilterSubscribeResponseSerialiser

Const GET_MEASURED_ENTITY_CLASS_METRICS

GET_MEASURED_ENTITY_CLASS_METRICS: object

id

id: number = 145

request

request: any = StringSerialiser

response

response: any = MeasuredEntityClassMetricsSerialiser

Const GET_SECURITY_CONFIGURATION

GET_SECURITY_CONFIGURATION: object

id

id: number = 59

request

request: any = NullSerialiser

response

response: any = SecurityConfigurationSerialiser

Const GET_SERVER_METRICS

GET_SERVER_METRICS: object

id

id: number = 142

request

request: any = NullSerialiser

response

response: any = ServerMetricsSerialiser

Const GET_SESSION_PROPERTIES

GET_SESSION_PROPERTIES: object

id

id: number = 67

request

request: any = GetSessionPropertiesRequestSerialiser

response

response: any = GetSessionPropertiesResponseSerialiser

Const GET_SYSTEM_AUTHENTICATION

GET_SYSTEM_AUTHENTICATION: object

id

id: number = 57

request

request: any = NullSerialiser

response

response: any = SystemAuthenticationConfigurationSerialiser

Const LIST_GLOBAL_PERMISSIONS

LIST_GLOBAL_PERMISSIONS: object

id

id: number = 143

request

request: any = NullSerialiser

response

response: any = ListGlobalPermissionsResultSerialiser

Const LIST_PATH_PERMISSIONS

LIST_PATH_PERMISSIONS: object

id

id: number = 144

request

request: any = StringSerialiser

response

response: any = ListPathPermissionsResultSerialiser

Const LIST_REMOTE_SERVERS

LIST_REMOTE_SERVERS: object

id

id: number = 164

request

request: any = NullSerialiser

response

response: any = ListRemoteServersResultSerialiser

Const LIST_TOPIC_VIEWS

LIST_TOPIC_VIEWS: object

id

id: number = 141

request

request: any = NullSerialiser

response

response: any = ListTopicViewsResultSerialiser

Const MESSAGE_RECEIVER_CONTROL_DEREGISTRATION

MESSAGE_RECEIVER_CONTROL_DEREGISTRATION: object

id

id: number = 64

request

request: any = MessageReceiverControlRegistrationParamsSerialiser

response

response: any = NullSerialiser

Const MESSAGE_RECEIVER_CONTROL_REGISTRATION

MESSAGE_RECEIVER_CONTROL_REGISTRATION: object

id

id: number = 63

request

request: any = MessageReceiverControlRegistrationRequestSerialiser

response

response: any = NullSerialiser

Const MESSAGING_FILTER_SEND

MESSAGING_FILTER_SEND: object

id

id: number = 102

request

request: any = MessagingFilterSendRequestSerialiser

response

response: any = MessagingFilterSendResponseSerialiser

Const MESSAGING_RECEIVER_CLIENT

MESSAGING_RECEIVER_CLIENT: object

id

id: number = 88

request

request: any = MessagingClientForwardSendRequestSerialiser

response

response: any = MessagingResponseSerialiser

Const MESSAGING_RECEIVER_CONTROL_DEREGISTRATION

MESSAGING_RECEIVER_CONTROL_DEREGISTRATION: object

id

id: number = 98

request

request: any = MessageReceiverControlRegistrationParamsSerialiser

response

response: any = NullSerialiser

Const MESSAGING_RECEIVER_CONTROL_REGISTRATION

MESSAGING_RECEIVER_CONTROL_REGISTRATION: object

id

id: number = 97

request

request: any = MessageReceiverControlRegistrationRequestSerialiser

response

response: any = NullSerialiser

Const MESSAGING_RECEIVER_SERVER

MESSAGING_RECEIVER_SERVER: object

id

id: number = 86

request

request: any = MessagingClientSendRequestSerialiser

response

response: any = MessagingResponseSerialiser

Const MESSAGING_SEND

MESSAGING_SEND: object

id

id: number = 85

request

request: any = MessagingSendRequestSerialiser

response

response: any = MessagingResponseSerialiser

Const MISSING_TOPIC

MISSING_TOPIC: object

id

id: number = 50

request

request: any = MissingTopicRequestSerialiser

response

response: any = BooleanSerialiser

Const NOOP

  • NOOP(): boolean
  • Null object implementation of Session activity monitor.

    Returns boolean

onConnectionClosed

  • onConnectionClosed(): void
  • Returns void

onNewConnection

  • onNewConnection(): void
  • Returns void

onSystemPing

  • onSystemPing(): void
  • Returns void

Const NOTIFY_SUBSCRIPTION

NOTIFY_SUBSCRIPTION: object

id

id: number = 87

request

request: any = TopicSpecificationInfoSerialiser

response

response: any = NullSerialiser

Const NULL_CALLBACK

NULL_CALLBACK: object

A service callback that does nothing

fail

  • fail(): void
  • Returns void

respond

  • respond(): void
  • Returns void

Const NullSerialiser

NullSerialiser: object

read

  • read(): null
  • Returns null

write

  • write(): void
  • Returns void

Const PROTOCOL

PROTOCOL: object

Protocol constants

CAPABILITIES

CAPABILITIES: number = isZlibBundleLoaded() ? 10 : 8

A code indicating the clients capabilities

CURRENT_VERSION

CURRENT_VERSION: number = 19

The client's protocol version

PROTOCOL_BYTE

PROTOCOL_BYTE: number = 35

A byte inticating the diffusion protocol

TYPE

TYPE: string = "WB"

The protocol type

Const PUT_SESSION_METRIC_COLLECTOR

PUT_SESSION_METRIC_COLLECTOR: object

id

id: number = 135

request

request: any = SessionMetricCollectorSerialiser

response

response: any = ErrorReportListSerialiser

Const PUT_TOPIC_METRIC_COLLECTOR

PUT_TOPIC_METRIC_COLLECTOR: object

id

id: number = 146

request

request: any = TopicMetricCollectorSerialiser

response

response: any = NullSerialiser

Const QueryTypes

QueryTypes: object

Enum-like object for timeseries query types

ALL_EDITS

ALL_EDITS: QueryType = new QueryType(1, StreamStructures.EDIT_EVENT_STREAM)

A query type for all edits

LATEST_EDITS

LATEST_EDITS: QueryType = new QueryType(2, StreamStructures.EDIT_EVENT_STREAM)

A query type for the latest edits

VALUES

VALUES: QueryType = new QueryType(0, StreamStructures.VALUE_EVENT_STREAM)

A values query type

Const RANGE_QUERY

RANGE_QUERY: object

id

id: number = 84

request

request: any = RangeQueryRequestSerialiser

response

response: any = RangeQueryResultSerialiser

Const RELEASE_SESSION_LOCK

RELEASE_SESSION_LOCK: object

id

id: number = 116

request

request: any = SessionLockAcquisitionSerialiser

response

response: any = BooleanSerialiser

Const REMOVE_REMOTE_SERVER

REMOVE_REMOTE_SERVER: object

id

id: number = 158

request

request: any = StringSerialiser

response

response: any = NullSerialiser

Const REMOVE_SESSION_METRIC_COLLECTOR

REMOVE_SESSION_METRIC_COLLECTOR: object

id

id: number = 136

request

request: any = StringSerialiser

response

response: any = NullSerialiser

Const REMOVE_TOPIC_METRIC_COLLECTOR

REMOVE_TOPIC_METRIC_COLLECTOR: object

id

id: number = 147

request

request: any = StringSerialiser

response

response: any = NullSerialiser

Const REMOVE_TOPIC_VIEW

REMOVE_TOPIC_VIEW: object

id

id: number = 139

request

request: any = StringSerialiser

response

response: any = NullSerialiser

Const SESSION_PROPERTIES_EVENT_2

SESSION_PROPERTIES_EVENT_2: object

id

id: number = 82

request

request: any = SessionPropertiesEventBatchSerialiser

response

response: any = NullSerialiser

Const SESSION_PROPERTIES_REGISTRATION_2

SESSION_PROPERTIES_REGISTRATION_2: object

id

id: number = 81

request

request: any = SetSessionPropertiesListenerSerialiser

response

response: any = NullSerialiser

Const SET_CLIENT_CONFLATION

SET_CLIENT_CONFLATION: object

id

id: number = 15

request

request: any = SetClientConflationRequestSerialiser

response

response: any = NullSerialiser

Const SET_CLIENT_CONFLATION_FILTER

SET_CLIENT_CONFLATION_FILTER: object

id

id: number = 163

request

request: any = SetClientConflationFilterRequestSerialiser

response

response: any = CountOrParserErrorsSerialiser

Const SET_SESSION_PROPERTIES

SET_SESSION_PROPERTIES: object

id

id: number = 105

request

request: any = SetSessionPropertiesRequestSerialiser

response

response: any = SetSessionPropertiesResultSerialiser

Const SET_SESSION_PROPERTIES_FILTER

SET_SESSION_PROPERTIES_FILTER: object

id

id: number = 106

request

request: any = SetSessionPropertiesFilterRequestSerialiser

response

response: any = CountOrParserErrorsSerialiser

Const SET_TOPIC

SET_TOPIC: object

id

id: number = 118

request

request: any = SetTopicRequestSerialiser

response

response: any = NullSerialiser

Const STREAM_ADD_AND_SET_TOPIC_SERVICE

STREAM_ADD_AND_SET_TOPIC_SERVICE: object

id

id: number = 131

request

request: any = AddAndSetTopicRequestSerialiser

response

response: any = UpdateStreamAddTopicResponseSerialiser

Const STREAM_ADD_TOPIC_SERVICE

STREAM_ADD_TOPIC_SERVICE: object

id

id: number = 130

request

request: any = UpdateStreamAddTopicRequestSerialiser

response

response: any = UpdateStreamAddTopicResponseSerialiser

Const STREAM_APPLY_DELTA_SERVICE

STREAM_APPLY_DELTA_SERVICE: object

id

id: number = 129

request

request: any = UpdateStreamRequestSerialiser

response

response: any = NullSerialiser

Const STREAM_SET_TOPIC_SERVICE

STREAM_SET_TOPIC_SERVICE: object

id

id: number = 128

request

request: any = UpdateStreamRequestSerialiser

response

response: any = NullSerialiser

Const SUBSCRIBE

SUBSCRIBE: object

id

id: number = 3

request

request: any = TopicSelectorSerialiser

response

response: any = NullSerialiser

Const SUBSCRIBE_CLIENT

SUBSCRIBE_CLIENT: object

id

id: number = 10

request

request: any = ClientSubscribeRequestSerialiser

response

response: any = NullSerialiser

Const SYSTEM_PING

SYSTEM_PING: object

id

id: number = 55

request

request: any = NullSerialiser

response

response: any = NullSerialiser

Const SessionLockOptions

SessionLockOptions: object

SessionLockScope

SessionLockScope: SessionLockScope = SessionLockScope

Const StreamStructures

StreamStructures: object

Enum-like object for timeseries stream structures

EDIT_EVENT_STREAM

EDIT_EVENT_STREAM: StreamStructure = new StreamStructure(2, 'EDIT_EVENT_STREAM')

An edit event stream

VALUE_EVENT_STREAM

VALUE_EVENT_STREAM: StreamStructure = new StreamStructure(1, 'VALUE_EVENT_STREAM')

A value event stream

Const TIME_SERIES_APPEND

TIME_SERIES_APPEND: object

id

id: number = 99

request

request: any = TimeSeriesAppendRequestSerialiser

response

response: any = TimeSeriesEventMetadataSerialiser

Const TIME_SERIES_EDIT

TIME_SERIES_EDIT: object

id

id: number = 100

request

request: any = TimeSeriesEditRequestSerialiser

response

response: any = TimeSeriesEventMetadataSerialiser

Const TIME_SERIES_TIMESTAMP_APPEND

TIME_SERIES_TIMESTAMP_APPEND: object

id

id: number = 166

request

request: any = TimeSeriesTimestampAppendRequestSerialiser

response

response: any = TimeSeriesEventMetadataSerialiser

Const TOPIC_ADD

TOPIC_ADD: object

id

id: number = 112

request

request: any = TopicAddRequestSerialiser

response

response: any = TopicAddResponseSerialiser

Const TOPIC_CONTROL_DEREGISTRATION

TOPIC_CONTROL_DEREGISTRATION: object

id

id: number = 21

request

request: any = TopicControlRegistrationParamsSerialiser

response

response: any = NullSerialiser

Const TOPIC_CONTROL_REGISTRATION

TOPIC_CONTROL_REGISTRATION: object

id

id: number = 20

request

request: any = TopicControlRegistrationRequestSerialiser

response

response: any = NullSerialiser

Const TOPIC_DESCENDANT_EVENTS

TOPIC_DESCENDANT_EVENTS: object

id

id: number = 93

request

request: any = TopicNotificationDescendantEventSerialiser

response

response: any = NullSerialiser

Const TOPIC_NOTIFICATION_DEREGISTRATION

TOPIC_NOTIFICATION_DEREGISTRATION: object

id

id: number = 91

request

request: any = TopicNotificationDeregistrationRequestSerialiser

response

response: any = NullSerialiser

Const TOPIC_NOTIFICATION_DESELECTION

TOPIC_NOTIFICATION_DESELECTION: object

id

id: number = 95

request

request: any = TopicNotificationDeselectionSerialiser

response

response: any = NullSerialiser

Const TOPIC_NOTIFICATION_EVENTS

TOPIC_NOTIFICATION_EVENTS: object

id

id: number = 92

request

request: any = TopicNotificationEventSerialiser

response

response: any = NullSerialiser

Const TOPIC_NOTIFICATION_SELECTION

TOPIC_NOTIFICATION_SELECTION: object

id

id: number = 94

request

request: any = TopicNotificationSelectionSerialiser

response

response: any = NullSerialiser

Const TOPIC_REMOVAL

TOPIC_REMOVAL: object

id

id: number = 83

request

request: any = RemoveTopicSerialiser

response

response: any = NullSerialiser

Const TOPIC_SCOPED_WILL_DEREGISTRATION

TOPIC_SCOPED_WILL_DEREGISTRATION: object

id

id: number = 54

request

request: any = TopicWillParametersSerialiser

response

response: any = NullSerialiser

Const TOPIC_SCOPED_WILL_REGISTRATION

TOPIC_SCOPED_WILL_REGISTRATION: object

id

id: number = 53

request

request: any = TopicWillParametersSerialiser

response

response: any = WillRegistrationResultSerialiser

Const TopicAddFailReasonEnum

TopicAddFailReasonEnum: object

The reason that a topic could not be added.

Example:

session.topics.add('foo').then(function() { ... }, function(err) {
    switch (err) {
         case diffusion.topics.TopicAddFailReason.EXISTS:
             ...
         case diffusion.topics.TopicAddFailReason.INVALID_PATH:
             ...
    }
});

CLUSTER_REPARTITION

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

When trying to create the topic the cluster was migrating the partition that owns the topic. The correct owner could not be identified and the request failed. This is a transient failure for the duration of the partition migration.

EXCEEDED_LICENSE_LIMIT

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

Adding the topic failed because of a license limit.

EXISTS

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

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')

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.

This can be because the topic is being managed by a component with exclusive control over the topic, such as fan-out and thus the caller will not be able to update or remove the topic.

If the caller has suitable permissions then it could still subscribe to the topic, but the topic's specification may be different from that requested.

EXISTS_MISMATCH

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

The topic already exists, with different details.

INCOMPATIBLE_PARENT

INCOMPATIBLE_PARENT: TopicAddFailReason = new TopicAddFailReason(12, 'Adding the topic failed because an incompatible topic is already bound to the parent path')

Adding the topic failed because an incompatible topic owned is already bound to the parent path.

deprecated

Since 6.5

This value is no longer used and will be removed in a future release.

INITIALISE_ERROR

INITIALISE_ERROR: TopicAddFailReason = new TopicAddFailReason(8, 'The topic could not be initialised, supplied value may be of the wrong format')

The topic could not be initialised, supplied value may be of the wrong format. Deprecation notice

This value is associated only with removed methods that allow the specification of an initial value when creating a topic. It will be removed in a future release.

deprecated

Since 6.1

INVALID_DETAILS

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

The topic details are invalid.

INVALID_NAME

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

The supplied topic path is invalid.

INVALID_PATH

INVALID_PATH: TopicAddFailReason = new TopicAddFailReason(3, 'The topic path is invalid')

The topic path is invalid.

PERMISSIONS_FAILURE

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

Invalid permissions to add a topic at the specified path.

TOPIC_NOT_FOUND

TOPIC_NOT_FOUND: TopicAddFailReason = new TopicAddFailReason(6, 'A referenced topic could not be found')

A referenced topic could not be found.

UNEXPECTED_ERROR

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

An unexpected error occured while creating the topic.

USER_CODE_ERROR

USER_CODE_ERROR: TopicAddFailReason = new TopicAddFailReason(5, 'A user supplied class could not be found or instantiated')

A user supplied class could not be found or instantiated. Deprecation notice

This value is associated only with removed methods that create topics. It will be removed in a future release.

deprecated

Since 6.2

Const TopicTypeEnum

TopicTypeEnum: object

Enum containing possible Topic Types.

Example:

// Get a topic type for adding topics
var topicType = diffusion.topics.TopicType.JSON;

session.topics.add("foo", topicType);

BINARY

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

Binary Topic.

This is a stateful topic that handles data in Binary format.

since

5.7

DOUBLE

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

Topic that stores and publishes IEEE 754 double-precision floating point numbers (i.e native JavaScript Numbers). Based on the double data type.

Supports null Double values.

The topic does not support delta-streams - only complete values are transmitted.

since

6.0

INT64

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

Topic that stores and publishes 64-bit integer values. Based on the int64 data type. Values are of the type Int64.

Supports null int64 values.

Does not support delta-streams - only complete values are transmitted.

since

6.0

JSON

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

JSON (JavaScript Object Notation) Topic.

This is a stateful topic that handles data in JSON representation.

since

5.7

RECORD_V2

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

Topic that stores and publishes data in the form of records and fields. Based on the RecordV2 data type.

Supports delta-streams.

since

6.0

ROUTING

ROUTING: TopicType = new TopicType(12, false, true)

Routing Topic.

A functional topic that can point to different target topics for different clients.

From the point of view of a client subscribing to such a topic this would be seen as a normal stateful topic but it has no state of its own and cannot be published to.

Such a topic may specify a user written Java class which will be invoked to define the mapping of the topic to another data topic when a client subscribes. Alternatively the mapping can be delegated to a control client using the SubscriptionControl feature.

STRING

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

Topic that stores and publishes String values. Based on the string data type.

Supports null String values.

Supports delta-streams.

since

6.0

TIME_SERIES

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

Time Series Topic.

A time series is a sequence of events. Each event contains a value and has server-assigned metadata comprised of a sequence number, timestamp, and author.

A time series topic allows sessions to access a time series that is maintained by the server. A time series topic has an associated event data type, such as Binary, String, or JSON, that determines the type of value associated with each event.

Retained range

The TIME_SERIES_SUBSCRIPTION_RANGE property configures the range of historic events retained by a time series topic. If the property is not specified, a time series topic will retain the ten most recent events.

Subscription range

The TIME_SERIES_SUBSCRIPTION_RANGE property configures a time series topic to send a range of historic events from the end of the time series to new subscribers. This is a convenient way to synchronize new subscribers without requiring the use of a range query.

By default, new subscribers will be sent the latest event if delta streams are enabled and no events if delta streams are disabled. See the description of Subscription range in the Session.timeseries time series feature} documentation.

Mandatory properties

The TIME_SERIES_EVENT_VALUE_TYPE property must be provided when creating a time series topic.

since

6.0

see

diffusion.datatypes.TimeSeriesDataType

UNKNOWN_TOPIC_TYPE

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

A topic type that is unsupported by the session.

since

6.3

Const TopicUpdateNamespace

TopicUpdateNamespace: object

TopicCreationResult

TopicCreationResult: TopicCreationResult = TopicCreationResult

Const Types

Types: object

Enum like object of point types

ABSOLUTE_SEQUENCE

ABSOLUTE_SEQUENCE: Type = new Type(1, 'from', 'to', '')

ABSOLUTE_START

ABSOLUTE_START: Type = new Type(0, 'fromStart', 'toStart', '')

ABSOLUTE_TIME

ABSOLUTE_TIME: Type = new Type(2, 'from', 'to', ' ms')

NEXT_COUNT

NEXT_COUNT: Type = new Type(5, null, 'next', '')

NEXT_TIME

NEXT_TIME: Type = new Type(6, null, 'next', ' ms')

OFFSET_SEQUENCE

OFFSET_SEQUENCE: Type = new Type(3, 'fromLast', 'untilLast', '')

OFFSET_TIME

OFFSET_TIME: Type = new Type(4, 'fromLast', 'untilLast', ' ms')

PREVIOUS_COUNT

PREVIOUS_COUNT: Type = new Type(7, null, 'previous', '')

PREVIOUS_TIME

PREVIOUS_TIME: Type = new Type(8, null, 'previous', ' ms')

Const UNSUBSCRIBE

UNSUBSCRIBE: object

id

id: number = 4

request

request: any = TopicSelectorSerialiser

response

response: any = NullSerialiser

Const UNSUBSCRIBE_CLIENT

UNSUBSCRIBE_CLIENT: object

id

id: number = 11

request

request: any = ClientSubscribeRequestSerialiser

response

response: any = NullSerialiser

Const UNSUBSCRIPTION_NOTIFICATION

UNSUBSCRIPTION_NOTIFICATION: object

id

id: number = 42

request

request: any = UnsubscriptionNotificationSerialiser

response

response: any = NullSerialiser

Const UPDATE_LICENSE

UPDATE_LICENSE: object

id

id: number = 159

request

request: any = BytesSerialiser

response

response: any = ReplaceLicenceResponseSerialiser

Const UPDATE_SECURITY_CONFIGURATION

UPDATE_SECURITY_CONFIGURATION: object

id

id: number = 60

request

request: any = SecurityCommandScriptSerialiser

response

response: any = ErrorReportListSerialiser

Const UPDATE_SYSTEM_AUTHENTICATION

UPDATE_SYSTEM_AUTHENTICATION: object

id

id: number = 58

request

request: any = SecurityCommandScriptSerialiser

response

response: any = ErrorReportListSerialiser

Const USER_PING

USER_PING: object

id

id: number = 56

request

request: any = NullSerialiser

response

response: any = NullSerialiser

Const UnsubscribeReasonEnum

UnsubscribeReasonEnum: object

Enum containing reasons that an unsubscription occurred.

Example:

// Use UnsubscribeReason to validate unsubscription notifications
session.addStream('>foo', diffusion.datatypes.string())
       .on('unsubscribe', function(topic, specification, reason) {
    switch (reason) {
        case diffusion.topics.UnsubscribeReason.REMOVED :
            // Do something if the topic was removed
        default :
            // Do something else if the client was explicitly unsubscribed
    }
});

AUTHORIZATION

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