Beispiel #1
0
        public MowController(
            IMowControlConfig config,
            IPowerSwitch powerSwitch,
            IWeatherForecast weatherForecast,
            ISystemTime systemTime,
            IHomeSensor homeSensor,
            IMowLogger logger,
            IRainSensor rainSensor,
            bool?mowerIsHome = null)
        {
            Config          = config;
            PowerSwitch     = powerSwitch;
            WeatherForecast = weatherForecast;
            SystemTime      = systemTime;
            HomeSensor      = homeSensor;
            Logger          = logger;
            RainSensor      = rainSensor;

            if (mowerIsHome.HasValue)
            {
                _mowerIsHome = mowerIsHome.Value;
            }
            else
            {
                _mowerIsHome = HomeSensor.IsHome;
            }
        }
        internal PointToPointReceiveChannelBuilder(
            MessageReceiver messageReceiver, 
            ISerialiser serialiser, 
            AcknowledgementSender acknowledgementSender, 
            MessageHandlerRouter messageHandlerRouter,
            MessageCacheFactory messageCacheFactory, 
            ISystemTime systemTime, 
            ITaskRepeater taskRepeater, 
            ServerAddressRegistry serverAddressRegistry, 
            AuthenticationSessionCache authenticationSessionCache, 
            AuthenticatedServerRegistry authenticatedServerRegistry)
        {
            Contract.Requires(messageReceiver != null);
            Contract.Requires(serialiser != null);
            Contract.Requires(acknowledgementSender != null);
            Contract.Requires(messageHandlerRouter != null);
            Contract.Requires(messageCacheFactory != null);
            Contract.Requires(systemTime != null);
            Contract.Requires(taskRepeater != null);
            Contract.Requires(serverAddressRegistry != null);
            Contract.Requires(authenticationSessionCache != null);
            Contract.Requires(authenticatedServerRegistry != null);

            this.messageReceiver = messageReceiver;
            this.serialiser = serialiser;
            this.acknowledgementSender = acknowledgementSender;
            this.messageHandlerRouter = messageHandlerRouter;
            this.messageCacheFactory = messageCacheFactory;
            this.systemTime = systemTime;
            this.taskRepeater = taskRepeater;
            this.serverAddressRegistry = serverAddressRegistry;
            this.authenticationSessionCache = authenticationSessionCache;
            this.authenticatedServerRegistry = authenticatedServerRegistry;
        }
Beispiel #3
0
 public MetricsWorker(IMetricsScraper scraper, IMetricsStorage storage, IMetricsPublisher uploader, ISystemTime systemTime = null)
 {
     this.scraper    = Preconditions.CheckNotNull(scraper, nameof(scraper));
     this.storage    = Preconditions.CheckNotNull(storage, nameof(storage));
     this.uploader   = Preconditions.CheckNotNull(uploader, nameof(uploader));
     this.systemTime = systemTime ?? SystemTime.Instance;
 }
Beispiel #4
0
        public async Task RaiseTicketAsync_WhenTicketRequestIsCreated_ShouldBeSetUtcNowToRaisedAt()
        {
            // Arrange
            DateTime utcNow = new DateTime(2021, 01, 01);

            ISystemTime systemTimeStub = A.Fake <ISystemTime>();

            A.CallTo(() => systemTimeStub.UtcNow)
            .Returns(utcNow);

            ITicketsRepository ticketsRepositoryMock = A.Fake <ITicketsRepository>();

            TicketRequest ticketRequest = new TicketRequestBuilder().Build();

            TicketManager sut = new TicketManagerBuilder()
                                .WithISystemTime(systemTimeStub)
                                .WithITicketsRepository(ticketsRepositoryMock)
                                .Build();

            // Act
            await sut.RaiseTicketAsync(ticketRequest);

            // Assert
            A.CallTo(
                () => ticketsRepositoryMock.CreateAsync(
                    A <TicketRequest> .That.Matches(x => x.CreatedAt == utcNow))).MustHaveHappenedOnceExactly();
        }
 public CookieTicketSource(ISystemTime systemTime, IEncryptor encryptor, ILoginCookieService cookies, ILogger logger)
 {
     _systemTime = systemTime;
     _encryptor = encryptor;
     _cookies = cookies;
     _logger = logger;
 }
