Example #1
0
 /// <summary>
 /// Instantiates a new instance of <see cref="EventService{TAuthenticationToken}"/>.
 /// </summary>
 protected EventService(IEventStore <TAuthenticationToken> eventStore, ILogger logger, ICorrelationIdHelper correlationIdHelper, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper)
 {
     EventStore                = eventStore;
     Logger                    = logger;
     CorrelationIdHelper       = correlationIdHelper;
     AuthenticationTokenHelper = authenticationTokenHelper;
 }
Example #2
0
 /// <summary>
 /// Instantiates a new instance of <see cref="BusActor"/>.
 /// </summary>
 public BusActor(IAkkaEventPublisher <TAuthenticationToken> eventHandlerResolver, ICorrelationIdHelper correlationIdHelper, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper)
 {
     EventHandlerResolver      = eventHandlerResolver;
     CorrelationIdHelper       = correlationIdHelper;
     AuthenticationTokenHelper = authenticationTokenHelper;
     Receive <IEvent <TAuthenticationToken> >(@event => ExecuteReceive(@event));
 }
Example #3
0
 public Repository(IAggregateFactory aggregateFactory, IEventStore <TAuthenticationToken> eventStore, IEventPublisher <TAuthenticationToken> publisher, ICorrelationIdHelper correlationIdHelper)
 {
     EventStore          = eventStore;
     Publisher           = publisher;
     CorrelationIdHelper = correlationIdHelper;
     AggregateFactory    = aggregateFactory;
 }
Example #4
0
 public BusActor(IAkkaCommandSender <TAuthenticationToken> commandHandlerResolver, ICorrelationIdHelper correlationIdHelper, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper)
 {
     CommandHandlerResolver    = commandHandlerResolver;
     CorrelationIdHelper       = correlationIdHelper;
     AuthenticationTokenHelper = authenticationTokenHelper;
     Receive <ICommand <TAuthenticationToken> >(command => ExecuteReceive(command));
 }
 public AuthenticationController(ILogger logger, ICorrelationIdHelper correlationIdHelper, IConfigurationManager configurationManager, IAuthenticationTokenHelper <Guid> authenticationTokenHelper, IQueryFactory queryFactory, ICredentialRepository credentialRepository, IAuthenticationHashHelper authenticationHashHelper)
     : base(logger, correlationIdHelper, configurationManager, authenticationTokenHelper)
 {
     QueryFactory             = queryFactory;
     CredentialRepository     = credentialRepository;
     AuthenticationHashHelper = authenticationHashHelper;
 }
Example #6
0
 /// <summary>
 /// Instantiate a new instance of the <see cref="AuthenticationService"/> class.
 /// </summary>
 public AuthenticationService(IEventStore <Guid> eventStore, ILogger logger, ICorrelationIdHelper correlationIdHelper, IAuthenticationTokenHelper <Guid> authenticationTokenHelper, IQueryFactory queryFactory, ICredentialRepository credentialRepository, IAuthenticationHashHelper authenticationHashHelper, ICommandPublisher <Guid> commandPublisher)
     : base(eventStore, logger, correlationIdHelper, authenticationTokenHelper)
 {
     CredentialRepository     = credentialRepository;
     QueryFactory             = queryFactory;
     AuthenticationHashHelper = authenticationHashHelper;
     CommandPublisher         = commandPublisher;
 }
Example #7
0
 public InProcessBus(IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, IDependencyResolver dependencyResolver, ILogger logger, IConfigurationManager configurationManager)
 {
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     DependencyResolver        = dependencyResolver;
     Logger = logger;
     ConfigurationManager = configurationManager;
 }
Example #8
0
 /// <summary>
 /// Instantiates a new instance of <see cref="SagaRepository{TAuthenticationToken}"/>
 /// </summary>
 public SagaRepository(IAggregateFactory sagaFactory, IEventStore <TAuthenticationToken> eventStore, IEventPublisher <TAuthenticationToken> publisher, ICommandPublisher <TAuthenticationToken> commandPublisher, ICorrelationIdHelper correlationIdHelper)
 {
     EventStore          = eventStore;
     Publisher           = publisher;
     CorrelationIdHelper = correlationIdHelper;
     CommandPublisher    = commandPublisher;
     SagaFactory         = sagaFactory;
 }
