Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MqttEndpoint

Represents an MQTT endpoint for point-to-point communication with the remote MQTT client

Hierarchy

  • MqttEndpoint

Index

Methods

accept

  • Like {@link MqttEndpoint#accept} with no session is present.

    Returns MqttEndpoint

  • Sends the CONNACK message to the remote MQTT client with "connection accepted" return code. See {@link MqttEndpoint#reject} for refusing connection

    Parameters

    • sessionPresent: boolean

    Returns MqttEndpoint

  • Sends the CONNACK message to the remote MQTT client with "connection accepted" return code. See {@link MqttEndpoint#reject} for refusing connection

    Parameters

    • sessionPresent: boolean
    • properties: any

    Returns MqttEndpoint

auth

  • Returns MqttAuth

autoKeepAlive

  • Enable/disable auto keep alive (sending ping response)

    Parameters

    • isAutoKeepAlive: boolean

    Returns MqttEndpoint

clientIdentifier

  • clientIdentifier(): string
  • Returns string

close

  • close(): void
  • Close the endpoint, so the connection with remote MQTT client

    Returns void

closeHandler

  • closeHandler(handler: ((res: void) => void) | Handler<void>): MqttEndpoint
  • Set a close handler. This will be called when the MQTT endpoint is closed

    Parameters

    • handler: ((res: void) => void) | Handler<void>

    Returns MqttEndpoint

connectProperties

  • connectProperties(): any
  • Returns any

disconnect

  • disconnect(code: MqttDisconnectReasonCode, properties: any): MqttEndpoint
  • Sends the DISCONNECT message to the remote MQTT client

    Parameters

    • code: MqttDisconnectReasonCode
    • properties: any

    Returns MqttEndpoint

disconnectHandler

  • disconnectHandler(handler: ((res: void) => void) | Handler<void>): MqttEndpoint
  • Set a disconnect handler on the MQTT endpoint. This handler is called when a DISCONNECT message is received by the remote MQTT client

    Parameters

    • handler: ((res: void) => void) | Handler<void>

    Returns MqttEndpoint

disconnectMessageHandler

  • Set a disconnect handler on the MQTT endpoint. This handler is called when a DISCONNECT message is received by the remote MQTT client

    Parameters

    Returns MqttEndpoint

exceptionHandler

  • exceptionHandler(handler: ((res: Throwable) => void) | Handler<Throwable>): MqttEndpoint
  • Set an exception handler. This will be called when an error at protocol level happens

    Parameters

    • handler: ((res: Throwable) => void) | Handler<Throwable>

    Returns MqttEndpoint

httpHeaders

  • httpHeaders(): MultiMap
  • Returns the HTTP headers sent by the client when a WebSocket transport is used otherwise null

    Returns MultiMap

httpRequestURI

  • httpRequestURI(): string
  • Returns the HTTP request URI sent by the client when a WebSocket transport is used otherwise null

    Returns string

isAutoKeepAlive

  • isAutoKeepAlive(): boolean
  • Returns boolean

isCleanSession

  • isCleanSession(): boolean
  • Returns boolean

isConnected

  • isConnected(): boolean
  • Returns boolean

isPublishAutoAck

  • isPublishAutoAck(): boolean
  • Returns boolean

isSsl

  • isSsl(): boolean
  • Returns boolean

isSubscriptionAutoAck

  • isSubscriptionAutoAck(): boolean
  • Returns boolean

keepAliveTimeSeconds

  • keepAliveTimeSeconds(): number
  • Returns number

lastMessageId

  • lastMessageId(): number
  • Returns number

localAddress

  • localAddress(): SocketAddress
  • Returns SocketAddress

pingHandler

  • pingHandler(handler: ((res: void) => void) | Handler<void>): MqttEndpoint
  • Set the pingreq handler on the MQTT endpoint. This handler is called when a PINGREQ message is received by the remote MQTT client. In any case the endpoint sends the PINGRESP internally after executing this handler.

    Parameters

    • handler: ((res: void) => void) | Handler<void>

    Returns MqttEndpoint

pong

  • Sends the PINGRESP message to the remote MQTT client

    Returns MqttEndpoint

protocolName

  • protocolName(): string
  • Returns string

protocolVersion

  • protocolVersion(): number
  • Returns number

publish

  • publish(topic: string, payload: Buffer, qosLevel: any, isDup: boolean, isRetain: boolean): PromiseLike<number>
  • publish(topic: string, payload: Buffer, qosLevel: any, isDup: boolean, isRetain: boolean, publishSentHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>): MqttEndpoint
  • publish(topic: string, payload: Buffer, qosLevel: any, isDup: boolean, isRetain: boolean, messageId: number): PromiseLike<number>
  • publish(topic: string, payload: Buffer, qosLevel: any, isDup: boolean, isRetain: boolean, messageId: number, publishSentHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>): MqttEndpoint
  • publish(topic: string, payload: Buffer, qosLevel: any, isDup: boolean, isRetain: boolean, messageId: number, properties: any): PromiseLike<number>
  • publish(topic: string, payload: Buffer, qosLevel: any, isDup: boolean, isRetain: boolean, messageId: number, properties: any, publishSentHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>): MqttEndpoint
  • Sends the PUBLISH message to the remote MQTT server

    Parameters

    • topic: string
    • payload: Buffer
    • qosLevel: any
    • isDup: boolean
    • isRetain: boolean

    Returns PromiseLike<number>

  • Sends the PUBLISH message to the remote MQTT server

    Parameters

    • topic: string
    • payload: Buffer
    • qosLevel: any
    • isDup: boolean
    • isRetain: boolean
    • publishSentHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>

    Returns MqttEndpoint

  • Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageId

    Parameters

    • topic: string
    • payload: Buffer
    • qosLevel: any
    • isDup: boolean
    • isRetain: boolean
    • messageId: number

    Returns PromiseLike<number>

  • Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageId

    Parameters

    • topic: string
    • payload: Buffer
    • qosLevel: any
    • isDup: boolean
    • isRetain: boolean
    • messageId: number
    • publishSentHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>

    Returns MqttEndpoint

  • Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageId

    Parameters

    • topic: string
    • payload: Buffer
    • qosLevel: any
    • isDup: boolean
    • isRetain: boolean
    • messageId: number
    • properties: any

    Returns PromiseLike<number>

  • Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageId

    Parameters

    • topic: string
    • payload: Buffer
    • qosLevel: any
    • isDup: boolean
    • isRetain: boolean
    • messageId: number
    • properties: any
    • publishSentHandler: ((res: AsyncResult<number>) => void) | Handler<AsyncResult<number>>

    Returns MqttEndpoint

publishAcknowledge

  • publishAcknowledge(publishMessageId: number): MqttEndpoint
  • publishAcknowledge(publishMessageId: number, reasonCode: MqttPubAckReasonCode, properties: any): MqttEndpoint
  • Sends the PUBACK message to the remote MQTT client

    Parameters

    • publishMessageId: number

    Returns MqttEndpoint

  • Parameters

    • publishMessageId: number
    • reasonCode: MqttPubAckReasonCode
    • properties: any

    Returns MqttEndpoint

publishAcknowledgeHandler

  • publishAcknowledgeHandler(handler: ((res: number) => void) | Handler<number>): MqttEndpoint
  • Set the puback handler on the MQTT endpoint. This handler is called when a PUBACK message is received by the remote MQTT client

    Parameters

    • handler: ((res: number) => void) | Handler<number>

    Returns MqttEndpoint

publishAcknowledgeMessageHandler

  • Set the puback handler on the MQTT endpoint. This handler is called when a PUBACK message is received by the remote MQTT client

    Parameters

    Returns MqttEndpoint

publishAutoAck

  • Enable/disable publishing (in/out) auto acknowledge

    Parameters

    • isPublishAutoAck: boolean

    Returns MqttEndpoint

publishComplete

  • publishComplete(publishMessageId: number): MqttEndpoint
  • publishComplete(publishMessageId: number, reasonCode: MqttPubCompReasonCode, properties: any): MqttEndpoint
  • Sends the PUBCOMP message to the remote MQTT client

    Parameters

    • publishMessageId: number

    Returns MqttEndpoint

  • Sends the PUBCOMP message to the remote MQTT client

    Parameters

    • publishMessageId: number
    • reasonCode: MqttPubCompReasonCode
    • properties: any

    Returns MqttEndpoint

publishCompletionHandler

  • publishCompletionHandler(handler: ((res: number) => void) | Handler<number>): MqttEndpoint
  • Set the pubcomp handler on the MQTT endpoint. This handler is called when a PUBCOMP message is received by the remote MQTT client

    Parameters

    • handler: ((res: number) => void) | Handler<number>

    Returns MqttEndpoint

publishCompletionMessageHandler

  • Set the pubcomp handler on the MQTT endpoint. This handler is called when a PUBCOMP message is received by the remote MQTT client

    Parameters

    Returns MqttEndpoint

publishHandler

  • Set the publish handler on the MQTT endpoint. This handler is called when a PUBLISH message is received by the remote MQTT client

    Parameters

    Returns MqttEndpoint

publishReceived

  • publishReceived(publishMessageId: number): MqttEndpoint
  • publishReceived(publishMessageId: number, reasonCode: MqttPubRecReasonCode, properties: any): MqttEndpoint
  • Sends the PUBREC message to the remote MQTT client

    Parameters

    • publishMessageId: number

    Returns MqttEndpoint

  • Sends the PUBREC message to the remote MQTT client

    Parameters

    • publishMessageId: number
    • reasonCode: MqttPubRecReasonCode
    • properties: any

    Returns MqttEndpoint

publishReceivedHandler

  • publishReceivedHandler(handler: ((res: number) => void) | Handler<number>): MqttEndpoint
  • Set the pubrec handler on the MQTT endpoint. This handler is called when a PUBREC message is received by the remote MQTT client

    Parameters

    • handler: ((res: number) => void) | Handler<number>

    Returns MqttEndpoint

publishReceivedMessageHandler

  • Set the pubrec handler on the MQTT endpoint. This handler is called when a PUBREC message is received by the remote MQTT client

    Parameters

    Returns MqttEndpoint

publishRelease

  • publishRelease(publishMessageId: number): MqttEndpoint
  • publishRelease(publishMessageId: number, reasonCode: MqttPubRelReasonCode, properties: any): MqttEndpoint
  • Sends the PUBREL message to the remote MQTT client

    Parameters

    • publishMessageId: number

    Returns MqttEndpoint

  • Sends the PUBREL message to the remote MQTT client

    Parameters

    • publishMessageId: number
    • reasonCode: MqttPubRelReasonCode
    • properties: any

    Returns MqttEndpoint

publishReleaseHandler

  • publishReleaseHandler(handler: ((res: number) => void) | Handler<number>): MqttEndpoint
  • Set the pubrel handler on the MQTT endpoint. This handler is called when a PUBREL message is received by the remote MQTT client

    Parameters

    • handler: ((res: number) => void) | Handler<number>

    Returns MqttEndpoint

publishReleaseMessageHandler

  • Set the pubrel handler on the MQTT endpoint. This handler is called when a PUBREL message is received by the remote MQTT client

    Parameters

    Returns MqttEndpoint

reject

  • Sends the CONNACK message to the remote MQTT client rejecting the connection request with specified return code. See {@link MqttEndpoint#accept} for accepting connection

    Parameters

    • returnCode: any

    Returns MqttEndpoint

  • Sends the CONNACK message to the remote MQTT client rejecting the connection request with specified return code. See {@link MqttEndpoint#accept} for accepting connection

    Parameters

    • returnCode: any
    • properties: any

    Returns MqttEndpoint

remoteAddress

  • remoteAddress(): SocketAddress
  • Returns SocketAddress

setClientIdentifier

  • setClientIdentifier(clientIdentifier: string): MqttEndpoint
  • Set client identifier if not provided by the remote MQTT client (zero-bytes)

    Parameters

    • clientIdentifier: string

    Returns MqttEndpoint

subscribeAcknowledge

  • subscribeAcknowledge(subscribeMessageId: number, grantedQoSLevels: any): MqttEndpoint
  • subscribeAcknowledge(subscribeMessageId: number, reasonCodes: MqttSubAckReasonCode, properties: any): MqttEndpoint
  • Sends the SUBACK message to the remote MQTT client

    Parameters

    • subscribeMessageId: number
    • grantedQoSLevels: any

    Returns MqttEndpoint

  • Sends the SUBACK message to the remote MQTT client

    Parameters

    • subscribeMessageId: number
    • reasonCodes: MqttSubAckReasonCode
    • properties: any

    Returns MqttEndpoint

subscribeHandler

  • Set a subscribe handler on the MQTT endpoint. This handler is called when a SUBSCRIBE message is received by the remote MQTT client

    Parameters

    Returns MqttEndpoint

subscriptionAutoAck

  • subscriptionAutoAck(isSubscriptionAutoAck: boolean): void
  • Enable/disable subscription/unsubscription requests auto acknowledge

    Parameters

    • isSubscriptionAutoAck: boolean

    Returns void

unsubscribeAcknowledge

  • unsubscribeAcknowledge(unsubscribeMessageId: number): MqttEndpoint
  • unsubscribeAcknowledge(unsubscribeMessageId: number, reasonCodes: MqttUnsubAckReasonCode, properties: any): MqttEndpoint
  • Sends the UNSUBACK message to the remote MQTT client

    Parameters

    • unsubscribeMessageId: number

    Returns MqttEndpoint

  • Sends the UNSUBACK message to the remote MQTT client

    Parameters

    • unsubscribeMessageId: number
    • reasonCodes: MqttUnsubAckReasonCode
    • properties: any

    Returns MqttEndpoint

unsubscribeHandler

  • Set a unsubscribe handler on the MQTT endpoint. This handler is called when a UNSUBSCRIBE message is received by the remote MQTT client

    Parameters

    Returns MqttEndpoint

will

  • Returns MqttWill

Generated using TypeDoc