MessageRouter

This class which specifies the interface to manage an connection over DeviceGateway.

Constructors

Link copied to clipboard
fun MessageRouter(transportFactory: TransportFactory, authDelegate: AuthDelegate)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun addOnSendMessageListener(listener: MessageSender.OnSendMessageListener)
Link copied to clipboard
open override fun consumeAttachment(attachment: AttachmentMessage)
Link copied to clipboard
open override fun consumeDirectives(directives: List<DirectiveMessage>)
Link copied to clipboard
open override fun getConnectionChangedReason(): ConnectionStatusListener.ChangedReason

Get the status of the connection.

Link copied to clipboard
open override fun getConnectionStatus(): ConnectionStatusListener.Status

Get the status of the connection.

Link copied to clipboard
open override fun handoffConnection(    protocol: String,     hostname: String,     address: String,     port: Int,     retryCountLimit: Int,     connectionTimeout: Int,     charge: String)

forwarding Handoff to transport

Link copied to clipboard
open override fun isStartReceiveServerInitiatedDirective(): Boolean

Return whether the connection-oriented has been started.

Link copied to clipboard
open override fun newCall(request: MessageRequest, headers: Map<String, String>?): Call

Prepares the MessageRequest to be executed at some point in the future.

Link copied to clipboard
open override fun onConnected(transport: Transport)

Notify the onConnected observer When connected.

Link copied to clipboard
open override fun onConnecting(transport: Transport, reason: ConnectionStatusListener.ChangedReason)

Notify the onConnecting observer When connecting.

Link copied to clipboard
open override fun onDisconnected(transport: Transport, reason: ConnectionStatusListener.ChangedReason)

Notify the onDisconnected observer When disconnected.

Link copied to clipboard
open override fun onPostSendMessage(request: MessageRequest, status: Status)
Link copied to clipboard
open override fun onPreSendMessage(request: MessageRequest)
Link copied to clipboard
open override fun removeOnSendMessageListener(listener: MessageSender.OnSendMessageListener)
Link copied to clipboard
open override fun resetConnection(description: String?)

Resets the connection immediately.

Link copied to clipboard
open override fun setObserver(observer: MessageRouterObserverInterface)

Set the observer to this object.

Link copied to clipboard
open override fun shutdown()

Shutdown network manager

Link copied to clipboard
open override fun startReceiveServerInitiatedDirective(onCompletion: () -> Unit?): Boolean

Start the connection-oriented feature.

Link copied to clipboard
open override fun stopReceiveServerInitiatedDirective()

Stop the connection-oriented feature.

Link copied to clipboard
open override fun toString(): String

Returns a string representation of the object.