Exemplo n.º 1
0
        private async Task Add(string id, string processId, string payload, string message, int order, string key)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException(nameof(id));
            }

            if (string.IsNullOrWhiteSpace(processId))
            {
                throw new ArgumentNullException(nameof(processId));
            }

            await _repository.Add(new EventAggregate
            {
                Id          = id,
                AggregateId = processId,
                Description = message,
                CreatedOn   = DateTime.UtcNow,
                Payload     = payload,
                Order       = order,
                Key         = key,
                Type        = _options.Type,
                Verbosity   = EventVerbosities.Information
            });
        }
        public async Task Handle(OpenIdErrorReceived evt)
        {
            if (evt == null)
            {
                throw new ArgumentNullException(nameof(evt));
            }

            var error = new Error
            {
                Code    = evt.Code,
                Message = evt.Message,
                State   = evt.State
            };
            var payload = JsonConvert.SerializeObject(error);
            await _repository.Add(new EventAggregate
            {
                Id          = evt.Id,
                AggregateId = evt.ProcessId,
                CreatedOn   = DateTime.UtcNow,
                Description = "An error occured",
                Payload     = payload,
                Order       = evt.Order,
                Type        = _options.Type,
                Verbosity   = EventVerbosities.Error,
                Key         = "error"
            });
        }
        public async Task Handle(RegistrationReceived message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            var payload = _serializer.GetPayload(message);
            await _repository.Add(new EventAggregate
            {
                Id          = message.Id,
                AggregateId = message.ProcessId,
                Description = "Start client registration",
                CreatedOn   = DateTime.UtcNow,
                Payload     = payload,
                Order       = message.Order
            });
        }
        public async Task Handle(RegistrationReceived message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            await _repository.Add(new EventAggregate
            {
                Id          = message.Id,
                AggregateId = message.ProcessId,
                Description = "Start client registration",
                CreatedOn   = DateTime.UtcNow,
                Payload     = message.Payload,
                Order       = message.Order,
                Type        = _options.Type,
                Verbosity   = EventVerbosities.Information,
                Key         = "register_client_started"
            });
        }
 public void Handle(GetUserInformationReceived evt)
 {
     _repository.Add(new Core.Models.EventAggregate
     {
         Id          = evt.Id,
         AggregateId = evt.ProcessId,
         Description = "Start user information",
         CreatedOn   = DateTime.UtcNow,
         Order       = evt.Order,
         Type        = evt.ServerName,
         Verbosity   = Core.Models.EventVerbosities.Information,
         Key         = "get_user_info_started",
     }).Wait();
 }
        private async Task Add(string id, string processId, string payload, string message, int order)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentNullException(nameof(id));
            }

            if (string.IsNullOrWhiteSpace(processId))
            {
                throw new ArgumentNullException(nameof(processId));
            }

            await _repository.Add(new EventAggregate
            {
                Id          = id,
                AggregateId = processId,
                Description = message,
                CreatedOn   = DateTime.UtcNow,
                Payload     = payload,
                Order       = order
            });
        }
        public async Task Handle(ScimErrorReceived message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            var jObj = new JObject();

            jObj.Add("error", message.Message);
            await _repository.Add(new EventAggregate
            {
                Id          = message.Id,
                AggregateId = message.ProcessId,
                CreatedOn   = DateTime.UtcNow,
                Description = "An error occured",
                Payload     = jObj.ToString(),
                Order       = message.Order,
                Type        = Constants.Type,
                Verbosity   = EventVerbosities.Error,
                Key         = "error"
            });
        }
Exemplo n.º 8
0
 public void Handle(AuthorizationRequestReceived evt)
 {
     _repository.Add(new Core.Models.EventAggregate
     {
         Id          = evt.Id,
         AggregateId = evt.ProcessId,
         Description = "Start authorization process",
         CreatedOn   = DateTime.UtcNow,
         Payload     = evt.Payload,
         Order       = evt.Order,
         Type        = evt.ServerName,
         Verbosity   = Core.Models.EventVerbosities.Information,
         Key         = "auth_process_started"
     }).Wait();
 }