Example #9
0
 /// <summary>
 /// Instantiate a new instance of the <see cref="ConversationService"/> class.
 /// </summary>
 public ConversationService(IEventStore <Guid> eventStore, ILogger logger, ICorrelationIdHelper correlationIdHelper, IAuthenticationTokenHelper <Guid> authenticationTokenHelper, IConversationSummaryRepository conversationSummaryRepository, IQueryFactory queryFactory, IMessageRepository messageRepository, ICommandPublisher <Guid> commandPublisher)
     : base(eventStore, logger, correlationIdHelper, authenticationTokenHelper)
 {
     ConversationSummaryRepository = conversationSummaryRepository;
     QueryFactory      = queryFactory;
     MessageRepository = messageRepository;
     CommandPublisher  = commandPublisher;
 }
Example #10
0
 /// <summary>
 /// Instantiates a new instance of the <see cref="DatabaseLogger"/> class calling the constructor on <see cref="DatabaseLogger"/>.
 /// This will attempt to create the table in the database if not yet created and <paramref name="createTable"/> is true.
 /// </summary>
 public SqlLogger(ILoggerSettings loggerSettings, ICorrelationIdHelper correlationIdHelper, bool createTable)
     : this(loggerSettings, correlationIdHelper)
 {
     if (createTable)
     {
         CreateTable();
     }
 }
Example #11
0
 /// <summary>
 /// Instantiate a new instance of the <see cref="SnapshotStore"/> class.
 /// </summary>
 protected SnapshotStore(IConfigurationManager configurationManager, ISnapshotDeserialiser eventDeserialiser, ISnapshotBuilder snapshotBuilder, ILogger logger, ICorrelationIdHelper correlationIdHelper)
 {
     ConfigurationManager = configurationManager;
     EventDeserialiser    = eventDeserialiser;
     SnapshotBuilder      = snapshotBuilder;
     Logger = logger;
     CorrelationIdHelper = correlationIdHelper;
 }
Example #12
0
 protected override void Application_BeginRequest(object sender, EventArgs e)
 {
     try
     {
         ICorrelationIdHelper correlationIdHelper = NinjectDependencyResolver.Current.Resolve <ICorrelationIdHelper>();
         correlationIdHelper.SetCorrelationId(Guid.NewGuid());
     }
     catch (NullReferenceException) { }
 }
 public AccountService(ICommandSender <Cqrs.Authentication.ISingleSignOnToken> commandSender, IUnitOfWorkService unitOfWorkService, IQueryFactory queryFactory, IAuthenticationTokenHelper <Cqrs.Authentication.ISingleSignOnToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger)
 {
     CommandSender             = commandSender;
     UnitOfWorkService         = unitOfWorkService;
     QueryFactory              = queryFactory;
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     Logger = logger;
 }
Example #14
0
 public ConversationsController(ILogger logger, ICorrelationIdHelper correlationIdHelper, IConfigurationManager configurationManager, IAuthenticationTokenHelper <Guid> authenticationTokenHelper, IQueryFactory queryFactory, IConversationSummaryRepository conversationSummaryRepository, IMessageRepository messageRepository, IAuthenticationHelper authenticationHelper, ICommandPublisher <Guid> commandPublisher)
     : base(logger, correlationIdHelper, configurationManager, authenticationTokenHelper)
 {
     QueryFactory = queryFactory;
     ConversationSummaryRepository = conversationSummaryRepository;
     MessageRepository             = messageRepository;
     AuthenticationHelper          = authenticationHelper;
     CommandPublisher = commandPublisher;
 }
Example #15
0
 protected AkkaAggregateRoot(IUnitOfWork <TAuthenticationToken> unitOfWork, ILogger logger, IAkkaAggregateRepository <TAuthenticationToken> repository, ICorrelationIdHelper correlationIdHelper, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper)
 {
     UnitOfWork                = unitOfWork;
     Logger                    = logger;
     Repository                = repository;
     CorrelationIdHelper       = correlationIdHelper;
     AuthenticationTokenHelper = authenticationTokenHelper;
     Changes                   = new ReadOnlyCollection <IEvent <TAuthenticationToken> >(new List <IEvent <TAuthenticationToken> >());
 }
Example #16
0
 protected QueuedCommandBusReceiver(IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IConfigurationManager configurationManager)
 {
     QueueTracker              = new ConcurrentDictionary <string, ConcurrentQueue <ICommand <TAuthenticationToken> > >();
     QueueTrackerLock          = new ReaderWriterLockSlim();
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     Logger = logger;
     ConfigurationManager = configurationManager;
 }
