Exemple #1
0
 public ContractJob(ILoggerProvider loggerProvider, NotificationDbContext dbContext, IMessageTransmitter transmitter)
 {
     DBContext      = dbContext;
     Logger         = loggerProvider.CreateLogger(nameof(ContractJob));
     LoggerProvider = loggerProvider;
     Transmitter    = transmitter;
 }
Exemple #2
0
 public override void Connect(IMessageTransmitter messageTransmitter)
 {
     base.Connect(messageTransmitter,
                  ( IMessage message ) =>
     {
         this.Dispatch <ConfigurationGetRequest>(message, this.OnRequestReceived);
     });
 }
 public override void Connect(IMessageTransmitter messageTransmitter)
 {
     base.Connect(messageTransmitter,
                  ( IMessage message ) =>
     {
         this.Dispatch <ArticleInfoRequest>(message, this.OnRequestReceived);
     });
 }
Exemple #4
0
 public async Task ConnectAsync(IMessageTransmitter messageTransmitter, CancellationToken cancellationToken = default)
 {
     await Task.Run(() =>
     {
         this.Connect(messageTransmitter);
     },
                    cancellationToken);
 }
 public override void Connect(IMessageTransmitter messageTransmitter)
 {
     base.Connect(messageTransmitter,
                  ( IMessage message ) =>
     {
         this.Dispatch <ShoppingCartUpdateRequest>(message, this.OnRequestReceived);
     });
 }
Exemple #6
0
 public override void Connect(IMessageTransmitter messageTransmitter)
 {
     base.Connect(messageTransmitter,
                  ( IMessage message ) =>
     {
         this.Dispatch <StockDeliverySetRequest>(message, this.OnRequestReceived);
     });
 }
Exemple #7
0
 public override void Connect(IMessageTransmitter messageTransmitter)
 {
     base.Connect(messageTransmitter,
                  ( IMessage message ) =>
     {
         this.Dispatch <OutputMessage>(message, this.OnMessageReceived);
     });
 }
 public override void Connect(IMessageTransmitter messageTransmitter)
 {
     base.Connect(messageTransmitter,
                  ( IMessage message ) =>
     {
         this.Dispatch <TaskCancelOutputRequest>(message, this.OnRequestReceived);
     });
 }
Exemple #9
0
 public JobMailsender(ILoggerProvider loggerProvider, NotificationDbContext dbContext, IMessageTransmitter transmitter, string notificationType, string mailTemplate)
 {
     DBContext        = dbContext;
     Logger           = loggerProvider.CreateLogger(nameof(ContractJob));
     LoggerProvider   = loggerProvider;
     NotificationType = notificationType;
     MailTemplate     = mailTemplate;
     Transmitter      = transmitter;
 }
 protected override void ConnectDialogs(IMessageTransmitter messageTransmitter)
 {
     this.ArticleInfoDialog.Connect(messageTransmitter);
     this.ArticlePriceDialog.Connect(messageTransmitter);
     this.ArticleSelectedDialog.Connect(messageTransmitter);
     this.HelloDialog.Connect(messageTransmitter);
     this.KeepAliveDialog.Connect(messageTransmitter);
     this.ShoppingCartDialog.Connect(messageTransmitter);
     this.ShoppingCartUpdateDialog.Connect(messageTransmitter);
     this.UnprocessedDialog.Connect(messageTransmitter);
 }
Exemple #11
0
 public ImageManager(
     IConfigurationReader configurationReader,
     IUserIdManager userIdManager, 
     IImageCapture imageCapture, 
     IMessageTransmitter messageTransmitter,
     IOxfordClient oxfordClient)
 {
     _configurationReader = configurationReader;
     _userIdManager       = userIdManager;
     _imageCapture        = imageCapture;
     _messageTransmitter  = messageTransmitter;
     _oxfordClient        = oxfordClient;
 }
Exemple #12
0
 public ImageManager(
     IConfigurationReader configurationReader,
     IUserIdManager userIdManager,
     IImageCapture imageCapture,
     IMessageTransmitter messageTransmitter,
     IOxfordClient oxfordClient)
 {
     _configurationReader = configurationReader;
     _userIdManager       = userIdManager;
     _imageCapture        = imageCapture;
     _messageTransmitter  = messageTransmitter;
     _oxfordClient        = oxfordClient;
 }
