IOT Dash
Public Member Functions | Protected Member Functions | List of all members
IotDash.Services.Mqtt.MqttMediator Class Referenceabstract
Inheritance diagram for IotDash.Services.Mqtt.MqttMediator:
Inheritance graph
[legend]
Collaboration diagram for IotDash.Services.Mqtt.MqttMediator:
Collaboration graph
[legend]

Public Member Functions

abstract bool HasSubscribersOnTopic (string topic)
 
MqttApplicationMessage? GetRetained (string topic)
 
override Task Send (string channel, object sender, MqttApplicationMessage msg)
 
Task Send (string topic, object sender, string content)
 
- Public Member Functions inherited from IotDash.Domain.Mediator.AbstractMediator< string, MqttApplicationMessage >
virtual void Subscribe (TChannelKey msgChannel, ITarget< TChannelKey, TMsg > target, out ISubscription subscription)
 
virtual void Subscribe (TChannelKey msgChannel, ITarget< TChannelKey, TMsg > target, SubscriptionGuard guard)
 
abstract int TargetCountOnChannel (TChannelKey key)
 
abstract IEnumerable< ITarget< TChannelKey, TMsg > > GetChannelCopy (TChannelKey key)
 
abstract void Unsubscribe (ISubscription< TChannelKey, TMsg > subscription)
 
abstract Task Send (TChannelKey msgChannel, object sender, TMsg msg)
 

Protected Member Functions

abstract Task MqttSend (string channel, object sender, MqttApplicationMessage msg)
 
- Protected Member Functions inherited from IotDash.Domain.Mediator.AbstractMediator< string, MqttApplicationMessage >
abstract void SubscribeInternal (TChannelKey msgChannel, ITarget< TChannelKey, TMsg > target)
 

Additional Inherited Members

- Properties inherited from IotDash.Domain.Mediator.AbstractMediator< string, MqttApplicationMessage >
abstract int TargetCount [get]
 
abstract IEnumerable< TChannelKey > Keys [get]
 

Detailed Description

Specialisation of the AbstractMediator<TChannelKey, TMsg> where the channel key is of type string and the message type is MqttApplicationMessage.

Member Function Documentation

◆ GetRetained()

MqttApplicationMessage? IotDash.Services.Mqtt.MqttMediator.GetRetained ( string  topic)
inline

Return last message, null if there was no mesagge.

Parameters
topic
Returns

◆ HasSubscribersOnTopic()

abstract bool IotDash.Services.Mqtt.MqttMediator.HasSubscribersOnTopic ( string  topic)
pure virtual

Check if there are any subscribers on given topic .

Parameters
topicThe topic to check.
Returns
true if there are any subscribers.

Implemented in IotDash.Services.Mqtt.Implementation.MqttNet_Mediator, and Tests.Adapters.TestMqttMediator.

◆ MqttSend()

abstract Task IotDash.Services.Mqtt.MqttMediator.MqttSend ( string  channel,
object  sender,
MqttApplicationMessage  msg 
)
protectedpure virtual

◆ Send() [1/2]

override Task IotDash.Services.Mqtt.MqttMediator.Send ( string  channel,
object  sender,
MqttApplicationMessage  msg 
)
inline

Sends the provided application messages.

Parameters
channel
sender
msg
Returns

◆ Send() [2/2]

Task IotDash.Services.Mqtt.MqttMediator.Send ( string  topic,
object  sender,
string  content 
)
inline

Builds a new application message with default parameters and broadcasts it.

Parameters
topicMQTT topic of the message.
senderSender of the event.
contentPayload of the message.
Returns
Task which completes when the message is sent.

The documentation for this class was generated from the following file: