MqttSubscriptionInterceptorContext.cs 838 B

123456789101112131415161718192021222324252627
  1. using System.Collections.Generic;
  2. namespace MQTTnet.Server
  3. {
  4. public class MqttSubscriptionInterceptorContext
  5. {
  6. public MqttSubscriptionInterceptorContext(string clientId, MqttTopicFilter topicFilter, IDictionary<object, object> sessionItems)
  7. {
  8. ClientId = clientId;
  9. TopicFilter = topicFilter;
  10. SessionItems = sessionItems;
  11. }
  12. public string ClientId { get; }
  13. public MqttTopicFilter TopicFilter { get; set; }
  14. /// <summary>
  15. /// Gets or sets a key/value collection that can be used to share data within the scope of this session.
  16. /// </summary>
  17. public IDictionary<object, object> SessionItems { get; }
  18. public bool AcceptSubscription { get; set; } = true;
  19. public bool CloseConnection { get; set; }
  20. }
  21. }