Example #1
0
 public Bus(IServiceProvider serviceProvider, IEventTypeFinder eventTypeFinder, ISerializer serializer, ISnowflakeIdGenerator snowflakeIdGenerator, IEventStorage eventStorage)
 {
     ServiceProvider           = serviceProvider;
     this.eventTypeFinder      = eventTypeFinder;
     this.serializer           = serializer;
     this.snowflakeIdGenerator = snowflakeIdGenerator;
     this.eventStorage         = eventStorage;
 }
Example #2
0
 public SagaRestorer(ISnowflakeIdGenerator snowflakeIdGenerator, IServiceProvider serviceProvider, IEventSender eventSender, PoleSagasOption poleSagasOption, ISerializer serializer, IActivityFinder activityFinder)
 {
     this.snowflakeIdGenerator = snowflakeIdGenerator;
     this.serviceProvider      = serviceProvider;
     this.eventSender          = eventSender;
     this.poleSagasOption      = poleSagasOption;
     this.serializer           = serializer;
     this.activityFinder       = activityFinder;
 }
Example #3
0
 public SagaFactory(ISnowflakeIdGenerator snowflakeIdGenerator, IServiceProvider serviceProvider, IEventSender eventSender, IOptions <PoleSagasOption> poleSagasOption, ISerializer serializer, IActivityFinder activityFinder)
 {
     this.snowflakeIdGenerator = snowflakeIdGenerator;
     this.serviceProvider      = serviceProvider;
     this.eventSender          = eventSender;
     this.poleSagasOption      = poleSagasOption.Value;
     this.serializer           = serializer;
     this.activityFinder       = activityFinder;
 }
Example #4
0
 internal Saga(ISnowflakeIdGenerator snowflakeIdGenerator, IServiceProvider serviceProvider, IEventSender eventSender, PoleSagasOption poleSagasOption, ISerializer serializer, IActivityFinder activityFinder)
 {
     this.snowflakeIdGenerator = snowflakeIdGenerator;
     this.serviceProvider      = serviceProvider;
     this.eventSender          = eventSender;
     this.poleSagasOption      = poleSagasOption;
     this.serializer           = serializer;
     this.activityFinder       = activityFinder;
     Id = snowflakeIdGenerator.NextId();
 }
Example #5
0
 public GlobalConfigurationAppService(
     IGlobalConfigRepository globalConfigRepository,
     ISnowflakeIdGenerator snowflakeIdGenerator,
     IDistributedEventBus distributedEventBus
     )
 {
     _globalConfigRepository = globalConfigRepository;
     _snowflakeIdGenerator   = snowflakeIdGenerator;
     _distributedEventBus    = distributedEventBus;
 }
Example #6
0
 public GlobalConfigurationAppService(
     IRouteGroupChecker routeGroupChecker,
     ISnowflakeIdGenerator snowflakeIdGenerator,
     IGlobalConfigRepository globalConfigRepository
     )
 {
     _routeGroupChecker      = routeGroupChecker;
     _snowflakeIdGenerator   = snowflakeIdGenerator;
     _globalConfigRepository = globalConfigRepository;
 }
 public GlobalConfigurationAppService(
     IGlobalConfigRepository globalConfigRepository,
     ISnowflakeIdGenerator snowflakeIdGenerator,
     ICapPublisher eventPublisher
     )
 {
     _globalConfigRepository = globalConfigRepository;
     _snowflakeIdGenerator   = snowflakeIdGenerator;
     _eventPublisher         = eventPublisher;
 }
Example #8
0
 internal Saga(ISnowflakeIdGenerator snowflakeIdGenerator, IServiceProvider serviceProvider, IEventSender eventSender, PoleSagasOption poleSagasOption, ISerializer serializer, IActivityFinder activityFinder, string id)
 {
     this.snowflakeIdGenerator = snowflakeIdGenerator;
     this.serviceProvider      = serviceProvider;
     this.eventSender          = eventSender;
     this.poleSagasOption      = poleSagasOption;
     this.serializer           = serializer;
     this.activityFinder       = activityFinder;
     Id = id;
     this.currentExecuteOrder = -1;
 }
