forked from dotnet/MQTTnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
179 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using MQTTnet.Exceptions; | ||
using MQTTnet.Protocol; | ||
|
||
namespace MQTTnet | ||
{ | ||
public class TopicFilterBuilder | ||
{ | ||
private MqttQualityOfServiceLevel _qualityOfServiceLevel = MqttQualityOfServiceLevel.AtMostOnce; | ||
private string _topic; | ||
|
||
public TopicFilterBuilder WithTopic(string topic) | ||
{ | ||
_topic = topic; | ||
return this; | ||
} | ||
|
||
public TopicFilterBuilder WithQualityOfServiceLevel(MqttQualityOfServiceLevel qualityOfServiceLevel) | ||
{ | ||
_qualityOfServiceLevel = qualityOfServiceLevel; | ||
return this; | ||
} | ||
|
||
public TopicFilterBuilder WithAtLeastOnceQoS() | ||
{ | ||
_qualityOfServiceLevel = MqttQualityOfServiceLevel.AtLeastOnce; | ||
return this; | ||
} | ||
|
||
public TopicFilterBuilder WithAtMostOnceQoS() | ||
{ | ||
_qualityOfServiceLevel = MqttQualityOfServiceLevel.AtMostOnce; | ||
return this; | ||
} | ||
|
||
public TopicFilterBuilder WithExactlyOnceQoS() | ||
{ | ||
_qualityOfServiceLevel = MqttQualityOfServiceLevel.ExactlyOnce; | ||
return this; | ||
} | ||
|
||
public TopicFilter Build() | ||
{ | ||
if (string.IsNullOrEmpty(_topic)) | ||
{ | ||
throw new MqttProtocolViolationException("Topic is not set."); | ||
} | ||
|
||
return new TopicFilter { Topic = _topic, QualityOfServiceLevel = _qualityOfServiceLevel }; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
Source/MQTTnet/Adapter/MqttServerAdapterClientAcceptedEventArgs.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.