Base configuration for a time client
 /// <summary>
 /// Initializes a new instance of the <see cref="RedisServerUnixTime" /> class.
 /// </summary>
 /// <param name="timeLua">The time lua.</param>
 /// <param name="log">The log.</param>
 /// <param name="configuration">The configuration.</param>
 public RedisServerUnixTime(TimeLua timeLua,
     ILogFactory log,
     BaseTimeConfiguration configuration): base(log, configuration)
 {
     Guard.NotNull(() => timeLua, timeLua);
     _timeLua = timeLua;
 }
 public void Create()
 {
     var test = new BaseTimeConfiguration();
     Assert.Equal(TimeSpan.FromSeconds(900), test.RefreshTime);
     test.RefreshTime = TimeSpan.FromSeconds(100);
     Assert.Equal(TimeSpan.FromSeconds(100), test.RefreshTime);
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseTime" /> class.
        /// </summary>
        /// <param name="log">The log.</param>
        /// <param name="configuration">The configuration.</param>
        protected BaseTime(ILogFactory log,
            BaseTimeConfiguration configuration)
        {
            Guard.NotNull(() => log, log);
            Guard.NotNull(() => configuration, configuration);

            Configuration = configuration;
            Log = log.Create();
        }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlServerTime" /> class.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="configuration">The configuration.</param>
 /// <param name="connectionInformation">The connection information.</param>
 /// <param name="dateTimeQueryHandler">The date time query handler.</param>
 public SqlServerTime(ILogFactory log,
     BaseTimeConfiguration configuration,
     IConnectionInformation connectionInformation,
     IQueryHandler<GetUtcDateQuery, DateTime> dateTimeQueryHandler) : base(log, configuration)
 {
     Guard.NotNull(() => connectionInformation, connectionInformation);
     Guard.NotNull(() => dateTimeQueryHandler, dateTimeQueryHandler);
     _queryHandler = dateTimeQueryHandler;
     _connectionInformation = connectionInformation;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueConfigurationReceive" /> class.
        /// </summary>
        /// <param name="transportConfiguration">The transport configuration.</param>
        /// <param name="headerNames">The header names.</param>
        /// <param name="additionalConfiguration">The additional configuration.</param>
        /// <param name="timeConfiguration">The time configuration.</param>
        public QueueConfigurationReceive(TransportConfigurationReceive transportConfiguration,
                                         IHeaders headerNames,
                                         IConfiguration additionalConfiguration,
                                         BaseTimeConfiguration timeConfiguration)
        {
            Guard.NotNull(() => transportConfiguration, transportConfiguration);
            Guard.NotNull(() => headerNames, headerNames);
            Guard.NotNull(() => additionalConfiguration, additionalConfiguration);
            Guard.NotNull(() => timeConfiguration, timeConfiguration);

            TransportConfiguration  = transportConfiguration;
            HeaderNames             = headerNames;
            AdditionalConfiguration = additionalConfiguration;
            TimeConfiguration       = timeConfiguration;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueConfigurationSend" /> class.
        /// </summary>
        /// <param name="transportConfiguration">The transport configuration.</param>
        /// <param name="headerNames">The header names.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="timeConfiguration">The time configuration.</param>
        public QueueConfigurationSend(TransportConfigurationSend transportConfiguration, 
            IHeaders headerNames,
            IConfiguration configuration,
            BaseTimeConfiguration timeConfiguration)
        {
            Guard.NotNull(() => transportConfiguration, transportConfiguration);
            Guard.NotNull(() => headerNames, headerNames);
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => timeConfiguration, timeConfiguration);

            TransportConfiguration = transportConfiguration;
            HeaderNames = headerNames;
            AdditionalConfiguration = configuration;
            TimeConfiguration = timeConfiguration;
        }
Esempio n. 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueConfigurationSend" /> class.
        /// </summary>
        /// <param name="transportConfiguration">The transport configuration.</param>
        /// <param name="headerNames">The header names.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="timeConfiguration">The time configuration.</param>
        /// <param name="policies">The policies.</param>
        public QueueConfigurationSend(TransportConfigurationSend transportConfiguration,
                                      IHeaders headerNames,
                                      IConfiguration configuration,
                                      BaseTimeConfiguration timeConfiguration,
                                      IPolicies policies)
        {
            Guard.NotNull(() => transportConfiguration, transportConfiguration);
            Guard.NotNull(() => headerNames, headerNames);
            Guard.NotNull(() => configuration, configuration);
            Guard.NotNull(() => timeConfiguration, timeConfiguration);
            Guard.NotNull(() => policies, policies);

            TransportConfiguration  = transportConfiguration;
            HeaderNames             = headerNames;
            AdditionalConfiguration = configuration;
            TimeConfiguration       = timeConfiguration;
            Policies = policies;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueConsumerConfiguration" /> class.
        /// </summary>
        /// <param name="transportConfiguration">The transport configuration.</param>
        /// <param name="workerConfiguration">The worker configuration.</param>
        /// <param name="heartBeatConfiguration">The heart beat configuration.</param>
        /// <param name="messageExpirationConfiguration">The message expiration configuration.</param>
        /// <param name="headers">The headers.</param>
        /// <param name="additionalConfiguration">The additional configuration.</param>
        /// <param name="timeConfiguration">The time configuration.</param>
        public QueueConsumerConfiguration(TransportConfigurationReceive transportConfiguration, 
            IWorkerConfiguration workerConfiguration, 
            IHeartBeatConfiguration heartBeatConfiguration, 
            IMessageExpirationConfiguration messageExpirationConfiguration, 
            IHeaders headers,
            IConfiguration additionalConfiguration,
            BaseTimeConfiguration timeConfiguration)
            : base(transportConfiguration, headers, additionalConfiguration, timeConfiguration)
        {
            Guard.NotNull(() => workerConfiguration, workerConfiguration);
            Guard.NotNull(() => heartBeatConfiguration, heartBeatConfiguration);
            Guard.NotNull(() => messageExpirationConfiguration, messageExpirationConfiguration);

            Worker = workerConfiguration;
            HeartBeat = heartBeatConfiguration;
            MessageExpiration = messageExpirationConfiguration;
            _routes = new List<string>();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="QueueConsumerConfiguration" /> class.
        /// </summary>
        /// <param name="transportConfiguration">The transport configuration.</param>
        /// <param name="workerConfiguration">The worker configuration.</param>
        /// <param name="heartBeatConfiguration">The heart beat configuration.</param>
        /// <param name="messageExpirationConfiguration">The message expiration configuration.</param>
        /// <param name="headers">The headers.</param>
        /// <param name="additionalConfiguration">The additional configuration.</param>
        /// <param name="timeConfiguration">The time configuration.</param>
        public QueueConsumerConfiguration(TransportConfigurationReceive transportConfiguration,
                                          IWorkerConfiguration workerConfiguration,
                                          IHeartBeatConfiguration heartBeatConfiguration,
                                          IMessageExpirationConfiguration messageExpirationConfiguration,
                                          IHeaders headers,
                                          IConfiguration additionalConfiguration,
                                          BaseTimeConfiguration timeConfiguration)
            : base(transportConfiguration, headers, additionalConfiguration, timeConfiguration)
        {
            Guard.NotNull(() => workerConfiguration, workerConfiguration);
            Guard.NotNull(() => heartBeatConfiguration, heartBeatConfiguration);
            Guard.NotNull(() => messageExpirationConfiguration, messageExpirationConfiguration);

            Worker            = workerConfiguration;
            HeartBeat         = heartBeatConfiguration;
            MessageExpiration = messageExpirationConfiguration;
            Routes            = new List <string>();
        }
Esempio n. 10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RedisServerUnixTime" /> class.
        /// </summary>
        /// <param name="log">The log.</param>
        /// <param name="configuration">The configuration.</param>
        protected BaseUnixTime(ILogFactory log,
            BaseTimeConfiguration configuration): base(log, configuration)
        {

        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RedisServerUnixTime" /> class.
 /// </summary>
 /// <param name="log">The log.</param>
 /// <param name="configuration">The configuration.</param>
 public LocalMachineUnixTime(ILogFactory log,
     BaseTimeConfiguration configuration): base(log, configuration)
 {
 }