Example #9
0
 public MessageStore(
     IGroupRepository groupRepository,
     IMessageRepository messageRepository,
     ISnowflakeIdGenerator snowflakeIdGenerator,
     IUserChatSettingRepository userChatSettingRepository)
 {
     GroupRepository           = groupRepository;
     MessageRepository         = messageRepository;
     SnowflakeIdGenerator      = snowflakeIdGenerator;
     UserChatSettingRepository = userChatSettingRepository;
 }
        public ApiGatewayApplicationAutoMapperProfile(ISnowflakeIdGenerator snowflakeIdGenerator)
        {
            //Configure your AutoMapper mapping configuration here...

            CreateMap <CacheOptions, CacheOptionsDto>();

            CreateMap <QoSOptions, QosOptionsDto>();

            CreateMap <LoadBalancerOptions, LoadBalancerOptionsDto>();

            CreateMap <RateLimitOptions, RateLimitOptionsDto>();

            CreateMap <RateLimitRule, RateLimitRuleDto>()
            .ForMember(dto => dto.ClientWhitelist, map => map.MapFrom(m => m.ClientWhitelist.Split(',').ToList()));

            CreateMap <AuthenticationOptions, AuthenticationOptionsDto>()
            .ForMember(dto => dto.AllowedScopes, map => map.MapFrom(m => !string.IsNullOrWhiteSpace(m.AllowedScopes)
                ? m.AllowedScopes.Split(',').ToList() : new List <string>()));

            CreateMap <HttpHandlerOptions, HttpHandlerOptionsDto>();

            CreateMap <HostAndPort, HostAndPortDto>();

            CreateMap <SecurityOptions, SecurityOptionsDto>()
            .ForMember(dto => dto.IPAllowedList, map => map.MapFrom(m => m.IPAllowedList.Split(',').ToList()))
            .ForMember(dto => dto.IPBlockedList, map => map.MapFrom(m => m.IPBlockedList.Split(',').ToList()));

            CreateMap <AggregateReRouteConfig, AggregateReRouteConfigDto>();

            CreateMap <AggregateReRoute, AggregateReRouteDto>()
            .ForMember(dto => dto.ReRouteKeys, map => map.MapFrom(m => m.ReRouteKeys.Split(',').ToList()));

            CreateMap <GlobalConfiguration, GlobalConfigurationDto>();

            CreateMap <DynamicReRoute, DynamicReRouteDto>();

            CreateMap <ReRoute, ReRouteDto>();

            CreateMap <ReRouteDto, ReRoute>()
            .ForCtorParam("rerouteId", x => x.MapFrom(m => snowflakeIdGenerator.NextId()))
            .ForCtorParam("routeName", x => x.MapFrom(m => m.ReRouteName))
            .ForCtorParam("downPath", x => x.MapFrom(m => m.DownstreamPathTemplate))
            .ForCtorParam("upPath", x => x.MapFrom(m => m.UpstreamPathTemplate))
            .ForCtorParam("upMethod", x => x.MapFrom(m => m.UpstreamHttpMethod))
            .ForCtorParam("downHost", x => x.MapFrom(m => m.DownstreamHostAndPorts))
            .ForMember(map => map.QoSOptions, dto => dto.Ignore())
            .ForMember(map => map.CacheOptions, dto => dto.Ignore())
            .ForMember(map => map.LoadBalancerOptions, dto => dto.Ignore())
            .ForMember(map => map.RateLimitOptions, dto => dto.Ignore())
            .ForMember(map => map.AuthenticationOptions, dto => dto.Ignore())
            .ForMember(map => map.HttpHandlerOptions, dto => dto.Ignore())
            .ForMember(map => map.SecurityOptions, dto => dto.Ignore());
        }
Example #11
0
 public BacketController(IClusterClient clusterClient, ILogger <BacketController> logger, IProducerInfoContainer producerContainer,
                         IEventTypeFinder eventTypeFinder, ISerializer serializer, ISnowflakeIdGenerator snowflakeIdGenerator, IEventBuffer eventBuffer, IServiceProvider serviceProvider)
 {
     this.clusterClient        = clusterClient;
     this.logger               = logger;
     this.producerContainer    = producerContainer;
     this.eventTypeFinder      = eventTypeFinder;
     this.serializer           = serializer;
     this.snowflakeIdGenerator = snowflakeIdGenerator;
     this.eventBuffer          = eventBuffer;
     this.serviceProvider      = serviceProvider;
 }
 public MessageStore(
     IFriendStore friendStore,
     IObjectMapper objectMapper,
     ICurrentTenant currentTenant,
     IUnitOfWorkManager unitOfWorkManager,
     IGroupRepository groupRepository,
     IMessageRepository messageRepository,
     ISnowflakeIdGenerator snowflakeIdGenerator,
     IUserChatSettingRepository userChatSettingRepository)
 {
     _friendStore               = friendStore;
     _objectMapper              = objectMapper;
     _currentTenant             = currentTenant;
     _unitOfWorkManager         = unitOfWorkManager;
     _groupRepository           = groupRepository;
     _messageRepository         = messageRepository;
     _snowflakeIdGenerator      = snowflakeIdGenerator;
     _userChatSettingRepository = userChatSettingRepository;
 }