Beispiel #6
0
        public AvailabilityMetrics(IMetricsProvider metricsProvider, string storageFolder, ISystemTime time = null)
        {
            this.systemTime     = time ?? SystemTime.Instance;
            this.availabilities = new List <Availability>();
            this.edgeAgent      = new Lazy <Availability>(() => new Availability(Constants.EdgeAgentModuleName, this.CalculateEdgeAgentDowntime(), this.systemTime));

            Preconditions.CheckNotNull(metricsProvider, nameof(metricsProvider));
            this.running = metricsProvider.CreateGauge(
                "total_time_running_correctly_seconds",
                "The amount of time the module was specified in the deployment and was in the running state",
                new List <string> {
                "module_name"
            });

            this.expectedRunning = metricsProvider.CreateGauge(
                "total_time_expected_running_seconds",
                "The amount of time the module was specified in the deployment",
                new List <string> {
                "module_name"
            });

            string storageDirectory = Path.Combine(Preconditions.CheckNonWhiteSpace(storageFolder, nameof(storageFolder)), "availability");

            try
            {
                Directory.CreateDirectory(storageDirectory);
                this.checkpointFile       = Path.Combine(storageDirectory, "avaliability.checkpoint");
                this.updateCheckpointFile = new PeriodicTask(this.UpdateCheckpointFile, this.checkpointFrequency, this.checkpointFrequency, this.log, "Checkpoint Availability");
            }
            catch (Exception ex)
            {
                this.log.LogError(ex, "Could not create checkpoint directory");
            }
        }
        public SubscriberSendChannelBuilder(
            MessageSender messageSender, 
            MessageCacheFactory messageCacheFactory, 
            ISystemTime systemTime, 
            ITaskRepeater taskRepeater, 
            MessageAcknowledgementHandler acknowledgementHandler, 
            ISerialiser serialiser, 
            ITaskScheduler taskScheduler,
            SenderAuthenticationSessionAttacherFactory authenticationSessionAttacherFactory)
        {
            Contract.Requires(messageSender != null);
            Contract.Requires(messageCacheFactory != null);
            Contract.Requires(systemTime != null);
            Contract.Requires(taskRepeater != null);
            Contract.Requires(acknowledgementHandler != null);
            Contract.Requires(serialiser != null);
            Contract.Requires(taskScheduler != null);
            Contract.Requires(authenticationSessionAttacherFactory != null);

            this.messageSender = messageSender;
            this.messageCacheFactory = messageCacheFactory;
            this.systemTime = systemTime;
            this.taskRepeater = taskRepeater;
            this.acknowledgementHandler = acknowledgementHandler;
            this.serialiser = serialiser;
            this.taskScheduler = taskScheduler;
            this.authenticationSessionAttacherFactory = authenticationSessionAttacherFactory;
        }
Beispiel #8
0
 public PersistedLoginAuditor(ISystemTime systemTime, IDocumentSession session, ILogger logger, LoginAuditPersistor persistor)
 {
     _systemTime = systemTime;
     _session    = session;
     _logger     = logger;
     _persistor  = persistor;
 }
Beispiel #9
0
 public ContinuationContext(ILogger logger, ISystemTime systemTime, IChainInvoker invoker, IOutgoingSender outgoing)
 {
     _logger     = logger;
     _systemTime = systemTime;
     _invoker    = invoker;
     _outgoing   = outgoing;
 }
Beispiel #10
0
        public LogFileManager(IFileSystem fileSystem, ISystemTime systemTime)
        {
            _FileSystem = fileSystem ?? throw new ArgumentNullException(nameof(fileSystem));
            _SystemTime = systemTime ?? throw new ArgumentNullException(nameof(systemTime));

            ClearCache();
        }
        public ReplySendChannelBuilder(
            MessageSender messageSender,
            ISerialiser serialiser,
            ISystemTime systemTime,
            ITaskRepeater taskRepeater,
            MessageCacheFactory messageCacheFactory,
            MessageAcknowledgementHandler acknowledgementHandler,
            ITaskScheduler taskScheduler,
            ReplyAuthenticationSessionAttacherFactory authenticationSessionAttacherFactory,
            ReplyCorrelationLookup correlationLookup)
        {
            Contract.Requires(messageSender != null);
            Contract.Requires(serialiser != null);
            Contract.Requires(systemTime != null);
            Contract.Requires(taskRepeater != null);
            Contract.Requires(messageCacheFactory != null);
            Contract.Requires(acknowledgementHandler != null);
            Contract.Requires(taskScheduler != null);
            Contract.Requires(authenticationSessionAttacherFactory != null);
            Contract.Requires(correlationLookup != null);

            this.messageSender = messageSender;
            this.serialiser = serialiser;
            this.systemTime = systemTime;
            this.taskRepeater = taskRepeater;
            this.messageCacheFactory = messageCacheFactory;
            this.acknowledgementHandler = acknowledgementHandler;
            this.taskScheduler = taskScheduler;
            this.authenticationSessionAttacherFactory = authenticationSessionAttacherFactory;
            this.correlationLookup = correlationLookup;
        }
