/// <summary>
        /// Initialises a new instance of the <see cref="CensusProcessor" />
        /// class.
        /// </summary>
        /// <param name="aggregationFieldsCache">
        /// An instance of <see cref="AggregationFieldsCache" />.
        /// </param>
        /// <param name="aggregatorFactory">
        /// An instance of type <see cref="IAggregatorFactory" />.
        /// </param>
        /// <param name="censusAdapter">
        /// An instance of type <see cref="ICensusAdapter" />.
        /// </param>
        /// <param name="censusProcessorSettingsProvider">
        /// An instance of type
        /// <see cref="ICensusProcessorSettingsProvider" />.
        /// </param>
        /// <param name="datasetQueryFilesStorageAdapter">
        /// An instance of type
        /// <see cref="IDatasetQueryFilesStorageAdapter" />.
        /// </param>
        /// <param name="loggerWrapper">
        /// An instance of type <see cref="ILoggerWrapper" />.
        /// </param>
        /// <param name="translationApiAdapter">
        /// An instance of type <see cref="ITranslationApiAdapter" />.
        /// </param>
        public CensusProcessor(
            AggregationFieldsCache aggregationFieldsCache,
            IAggregatorFactory aggregatorFactory,
            ICensusAdapter censusAdapter,
            ICensusProcessorSettingsProvider censusProcessorSettingsProvider,
            IDatasetQueryFilesStorageAdapter datasetQueryFilesStorageAdapter,
            ILoggerWrapper loggerWrapper,
            ITranslationApiAdapter translationApiAdapter)
        {
            if (censusProcessorSettingsProvider == null)
            {
                throw new ArgumentNullException(
                          nameof(censusProcessorSettingsProvider));
            }

            this.aggregatorFactory               = aggregatorFactory;
            this.aggregationFieldsCache          = aggregationFieldsCache;
            this.censusAdapter                   = censusAdapter;
            this.datasetQueryFilesStorageAdapter = datasetQueryFilesStorageAdapter;
            this.loggerWrapper                   = loggerWrapper;
            this.translationApiAdapter           = translationApiAdapter;

            this.aggregationFieldsAdapterName =
                censusProcessorSettingsProvider.AggregationFieldsAdapterName;
            this.aggregationFieldsEnumerationName =
                censusProcessorSettingsProvider.AggregationFieldsEnumerationName;
        }
        /// <summary>
        /// Initialises a new instance of the <see cref="Aggregator" /> class.
        /// </summary>
        /// <param name="resultSetFieldNames">
        /// A set of field names, obtained from the result set itself, upfront.
        /// </param>
        /// <param name="aggregationFieldsCache">
        /// An instance of <see cref="AggregationFieldsCache" />.
        /// </param>
        /// <param name="requestedQueryName">
        /// The name of the originally requested query.
        /// </param>
        /// <param name="aggregateQuery">
        /// An instance of <see cref="AggregateQuery" />.
        /// </param>
        public Aggregator(
            IEnumerable <string> resultSetFieldNames,
            AggregationFieldsCache aggregationFieldsCache,
            string requestedQueryName,
            AggregateQuery aggregateQuery)
        {
            this.resultSetFieldNames = resultSetFieldNames;

            this.aggregationFieldsCache = aggregationFieldsCache;
            this.requestedQueryName     = requestedQueryName;
            this.aggregateQuery         = aggregateQuery;

            this.aggregateTotal = 0;
        }
示例#3
0
 /// <summary>
 /// Initialises a new instance of the <see cref="AggregatorFactory" />
 /// class.
 /// </summary>
 /// <param name="aggregationFieldsCache">
 /// An instance of <see cref="AggregationFieldsCache" />.
 /// </param>
 public AggregatorFactory(AggregationFieldsCache aggregationFieldsCache)
 {
     this.aggregationFieldsCache = aggregationFieldsCache;
 }