Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WampTopic

Represents WAMP publication and subscription topics for Coaty communication events (except Raw and external IoValue).

Hierarchy

  • WampTopic

Index

Accessors

correlationId

  • get correlationId(): string

eventType

  • get eventType(): CommunicationEventType

eventTypeFilter

  • get eventTypeFilter(): string

namespace

  • get namespace(): string

sourceId

  • get sourceId(): string

version

  • get version(): number

Methods

Static createByName

  • Create a new topic instance from the given WAMP publication topic.

    Parameters

    • topicName: string

      the structured name of a Coaty publication topic

    Returns WampTopic

    a Coaty communication topic instance or undefined if the topic name represents a Raw or external IO value event.

Static getTopicFilter

  • getTopicFilter(version: number, namespace: string, eventType: CommunicationEventType, eventTypeFilter: string, correlationId: Uuid): string
  • Gets a pattern-based WAMP topic filter with wildcards for subscription.

    Parameters

    • version: number

      the protocol version

    • namespace: string
    • eventType: CommunicationEventType

      the event type

    • eventTypeFilter: string

      the event filter or undefined

    • correlationId: Uuid

      correlation ID for response message, or undefined for request message

    Returns string

Static getTopicName

  • getTopicName(version: number, namespace: string, eventType: CommunicationEventType, eventTypeFilter: string, sourceId: Uuid, correlationId: Uuid): string
  • Gets the WAMP publication topic name for the given topic components.

    Parameters

    • version: number

      the protocol version

    • namespace: string
    • eventType: CommunicationEventType

      an event type

    • eventTypeFilter: string

      a filter for an event type, or undefined

    • sourceId: Uuid

      ID from which this event originates

    • correlationId: Uuid

      correlation ID for two-way message or undefined

    Returns string

Static isCoatyTopicLike

  • isCoatyTopicLike(topicName: string): boolean
  • Determines whether the given topic name starts with the same topic component as a Coaty topic.

    Parameters

    • topicName: string

      a topic name

    Returns boolean

    true if the given topic name is a potential Coaty topic; false otherwise

Static isValidTopic

  • isValidTopic(name: string, forSubscription?: boolean): boolean
  • Determines whether the given name is a valid WAMP URI topic for publication or subscription.

    remarks

    A valid topic URI must not be empty. A non-strict check on the URI is performed according to the WAMP specification: URI components (the parts between two dots, the head part up to the first dot, the tail part after the last dot) MUST NOT contain a dot, # or whitespace characters and MUST NOT be empty (zero-length strings). For subscription URIs non-empty components are allowed to support pattern-based subscriptions for wildcard matching.

    Parameters

    • name: string

      a topic URI

    • Default value forSubscription: boolean = false

      indicates whether the name is used for subscription (true) or publication (false)

    Returns boolean

    true if the given topic name can be used as requested; false otherwise

Generated using TypeDoc