Exemple #13
0
        public void Connect(IMessageTransmitter messageTransmitter)
        {
            lock (this.SyncRoot)
            {
                if (this.MessageTransmitter is not null)
                {
                    throw Assert.Exception(new InvalidOperationException("Dialog provider is already connected."));
                }

                this.ConnectDialogs(messageTransmitter);

                messageTransmitter.MessageProcessingError += this.OnMessageProcessingError;
                messageTransmitter.Subscribe(( IMessage message ) => {}, ( Exception ex ) => {}, () => {});
                messageTransmitter.Connect();

                this.MessageTransmitter = messageTransmitter;
            }
        }
 protected override void ConnectDialogs(IMessageTransmitter messageTransmitter)
 {
     this.ArticleInfoDialog.Connect(messageTransmitter);
     this.ArticleMasterSetDialog.Connect(messageTransmitter);
     this.HelloDialog.Connect(messageTransmitter);
     this.InitiateInputDialog.Connect(messageTransmitter);
     this.InputDialog.Connect(messageTransmitter);
     this.KeepAliveDialog.Connect(messageTransmitter);
     this.OutputDialog.Connect(messageTransmitter);
     this.OutputInfoDialog.Connect(messageTransmitter);
     this.StatusDialog.Connect(messageTransmitter);
     this.StockDeliveryInfoDialog.Connect(messageTransmitter);
     this.StockDeliverySetDialog.Connect(messageTransmitter);
     this.StockInfoDialog.Connect(messageTransmitter);
     this.StockLocationInfoDialog.Connect(messageTransmitter);
     this.TaskCancelOutputDialog.Connect(messageTransmitter);
     this.UnprocessedDialog.Connect(messageTransmitter);
 }
Exemple #15
0
        public void Start(Dictionary<string, string> config, Enkata.HostInfrastructure.Messaging.IMessageTransmitter<ActivityTrackerContracts.Messages.EventMessage> messageService)
        {
            _messageService = messageService;

            _logger.Info("Start method called");

            try
            {
                _prj = new Monroe.Project.Monroe();
                _act = new Activities(_messageService, _prj);

            }
            catch (Exception e)
            {
                string _exc = "Exception happend during creation of SHP, WorkUnit or Attributes instances: " + e.Message;
                _logger.Info(_exc);

            }
            _prj.Start();
        }
Exemple #16
0
        public async Task ConnectAsync(Stream stream, CancellationToken cancellationToken = default)
        {
            if (this.IsConnected == true)
            {
                throw Assert.Exception(new InvalidOperationException("Connection has already been made."));
            }

            IMessageTransmitter messageTransmitter = this.SerializationProvider.CreateMessageTransmitter(stream);

            try
            {
                await this.DialogProvider.ConnectAsync(messageTransmitter, cancellationToken);

                this.IsConnected = true;
            }catch
            {
                messageTransmitter.Dispose();

                throw;
            }
        }
Exemple #17
0
        public void Connect(Stream stream)
        {
            if (this.IsConnected == true)
            {
                throw Assert.Exception(new InvalidOperationException("Connection has already been made."));
            }

            IMessageTransmitter messageTransmitter = this.SerializationProvider.CreateMessageTransmitter(stream);

            try
            {
                this.DialogProvider.Connect(messageTransmitter);

                this.IsConnected = true;
            }catch
            {
                messageTransmitter.Dispose();

                throw;
            }
        }
Exemple #18
0
 public virtual void Connect(IMessageTransmitter messageTransmitter)
 {
     this.MessageTransmitter = messageTransmitter;
 }
 public DiMessageSender(IMessageTransmitter messageTransmitter)
 {
     this.messageTransmitter = messageTransmitter;
 }
Exemple #20
0
        protected virtual void Connect(IMessageTransmitter messageTransmitter, Action <IMessage> onNext)
        {
            this.MessageTransmitter = messageTransmitter;

            messageTransmitter.Subscribe(onNext);
        }
Exemple #21
0
 protected abstract void ConnectDialogs(IMessageTransmitter messageTransmitter);