Beispiel #1
0
        /// <summary>
        /// Creates a new instance
        /// of tranport for the
        /// specified identity
        /// </summary>
        /// <param name="identity"></param>
        /// <returns></returns>
        private ServerHttpTransport CreateTransport(HttpListenerBasicIdentity httpIdentity)
        {
            var identity            = Identity.Parse(httpIdentity.Name);
            var plainAuthentication = new PlainAuthentication();

            plainAuthentication.SetToBase64Password(httpIdentity.Password);

            var transport = new ServerHttpTransport(identity, plainAuthentication, _useHttps, _messageStorage, _notificationStorage, _expirationInactivityInterval);

            TransportCreated.RaiseEvent(this, new TransportEventArgs(transport));
            return(transport);
        }
        public async Task Handle(NewTransport newTransport, string replyTo, string correlationId)
        {
            Console.WriteLine($"[i] Got Transport Message.");
            Transport transport = new Transport();

            transport.Name     = newTransport.Name;
            transport.ApiKeyId = newTransport.ApiKeyId;
            _taskRepository.Add(transport);
            TransportCreated transportCreated = new TransportCreated();

            transportCreated.Success   = true;
            transportCreated.Transport = transport;
            _eventBus.Publish(transportCreated, replyTo, correlationId);
        }