protected override IDictionary <ProtocolFlowType, IProtocolFlow> InitializeFlows()
        {
            var flows = new Dictionary <ProtocolFlowType, IProtocolFlow>();

            var sessionRepository  = repositoryProvider.GetRepository <ClientSession>();
            var retainedRepository = repositoryProvider.GetRepository <RetainedMessage> ();
            var senderFlow         = new PublishSenderFlow(sessionRepository, configuration);

            flows.Add(ProtocolFlowType.Connect, new ClientConnectFlow(sessionRepository, senderFlow));
            flows.Add(ProtocolFlowType.PublishSender, senderFlow);
            flows.Add(ProtocolFlowType.PublishReceiver, new PublishReceiverFlow(topicEvaluator,
                                                                                retainedRepository, sessionRepository, configuration));
            flows.Add(ProtocolFlowType.Subscribe, new ClientSubscribeFlow());
            flows.Add(ProtocolFlowType.Unsubscribe, new ClientUnsubscribeFlow());
            flows.Add(ProtocolFlowType.Ping, new PingFlow());

            return(flows);
        }
Example #2
0
        protected override IDictionary <ProtocolFlowType, IProtocolFlow> InitializeFlows()
        {
            var flows = new Dictionary <ProtocolFlowType, IProtocolFlow>();

            var sessionRepository  = repositoryProvider.GetRepository <ClientSession>();
            var willRepository     = repositoryProvider.GetRepository <ConnectionWill> ();
            var retainedRepository = repositoryProvider.GetRepository <RetainedMessage> ();
            var senderFlow         = new PublishSenderFlow(sessionRepository, configuration);

            flows.Add(ProtocolFlowType.Connect, new ServerConnectFlow(authenticationProvider, sessionRepository, willRepository, senderFlow));
            flows.Add(ProtocolFlowType.PublishSender, senderFlow);
            flows.Add(ProtocolFlowType.PublishReceiver, new ServerPublishReceiverFlow(topicEvaluator, connectionProvider,
                                                                                      senderFlow, retainedRepository, sessionRepository, willRepository, packetIdProvider, undeliveredMessagesListener, configuration));
            flows.Add(ProtocolFlowType.Subscribe, new ServerSubscribeFlow(topicEvaluator, sessionRepository,
                                                                          retainedRepository, packetIdProvider, senderFlow, configuration));
            flows.Add(ProtocolFlowType.Unsubscribe, new ServerUnsubscribeFlow(sessionRepository));
            flows.Add(ProtocolFlowType.Ping, new PingFlow());
            flows.Add(ProtocolFlowType.Disconnect, new DisconnectFlow(connectionProvider, sessionRepository, willRepository));

            return(flows);
        }