Beispiel #12
0
 public CookieValue(string cookieName, ISystemTime time, ICookies cookies, IOutputWriter writer)
 {
     _time       = time;
     _cookies    = cookies;
     _writer     = writer;
     _cookieName = cookieName;
 }
Beispiel #13
0
 public CookieValue(string cookieName, ISystemTime time, ICookies cookies, IOutputWriter writer)
 {
     _time = time;
     _cookies = cookies;
     _writer = writer;
     _cookieName = cookieName;
 }
 public TicketManagerBuilder()
 {
     this.logger            = A.Fake <ILogger>();
     this.ticketsRepository = A.Fake <ITicketsRepository>();
     this.emailService      = A.Fake <IEmailService>();
     this.systemTime        = A.Fake <ISystemTime>();
 }
 public PublisherChannelBuilder(
     IPublisherRegistry publisherRegistry, 
     ISerialiser serialiser, 
     ITaskRepeater taskRepeater,
     MessageCacheFactory messageCacheFactory, 
     ISubscriberSendChannelBuilder subscriberChannelBuilder, 
     ISystemTime systemTime, 
     ChangeStore changeStore,
     ICheckpointStrategy checkPointStrategy)
 {
     Contract.Requires(publisherRegistry != null);
     Contract.Requires(serialiser != null);
     Contract.Requires(taskRepeater != null);
     Contract.Requires(messageCacheFactory != null);
     Contract.Requires(subscriberChannelBuilder != null);
     Contract.Requires(systemTime != null);
     Contract.Requires(changeStore != null);
     Contract.Requires(checkPointStrategy != null);
     
     this.publisherRegistry = publisherRegistry;
     this.serialiser = serialiser;
     this.taskRepeater = taskRepeater;
     this.messageCacheFactory = messageCacheFactory;
     this.subscriberChannelBuilder = subscriberChannelBuilder;
     this.systemTime = systemTime;
     this.changeStore = changeStore;
     this.checkPointStrategy = checkPointStrategy;
 }
Beispiel #16
0
 public CookieTicketSource(ISystemTime systemTime, IEncryptor encryptor, ILoginCookieService cookies, ILogger logger)
 {
     _systemTime = systemTime;
     _encryptor  = encryptor;
     _cookies    = cookies;
     _logger     = logger;
 }
 public ContinuationContext(ILogger logger, ISystemTime systemTime, IChainInvoker invoker, IOutgoingSender outgoing)
 {
     _logger = logger;
     _systemTime = systemTime;
     _invoker = invoker;
     _outgoing = outgoing;
 }