Example #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NotificationEventHandler"/> class.
        /// </summary>
        public NotificationEventHandler(
            IJsonSerializer jsonSerializer,
            IBackgroundJobManager backgroundJobManager,
            IOptions <AbpNotificationOptions> options,
            INotificationStore notificationStore,
            ISnowflakeIdGenerator snowflakeIdGenerator,
            INotificationDefinitionManager notificationDefinitionManager,
            INotificationSubscriptionManager notificationSubscriptionManager,
            INotificationPublishProviderManager notificationPublishProviderManager)
        {
            Options                            = options.Value;
            JsonSerializer                     = jsonSerializer;
            BackgroundJobManager               = backgroundJobManager;
            NotificationStore                  = notificationStore;
            SnowflakeIdGenerator               = snowflakeIdGenerator;
            NotificationDefinitionManager      = notificationDefinitionManager;
            NotificationSubscriptionManager    = notificationSubscriptionManager;
            NotificationPublishProviderManager = notificationPublishProviderManager;

            Logger = NullLogger <NotificationEventHandler> .Instance;
        }
 public NotificationStore(
     IClock clock,
     IObjectMapper objectMapper,
     ICurrentTenant currentTenant,
     IJsonSerializer jsonSerializer,
     IUnitOfWorkManager unitOfWorkManager,
     ISnowflakeIdGenerator snowflakeIdGenerator,
     INotificationRepository notificationRepository,
     IUserSubscribeRepository userSubscribeRepository,
     IUserNotificationRepository userNotificationRepository
     )
 {
     _clock                      = clock;
     _objectMapper               = objectMapper;
     _currentTenant              = currentTenant;
     _jsonSerializer             = jsonSerializer;
     _unitOfWorkManager          = unitOfWorkManager;
     _snowflakeIdGenerator       = snowflakeIdGenerator;
     _notificationRepository     = notificationRepository;
     _userSubscribeRepository    = userSubscribeRepository;
     _userNotificationRepository = userNotificationRepository;
 }
