コード例 #1
0
        /// <summary>
        /// Initialises an instance of the <see cref="ArchiveDataService"/> class.
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="fileHelper"></param>
        /// <param name="configuration"></param>
        public ArchiveDataService(IFileHelper fileHelper, BufferedConfiguration configuration) : base(typeof(ArchiveDataService))
        {
            fileHelper.ShouldNotBeNull();
            configuration.ShouldNotBeNull();

            m_FileHelper = fileHelper;
            m_Configuration = configuration;
            m_SyncObject = new object();
        }
コード例 #2
0
        /// <summary>
        /// Initialises an instance of the <see cref="DataTransferService"/> class.
        /// </summary>
        /// <param name="logger"></param>
        /// <param name="publisher">
        /// The client to use for sending messages to a message broker.
        /// </param>
        /// <param name="fileHelper">
        /// Helper for working with files.
        /// </param>
        /// <param name="configuration">
        /// The configuration parameters for where the files are located.
        /// </param>
        /// <param name="bufferSize">
        /// The size of the read buffer to use when loading each data file's contents.
        /// </param>
        public DataTransferService(ILogger logger, IMessagePublisher publisher, IFileHelper fileHelper, ILed led, BufferedConfiguration configuration, int bufferSize = 400)
            : base(logger, typeof(DataTransferService))
        {
            publisher.ShouldNotBeNull();
            fileHelper.ShouldNotBeNull();
            configuration.ShouldNotBeNull();
            led.ShouldNotBeNull();

            m_ResourceLoader = new ServicesResourceLoader();
            m_FileHelper = fileHelper;
            m_SyncObject = new object();
            m_Publisher = publisher;
            m_BufferSize = bufferSize;
            m_Configuration = configuration;
            m_Led = led;

            m_TransferLimit = 5;
            m_MaximumFileSizeInBytes = 1500;
        }
コード例 #3
0
        /// <summary>
        /// Initialises an instance of the <see cref="BufferedLoggingService"/> class. 
        /// </summary>
        /// <param name="fileHelper">
        /// Helper for working with files.
        /// </param>
        /// <param name="configuration">
        /// Configuration details for buffered data persistence. 
        /// </param>
        public BufferedLoggingService(LogContainer container, ILogger logger, IFileHelper fileHelper, BufferedConfiguration configuration) : base(logger, typeof(BufferedLoggingService))
        {
            logger.ShouldNotBeNull();
            fileHelper.ShouldNotBeNull();
            configuration.ShouldNotBeNull();

            m_LogEntries = container;
            m_BatchSize = 2;
            m_BufferSize = 512;

            m_FileHelper = fileHelper;
            m_WorkingFilePath = configuration.WorkingPath;
            m_TargetFilePath = configuration.TargetPath;
            m_TargetFileExtension = configuration.TargetFileExtension;
            m_WorkingFileExtension = configuration.WorkingFileExtension;
        }