Beispiel #18
0
        // Constructors
        public TaskAide(Database db, ISystemTime systemTime, ITimer timer)
        {
            this.systemTime = systemTime;
            this.timer      = timer;

            var taskTable = new TaskTable("Tasks", db);

            this.taskUidGenerator = new UidGenerator(
                ApplicationData.Current.RoamingSettings,
                "TaskUids",
                (uid) => { return(taskTable.Get(uid.ToString()) == null); });
            this.taskList = new TaskList(taskTable);

            //this.sessionTable = new SessionTable("Sessions", db);
            //this.sessionUidGenerator = new UidGenerator(
            //    ApplicationData.Current.RoamingSettings,
            //    "SessionUids",
            //    (uid) => { return this.sessionTable.Get(uid.ToString()) == null; });

            //this.intervalTable = new IntervalTable("Intervals", db);
            //this.intervalUidGenerator = new UidGenerator(
            //    ApplicationData.Current.RoamingSettings,
            //    "IntervalUids",
            //    (uid) => { return this.intervalTable.Get(uid.ToString()) == null; });
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionValidatorService" /> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 /// <param name="traceManager">The trace manager.</param>
 /// <param name="sessionStateProvider">The session state provider.</param>
 public SessionValidatorService(SessionValidatorConfiguration config, ITraceManager traceManager, ISessionStateProvider sessionStateProvider)
 {
     TimeProvider          = SystemTime.Current;
     _traceManager         = traceManager;
     _sessionStateProvider = sessionStateProvider;
     _config = config;
 }
Beispiel #20
0
 public RequestLogBuilder(ISystemTime systemTime, IHttpRequest request, ICurrentChain currentChain,
                          DiagnosticsSettings settings)
 {
     _systemTime   = systemTime;
     _request      = request;
     _currentChain = currentChain;
     _settings     = settings;
 }
Beispiel #21
0
 public BackgroundOrderProcessor(ILogger <BackgroundOrderProcessor> logger, CurbsideOrderChannel channel, IServiceProvider serviceProvider, ISystemTime systemTime, IHubContext <ShoppingHub> hub)
 {
     _logger          = logger;
     _channel         = channel;
     _serviceProvider = serviceProvider;
     _systemTime      = systemTime;
     _hub             = hub;
 }
        public ProductionDiagnosticEnvelopeContext(ILogger logger, ISystemTime systemTime, IChainInvoker invoker, IOutgoingSender outgoing, IHandlerPipeline pipeline, Envelope envelope, IExecutionLogger executionLogger) : base(logger, systemTime, invoker, outgoing, pipeline)
        {
            _envelope        = envelope;
            _executionLogger = executionLogger;
            _log             = new ChainExecutionLog();

            _envelope.Log = _log;
        }
Beispiel #23
0
 public DatabaseGateway(DatabaseContext databaseContext, IProcessDataGateway processDataGateway, ISystemTime systemTime)
 {
     _databaseContext    = databaseContext;
     _processDataGateway = processDataGateway;
     _workerGateway      = new WorkerGateway(databaseContext);
     _teamGateway        = new TeamGateway(databaseContext);
     _systemTime         = systemTime;
 }
 public RequestLogBuilder(IUrlRegistry urls, ISystemTime systemTime, ICurrentHttpRequest request, ICurrentChain currentChain, IRequestData requestData)
 {
     _urls         = urls;
     _systemTime   = systemTime;
     _request      = request;
     _currentChain = currentChain;
     _requestData  = requestData;
 }
 public EfOrderProcessor(ShoppingDataContext context, IMapper mapper, ISystemTime systemTime, MapperConfiguration config, CurbsideOrderChannel channel)
 {
     _context    = context;
     _mapper     = mapper;
     _systemTime = systemTime;
     _config     = config;
     _channel    = channel;
 }
Beispiel #26
0
        public MetricsFileStorageTest()
        {
            var systemTime = new Mock <ISystemTime>();

            this.fakeTime = new DateTime(100000000);
            systemTime.Setup(x => x.UtcNow).Returns(() => this.fakeTime);
            this.systemTime = systemTime.Object;
        }
 public PersistenceController(ILogger logger, IClientConnector client, ISpecFileWatcher watcher,
                              ISystemTime systemTime)
 {
     _logger     = logger;
     _client     = client;
     _watcher    = watcher;
     _systemTime = systemTime;
 }
        public TimeMessageExpiryStrategy(TimeSpan expiryTime, ISystemTime systemTime)
        {
            Contract.Requires(expiryTime != null);
            Contract.Requires(systemTime != null);

            this.expiryTime = expiryTime;
            this.systemTime = systemTime;
        }
Beispiel #29
0
        // This is used to create edgeAgent's own avaliability, since it can't track its own downtime.
        public Availability(string name, TimeSpan downtime, ISystemTime time)
        {
            this.Name            = Preconditions.CheckNotNull(name, nameof(name));
            this.time            = Preconditions.CheckNotNull(time, nameof(time));
            this.previousMeasure = time.UtcNow;

            this.ExpectedTime = downtime;
        }
        public AuthenticationSessionExpirer(ISystemTime systemTime, ITaskScheduler taskScheduler)
        {
            Contract.Requires(systemTime != null);
            Contract.Requires(taskScheduler != null);

            this.systemTime = systemTime;
            this.taskScheduler = taskScheduler;
        }
Beispiel #31
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MetricsScraper"/> class.
        /// </summary>
        /// <param name="endpoints">List of endpoints to scrape from. Endpoints must expose metrics in the prometheous format.
        /// Endpoints should be in the form "http://edgeHub:9600/metrics".</param>
        /// <param name="systemTime">Source for current time.</param>
        public MetricsScraper(IList <string> endpoints, ISystemTime systemTime = null)
        {
            Preconditions.CheckNotNull(endpoints, nameof(endpoints));

            this.httpClient = new HttpClient();
            this.endpoints  = new Lazy <IDictionary <string, string> >(() => endpoints.ToDictionary(e => e, this.GetUriWithIpAddress));
            this.systemTime = systemTime ?? SystemTime.Instance;
        }
Beispiel #32
0
 public EnvelopeContext(ILogger logger, ISystemTime systemTime, IChainInvoker invoker, IOutgoingSender outgoing, IHandlerPipeline pipeline)
 {
     this.logger = logger;
     _systemTime = systemTime;
     _invoker    = invoker;
     Outgoing    = outgoing;
     _pipeline   = pipeline;
 }
 public RequestLogBuilder(IUrlRegistry urls, ISystemTime systemTime, ICurrentHttpRequest request, ICurrentChain currentChain, IRequestData requestData)
 {
     _urls = urls;
     _systemTime = systemTime;
     _request = request;
     _currentChain = currentChain;
     _requestData = requestData;
 }
 public static ProcessorBuilder<MessagePayload> ToSimpleMessageRepeater(
     this ProcessorBuilder<MessagePayload> builder,
     IMessageCache messageCache,
     ISystemTime systemTime,
     ITaskRepeater taskRepeater)
 {
     return builder.ToMessageRepeater(messageCache, systemTime, taskRepeater, new NullRepeatStrategy());
 }
Beispiel #35
0
 public RequestLogBuilder(ISystemTime systemTime, IHttpRequest request, ICurrentChain currentChain,
     DiagnosticsSettings settings)
 {
     _systemTime = systemTime;
     _request = request;
     _currentChain = currentChain;
     _settings = settings;
 }
Beispiel #36
0
 public ServiceBus(IEnvelopeSender sender, IEventAggregator events, IChainInvoker invoker, ISystemTime systemTime, ISubscriptionRepository subscriptionRepository)
 {
     _sender                 = sender;
     _events                 = events;
     _invoker                = invoker;
     _systemTime             = systemTime;
     _subscriptionRepository = subscriptionRepository;
 }
Beispiel #37
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MetricsScraper"/> class.
        /// </summary>
        /// <param name="endpoints">List of endpoints to scrape from. Endpoints must expose metrics in the prometheus format.
        /// Endpoints should be in the form "http://edgeHub:9600/metrics".</param>
        /// <param name="systemTime">Source for current time.</param>
        public MetricsScraper(IList <string> endpoints, ISystemTime systemTime = null)
        {
            Preconditions.CheckNotNull(endpoints, nameof(endpoints));

            this.httpClient = new HttpClient();
            this.endpoints  = endpoints;
            this.systemTime = systemTime ?? SystemTime.Instance;
        }
        public ProductionDiagnosticEnvelopeContext(ILogger logger, ISystemTime systemTime, IChainInvoker invoker, IOutgoingSender outgoing, IHandlerPipeline pipeline, Envelope envelope, IExecutionLogger executionLogger)
            : base(logger, systemTime, invoker, outgoing, pipeline)
        {
            _envelope = envelope;
            _executionLogger = executionLogger;
            _log = new ChainExecutionLog();

            _envelope.Log = _log;
        }
Beispiel #39
0
 public UserRegistrationService(
     IUnitOfWork unitOfWork,
     IEmailVerificationTokenGenerator generator,
     ISystemTime systemTime)
 {
     _unitOfWork = unitOfWork;
     _generator  = generator;
     _systemTime = systemTime;
 }
            public IntegrationJsonBindingRegistry(Recorder recorder, ISystemTime time)
            {
                Services.For <Recorder>().Use(recorder);

                Actions.IncludeType <IntegratedJsonBindingEndpoint>();
                Models.BindPropertiesWith <CurrentTimePropertyBinder>();

                Services.ReplaceService(time);
            }
Beispiel #41
0
 public CaseMonitor(HostSettings settings, ILogger logger, ISystemTime systemTime, IModelBuilder <RecentCaseModel> caseModelBuilder)
 {
     _settings         = settings;
     _logger           = logger;
     _systemTime       = systemTime;
     _caseModelBuilder = caseModelBuilder;
     _interval         = TimeSpan.FromSeconds(15);
     _lastPolled       = systemTime.Now.Subtract(_interval);
 }
 public CurrencyService(
     ISystemTime time,
     ICurrencyClient currencyClient,
     IMapper mapper)
 {
     _time           = time;
     _currencyClient = currencyClient;
     _mapper         = mapper;
 }
Beispiel #43
0
        protected override void beforeEach()
        {
            time    = MockRepository.GenerateMock <ISystemTime>();
            cookies = MockFor <ICookies>();
            writer  = new RecordingOutputWriter();

            theName = "some name";

            theCookieValue = new CookieValue(theName, time, cookies, writer);
        }
        public static ProcessorBuilder<MessagePayload> ToMessageRepeater(
            this ProcessorBuilder<MessagePayload> builder, 
            IMessageCache messageCache, 
            ISystemTime systemTime, 
            ITaskRepeater taskRepeater, 
            IRepeatStrategy strategy)
        {
            var repeater = new MessageRepeater(strategy, systemTime, messageCache);
            taskRepeater.Register(TimeSpan.FromSeconds(1), repeater.Repeat);

            return builder.ToProcessor(repeater);
        }
        public MessageRepeater(IRepeatStrategy repeatStrategy, ISystemTime systemTime, IMessageCache messageCache)
        {
            Contract.Requires(repeatStrategy != null);
            Contract.Requires(systemTime != null);
            Contract.Requires(messageCache != null);
        
            this.repeatStrategy = repeatStrategy;
            this.systemTime = systemTime;
            this.messageCache = messageCache;

            Messenger.Register<MessagingInitialising>(_ => FirstRepeat());
        }
        public void Repeat(MessageRepeater repeater, IMessageCache messageCache, ISystemTime systemTime)
        {
            IEnumerable<MessagePayload> messages = messageCache.GetOrderedMessages();

            messages.ForEach(m =>
            {
                if (m.GetAmountSent() > 0 && m.GetLastTimeSent() <= systemTime.GetCurrentDate().Add(-RepeatEvery))
                {
                    LogMessage(m);
                    repeater.InputMessage(m);
                }
            });
        }
        public MessageCacheFactory(
            ChangeStoreSelector changeStoreSelector, 
            ISystemTime systemTime,
            NullChangeStore nullChangeStore,
            ICheckpointStrategy checkPointStrategy)
        {
            Contract.Requires(changeStoreSelector != null);
            Contract.Requires(systemTime != null);
            Contract.Requires(nullChangeStore != null);

            this.changeStoreSelector = changeStoreSelector;
            this.systemTime = systemTime;
            this.nullChangeStore = nullChangeStore;
            this.checkPointStrategy = checkPointStrategy;
        }
        public HttpRemoteServerBuilder(
            IHttpServerBuilder httpServerBuilder, 
            ISystemTime systemTime, 
            ISerialiser serialiser, 
            ServerAddressRegistry serverAddressRegistry)
        {
            Contract.Requires(httpServerBuilder != null);
            Contract.Requires(systemTime != null);
            Contract.Requires(serialiser != null);
            Contract.Requires(serverAddressRegistry != null);

            this.httpServerBuilder = httpServerBuilder;
            this.systemTime = systemTime;
            this.serialiser = serialiser;
            this.serverAddressRegistry = serverAddressRegistry;
        }
        public HttpCookie CreateCookie(ISystemTime clock)
        {
            var cookie = new HttpCookie(_settings.Name);
            cookie.HttpOnly = _settings.HttpOnly;
            cookie.Secure = _settings.Secure;
            cookie.Domain = _settings.Domain;

            if(_settings.Path.IsNotEmpty())
            {
                cookie.Path = _settings.Path;
            }

            cookie.Expires = _settings.ExpirationFor(clock.UtcNow());

            return cookie;
        }
        public PointToPointSenderConfiguration(
            EndpointAddress fromAddress, 
            EndpointAddress toAddress,
            MessagingConfiguration messagingConfiguration,
            ISystemTime systemTime)
            : base(messagingConfiguration)
        {
            this.systemTime = systemTime;
            sendSchema = new PointToPointSendChannelSchema
            {
                ExpiryStrategy = new PassthroughMessageExpiryStrategy(),
                ExpiryAction = () => { },
                FilteringStrategy = new PassThroughMessageFilterStategy(),
                ReceiverAddress = toAddress,
                FromAddress = fromAddress
            };

            RepeatMessages().WithDefaultEscalationStrategy();
        }
 public UserAccountProvider(
     IUserAuthenticationProvider userAuthProvider, 
     ICreatable<User> userCreator, 
     IRetrievable<ByUserId, User> userGetByUserId, 
     IRetrievable<ByUserEmail, User> retrieveUserByEmail, 
     IDeletable<User> userDeleter, 
     IUpdatable<User> userUpdater, 
     ITranslate<User, UserAccount> translateDataUserToUserAccount, 
     ISystemTime systemTime)
 {
     _userAuthProvider = userAuthProvider;
     _userCreator = userCreator;
     _userGetByUserId = userGetByUserId;
     _retrieveUserByEmail = retrieveUserByEmail;
     _userDeleter = userDeleter;
     _userUpdater = userUpdater;
     _translateDataUserToUserAccount = translateDataUserToUserAccount;
     _systemTime = systemTime;
 }
        public SendMessageCache(
            ISystemTime systemTime, 
            ChangeStore changeStore, 
            EndpointAddress address, 
            PersistenceUseType useType, 
            ICheckpointStrategy checkPointStrategy)
            : base(changeStore, checkPointStrategy)
        {
            Contract.Requires(systemTime != null);
            Contract.Requires(changeStore != null);
            Contract.Requires(address != EndpointAddress.Empty);

            this.systemTime = systemTime;
            Address = address;
            UseType = useType;
            Id = address + "|" + useType;

            messages = new ConcurrentDictionary<Guid, MessagePayload>();
            sequence = 1;
        }
        internal RequestRecieveChannelBuilder(
            ReplyAddressLookup replyAddressLookup,
            ISerialiser serialiser,
            MessageHandlerRouter messageHandlerRouter,
            AcknowledgementSender acknowledgementSender,
            MessageCacheFactory messageCacheFactory,
            ISystemTime systemTime,
            ITaskRepeater taskRepeater,
            ServerAddressRegistry serverAddressRegistry,
            IMainThreadMarshaller mainThreadMarshaller,
            AuthenticationSessionCache authenticationSessionCache,
            AuthenticatedServerRegistry authenticatedServerRegistry,
            ReplyCorrelationLookup correlationLookup)
        {
            Contract.Requires(replyAddressLookup != null);
            Contract.Requires(serialiser != null);
            Contract.Requires(messageHandlerRouter != null);
            Contract.Requires(acknowledgementSender != null);
            Contract.Requires(messageCacheFactory != null);
            Contract.Requires(systemTime != null);
            Contract.Requires(taskRepeater != null);
            Contract.Requires(serverAddressRegistry != null);
            Contract.Requires(mainThreadMarshaller != null);
            Contract.Requires(authenticationSessionCache != null);
            Contract.Requires(authenticatedServerRegistry != null);
            Contract.Requires(correlationLookup != null);

            this.replyAddressLookup = replyAddressLookup;
            this.serialiser = serialiser;
            this.messageHandlerRouter = messageHandlerRouter;
            this.acknowledgementSender = acknowledgementSender;
            this.messageCacheFactory = messageCacheFactory;
            this.systemTime = systemTime;
            this.taskRepeater = taskRepeater;
            this.serverAddressRegistry = serverAddressRegistry;
            this.mainThreadMarshaller = mainThreadMarshaller;
            this.authenticationSessionCache = authenticationSessionCache;
            this.authenticatedServerRegistry = authenticatedServerRegistry;
            this.correlationLookup = correlationLookup;
        }
 public AssetCacheHeaders(ISystemTime systemTime)
 {
     _systemTime = systemTime;
 }
 public DelayedEnvelopeProcessor(ILogger logger, ISystemTime systemTime, IEnumerable<ITransport> transports)
 {
     _logger = logger;
     _systemTime = systemTime;
     _transports = transports;
 }
 public CurrentTimePropertyBinder(ISystemTime systemTime)
 {
     _systemTime = systemTime;
 }
 public BasicFubuLoginCookies(ISystemTime time, ICookies cookies, IOutputWriter writer)
 {
     _time = time;
     _cookies = cookies;
     _writer = writer;
 }
 public static void SetCurrent(ISystemTime toSet)
 {
     Current = toSet;
 }
Beispiel #59
0
 public LockedOutRule(AuthenticationSettings settings, ISystemTime systemTime)
 {
     _settings = settings;
     _systemTime = systemTime;
 }
 public static string ElapsedTimeDescription(this DateTime describeMe, ISystemTime systemTime)
 {
     return ElapsedTimeDescription(describeMe, true, systemTime.Now);
 }