Example #17
0
 public AkkaEventBus(IBusHelper busHelper, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IEventPublisher <TAuthenticationToken> eventPublisher, IEventReceiver <TAuthenticationToken> eventReceiver)
 {
     BusHelper = busHelper;
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     Logger         = logger;
     EventPublisher = eventPublisher;
     EventReceiver  = eventReceiver;
 }
Example #18
0
 public InventoryItemService(ICommandSender <ISingleSignOnToken> commandSender, IUnitOfWorkService unitOfWorkService, IQueryFactory queryFactory, IAuthenticationTokenHelper <ISingleSignOnToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, IInventoryItemRepository inventoryItemRepository, IInventoryItemSummaryRepository inventoryItemSummaryRepository)
 {
     CommandSender                  = commandSender;
     UnitOfWorkService              = unitOfWorkService;
     QueryFactory                   = queryFactory;
     AuthenticationTokenHelper      = authenticationTokenHelper;
     CorrelationIdHelper            = correlationIdHelper;
     InventoryItemRepository        = inventoryItemRepository;
     InventoryItemSummaryRepository = inventoryItemSummaryRepository;
 }
Example #19
0
 public AzureBusHelper(IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IBusHelper busHelper, IConfigurationManager configurationManager, IDependencyResolver dependencyResolver)
 {
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     Logger               = logger;
     MessageSerialiser    = messageSerialiser;
     BusHelper            = busHelper;
     DependencyResolver   = dependencyResolver;
     ConfigurationManager = configurationManager;
 }
Example #20
0
 public InProcessBus(IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, IDependencyResolver dependencyResolver, ILogger logger, IConfigurationManager configurationManager, IBusHelper busHelper)
 {
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     DependencyResolver        = dependencyResolver;
     Logger = logger;
     ConfigurationManager = configurationManager;
     BusHelper            = busHelper;
     EventWaits           = new ConcurrentDictionary <Guid, IList <IEvent <TAuthenticationToken> > >();
 }
Example #21
0
 /// <summary>
 /// Instantiates a new instance of <see cref="AkkaSaga{TAuthenticationToken}"/>
 /// </summary>
 protected AkkaSaga(ISagaUnitOfWork <TAuthenticationToken> unitOfWork, ILogger logger, IAkkaSagaRepository <TAuthenticationToken> repository, ICorrelationIdHelper correlationIdHelper, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICommandPublisher <TAuthenticationToken> commandPublisher)
 {
     UnitOfWork                = unitOfWork;
     Logger                    = logger;
     Repository                = repository;
     CorrelationIdHelper       = correlationIdHelper;
     AuthenticationTokenHelper = authenticationTokenHelper;
     CommandPublisher          = commandPublisher;
     Changes                   = new ReadOnlyCollection <ISagaEvent <TAuthenticationToken> >(new List <ISagaEvent <TAuthenticationToken> >());
 }
Example #22
0
 public AkkaCommandBus(IHandlerResolver concurrentEventBusProxy, IBusHelper busHelper, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, IDependencyResolver dependencyResolver, ILogger logger)
 {
     ConcurrentEventBusProxy = concurrentEventBusProxy;
     Logger    = logger;
     BusHelper = busHelper;
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     DependencyResolver        = dependencyResolver;
     EventWaits = new ConcurrentDictionary <Guid, IList <IEvent <TAuthenticationToken> > >();
 }
Example #23
0
 public AkkaCommandBus(IBusHelper busHelper, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, IDependencyResolver dependencyResolver, ILogger logger, ICommandPublisher <TAuthenticationToken> commandPublisher, ICommandReceiver <TAuthenticationToken> commandReceiver)
 {
     Logger    = logger;
     BusHelper = busHelper;
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     DependencyResolver        = dependencyResolver;
     EventWaits       = new ConcurrentDictionary <Guid, IList <IEvent <TAuthenticationToken> > >();
     CommandPublisher = commandPublisher;
     CommandReceiver  = commandReceiver;
 }
 public OrderService(ICommandSender <Cqrs.Authentication.ISingleSignOnToken> commandSender, IUnitOfWorkService unitOfWorkService, IQueryFactory queryFactory, IAuthenticationTokenHelper <Cqrs.Authentication.ISingleSignOnToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, IOrderRepository orderRepository, ILogger logger, IEventStore <Cqrs.Authentication.ISingleSignOnToken> eventStore)
     : base(eventStore, logger, correlationIdHelper, authenticationTokenHelper)
 {
     CommandSender             = commandSender;
     UnitOfWorkService         = unitOfWorkService;
     QueryFactory              = queryFactory;
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     OrderRepository           = orderRepository;
     Logger = logger;
 }