Example #15
0
        public ApiGatewayApplicationAutoMapperProfile(ISnowflakeIdGenerator snowflakeIdGenerator)
        {
            //Configure your AutoMapper mapping configuration here...

            CreateMap <CacheOptions, CacheOptionsDto>();

            CreateMap <QoSOptions, QosOptionsDto>();

            CreateMap <LoadBalancerOptions, LoadBalancerOptionsDto>();

            CreateMap <RateLimitOptions, RateLimitOptionsDto>();

            CreateMap <ServiceDiscoveryProvider, ServiceDiscoveryProviderDto>();

            CreateMap <RateLimitRule, RateLimitRuleDto>()
            .ForMember(dto => dto.ClientWhitelist, map => map.MapFrom((m, n) =>
            {
                if (!m.ClientWhitelist.IsNullOrWhiteSpace())
                {
                    return(m.ClientWhitelist.Split(',').ToList());
                }
                return(new List <string>());
            }));

            CreateMap <AuthenticationOptions, AuthenticationOptionsDto>()
            .ForMember(dto => dto.AllowedScopes, map => map.MapFrom(m => !string.IsNullOrWhiteSpace(m.AllowedScopes)
                ? m.AllowedScopes.Split(',').ToList()
                : new List <string>()));

            CreateMap <HttpHandlerOptions, HttpHandlerOptionsDto>();

            CreateMap <HostAndPort, HostAndPortDto>();

            CreateMap <SecurityOptions, SecurityOptionsDto>()
            .ForMember(dto => dto.IPAllowedList, map => map.MapFrom((m, n) =>
            {
                if (!m.IPAllowedList.IsNullOrWhiteSpace())
                {
                    return(m.IPAllowedList.Split(',').ToList());
                }
                return(new List <string>());
            }))
            .ForMember(dto => dto.IPBlockedList, map => map.MapFrom((m, n) =>
            {
                if (!m.IPBlockedList.IsNullOrWhiteSpace())
                {
                    return(m.IPBlockedList.Split(',').ToList());
                }
                return(new List <string>());
            }));

            CreateMap <AggregateReRouteConfig, AggregateReRouteConfigDto>();

            CreateMap <AggregateReRoute, AggregateReRouteDto>()
            .ForMember(dto => dto.ReRouteKeys, map => map.MapFrom(m => MapperList(m.ReRouteKeys)))
            .ForMember(dto => dto.UpstreamHttpMethod, map => map.MapFrom(m => MapperList(m.UpstreamHttpMethod)));

            CreateMap <AggregateReRouteCreateDto, AggregateReRoute>()
            .ForCtorParam("name", x => x.MapFrom(m => m.Name))
            .ForCtorParam("routeId", x => x.MapFrom(m => snowflakeIdGenerator.NextId()))
            .ForCtorParam("aggregator", x => x.MapFrom(m => m.Aggregator))
            .ForCtorParam("appId", x => x.MapFrom(m => m.AppId))
            .ForMember(src => src.ExtraProperties, x => x.Ignore())
            .ForMember(src => src.ReRouteKeys, x => x.Ignore())
            .ForMember(src => src.ReRouteKeysConfig, x => x.Ignore())
            .ForMember(src => src.UpstreamHttpMethod, x => x.Ignore());

            CreateMap <GlobalConfiguration, GlobalConfigurationDto>();

            CreateMap <DynamicReRoute, DynamicReRouteDto>();

            CreateMap <ReRoute, ReRouteDto>()
            .ForMember(frr => frr.AddClaimsToRequest, map => map.MapFrom(m => MapperDictionary(m.AddClaimsToRequest)))
            .ForMember(frr => frr.AddHeadersToRequest, map => map.MapFrom(m => MapperDictionary(m.AddHeadersToRequest)))
            .ForMember(frr => frr.AddQueriesToRequest, map => map.MapFrom(m => MapperDictionary(m.AddQueriesToRequest)))
            .ForMember(frr => frr.DelegatingHandlers, map => map.MapFrom(m => MapperList(m.DelegatingHandlers)))
            .ForMember(frr => frr.DownstreamHeaderTransform, map => map.MapFrom(m => MapperDictionary(m.DownstreamHeaderTransform)))
            .ForMember(frr => frr.RouteClaimsRequirement, map => map.MapFrom(m => MapperDictionary(m.RouteClaimsRequirement)))
            .ForMember(frr => frr.UpstreamHeaderTransform, map => map.MapFrom(m => MapperDictionary(m.UpstreamHeaderTransform)))
            .ForMember(frr => frr.ChangeDownstreamPathTemplate, map => map.MapFrom(m => MapperDictionary(m.ChangeDownstreamPathTemplate)))
            .ForMember(frr => frr.UpstreamHttpMethod, map => map.MapFrom(m => MapperList(m.UpstreamHttpMethod)))
            .ForMember(frr => frr.DownstreamHostAndPorts, map => map.MapFrom(m => MapperHostAndPortList(m.DownstreamHostAndPorts)));

            CreateMap <ReRouteCreateDto, ReRoute>()
            .ForCtorParam("rerouteId", x => x.MapFrom(m => snowflakeIdGenerator.NextId()))
            .ForCtorParam("routeName", x => x.MapFrom(m => m.ReRouteName))
            .ForCtorParam("appId", x => x.MapFrom(m => m.AppId))
            .ForMember(s => s.DelegatingHandlers, d => d.MapFrom((dto, src) =>
            {
                src.SetDelegatingHandler(dto.DelegatingHandlers);
                return(src.DelegatingHandlers);
            }))
            .ForMember(s => s.DownstreamHeaderTransform, d => d.MapFrom((dto, src) =>
            {
                src.SetDownstreamHeader(dto.DownstreamHeaderTransform);
                return(src.DownstreamHeaderTransform);
            }))
            .ForMember(s => s.AddQueriesToRequest, d => d.MapFrom((dto, src) =>
            {
                src.SetQueriesParamter(dto.AddQueriesToRequest);
                return(src.AddQueriesToRequest);
            }))
            .ForMember(s => s.AddClaimsToRequest, d => d.MapFrom((dto, src) =>
            {
                src.SetRequestClaims(dto.AddClaimsToRequest);
                return(src.AddClaimsToRequest);
            }))
            .ForMember(s => s.AddHeadersToRequest, d => d.MapFrom((dto, src) =>
            {
                src.SetRequestHeader(dto.AddHeadersToRequest);
                return(src.AddHeadersToRequest);
            }))
            .ForMember(s => s.RouteClaimsRequirement, d => d.MapFrom((dto, src) =>
            {
                src.SetRouteClaims(dto.RouteClaimsRequirement);
                return(src.RouteClaimsRequirement);
            }))
            .ForMember(s => s.UpstreamHeaderTransform, d => d.MapFrom((dto, src) =>
            {
                src.SetUpstreamHeader(dto.UpstreamHeaderTransform);
                return(src.UpstreamHeaderTransform);
            }))
            .ForMember(s => s.ChangeDownstreamPathTemplate, d => d.MapFrom((dto, src) =>
            {
                src.SetChangeDownstreamPath(dto.ChangeDownstreamPathTemplate);
                return(src.ChangeDownstreamPathTemplate);
            }))
            .ForMember(map => map.QoSOptions, dto => dto.Ignore())
            .ForMember(map => map.CacheOptions, dto => dto.Ignore())
            .ForMember(map => map.LoadBalancerOptions, dto => dto.Ignore())
            .ForMember(map => map.RateLimitOptions, dto => dto.Ignore())
            .ForMember(map => map.AuthenticationOptions, dto => dto.Ignore())
            .ForMember(map => map.HttpHandlerOptions, dto => dto.Ignore())
            .ForMember(map => map.SecurityOptions, dto => dto.Ignore());

            CreateMap <RouteGroup, RouteGroupDto>();
        }