Example #25
0
 public InProcessBus(IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, IDependencyResolver dependencyResolver, ILogger logger, IConfigurationManager configurationManager, IBusHelper busHelper)
 {
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     DependencyResolver        = dependencyResolver;
     Logger = logger;
     ConfigurationManager = configurationManager;
     BusHelper            = busHelper;
     EventWaits           = new ConcurrentDictionary <Guid, IList <IEvent <TAuthenticationToken> > >();
     TelemetryHelper      = configurationManager.CreateTelemetryHelper("Cqrs.InProcessBus.UseApplicationInsightTelemetryHelper", correlationIdHelper);
 }
Example #26
0
 public AkkaCommandBus(IConfigurationManager configurationManager, IBusHelper busHelper, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, IDependencyResolver dependencyResolver, ILogger logger, IActorRef actorReference, ICommandSender <TAuthenticationToken> commandSender, ICommandReceiver <TAuthenticationToken> commandReceiver)
 {
     ConfigurationManager = configurationManager;
     Logger                    = logger;
     ActorReference            = actorReference;
     CommandSender             = commandSender;
     CommandReceiver           = commandReceiver;
     AuthenticationTokenHelper = authenticationTokenHelper;
     CorrelationIdHelper       = correlationIdHelper;
     DependencyResolver        = dependencyResolver;
     BusHelper                 = busHelper;
     EventWaits                = new ConcurrentDictionary <Guid, IList <IEvent <TAuthenticationToken> > >();
 }
Example #27
0
        protected AzureBus(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, bool isAPublisher)
        {
            MessageSerialiser         = messageSerialiser;
            AuthenticationTokenHelper = authenticationTokenHelper;
            CorrelationIdHelper       = correlationIdHelper;
            Logger = logger;
            ConfigurationManager = configurationManager;
            ConnectionString     = ConfigurationManager.GetSetting(MessageBusConnectionStringConfigurationKey);

            NamespaceManager namespaceManager = NamespaceManager.CreateFromConnectionString(ConnectionString);

            if (isAPublisher)
            {
                InstantiatePublishing(namespaceManager);
            }
        }
Example #28
0
        protected AzureBus(IConfigurationManager configurationManager, IBusHelper busHelper, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, bool isAPublisher)
        {
            EventWaits = new ConcurrentDictionary <Guid, IList <IEvent <TAuthenticationToken> > >();

            MessageSerialiser         = messageSerialiser;
            AuthenticationTokenHelper = authenticationTokenHelper;
            CorrelationIdHelper       = correlationIdHelper;
            Logger               = logger;
            BusHelper            = busHelper;
            ConfigurationManager = configurationManager;
            ConnectionString     = ConfigurationManager.GetSetting(MessageBusConnectionStringConfigurationKey);

            if (isAPublisher)
            {
                InstantiatePublishing();
            }
        }
Example #29
0
        protected AzureBus(IConfigurationManager configurationManager, IMessageSerialiser <TAuthenticationToken> messageSerialiser, IAuthenticationTokenHelper <TAuthenticationToken> authenticationTokenHelper, ICorrelationIdHelper correlationIdHelper, ILogger logger, bool isAPublisher)
        {
            EventWaits = new ConcurrentDictionary <Guid, IList <IEvent <TAuthenticationToken> > >();

            MessageSerialiser         = messageSerialiser;
            AuthenticationTokenHelper = authenticationTokenHelper;
            CorrelationIdHelper       = correlationIdHelper;
            Logger = logger;
            ConfigurationManager = configurationManager;

            // ReSharper disable DoNotCallOverridableMethodsInConstructor
            UpdateSettings();
            if (isAPublisher)
            {
                InstantiatePublishing();
            }
            // ReSharper restore DoNotCallOverridableMethodsInConstructor
        }
Example #30
0
        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            try
            {
                ICorrelationIdHelper correlationIdHelper = NinjectDependencyResolver.Current.Resolve <ICorrelationIdHelper>();
                correlationIdHelper.SetCorrelationId(Guid.NewGuid());
            }
            catch (NullReferenceException) { }

            Context.Response.AddHeader("Access-Control-Allow-Origin", "*");

            if (Context.Request.HttpMethod == "OPTIONS")
            {
                //These headers are handling the "pre-flight" OPTIONS call sent by the browser
                Context.Response.AddHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE");
                Context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept");
                Context.Response.AddHeader("Access-Control-Max-Age", "1728000");
                Context.Response.End();
            }
        }