Ejemplo n.º 1
0
        public MainProcessor(
            AzureUtils.ApplicationClientInfo applicationClientInfo,
            AzureUtils.StorageAccountInfo storageAccountInfo,
            string tsidCheckpointingTableName,
            string stationObservationsCheckpointingPartitionKey,
            string eventHubConnectionString,
            string azureMapsSubscriptionKey,
            string azureMapsCacheTableName,
            string tsiEnvironmentFqdn)
        {
            _noaaClient = new NoaaClient();

            _stationsProcessor = new StastionsProcessor(
                _noaaClient,
                TsiDataClient.AadLoginAsApplication(applicationClientInfo),
                tsiEnvironmentFqdn,
                new AzureMapsClient(
                    azureMapsSubscriptionKey,
                    AzureUtils.GetOrCreateTableAsync(storageAccountInfo, azureMapsCacheTableName).Result));

            _stationObservationsCheckpointing = new TsidCheckpointing(
                AzureUtils.GetOrCreateTableAsync(storageAccountInfo, tsidCheckpointingTableName).Result,
                stationObservationsCheckpointingPartitionKey);

            _stationObservationProcessors = new Dictionary <string, StationObservationsProcessor>();

            _eventHubClient = EventHubClient.CreateFromConnectionString(eventHubConnectionString);
        }
Ejemplo n.º 2
0
 public StastionsProcessor(
     NoaaClient noaaClient,
     TsiDataClient tsiDataClient,
     string tsiEnvironmentFqdn,
     AzureMapsClient azureMapsClient)
 {
     _noaaClient         = noaaClient;
     _tsiDataClient      = tsiDataClient;
     _tsiEnvironmentFqdn = tsiEnvironmentFqdn;
     _azureMapsClient    = azureMapsClient;
     Stations            = new Station[0];
 }
Ejemplo n.º 3
0
 public StationObservationsProcessor(
     string stationShortId,
     NoaaClient noaaClient,
     EventHubClient eventHubClient,
     TsidCheckpointing checkpointing)
 {
     StationShortId          = stationShortId;
     _noaaClient             = noaaClient;
     _eventHubClient         = eventHubClient;
     _checkpointing          = checkpointing;
     _lastCommittedTimestamp = null;
     _lastSuccessfulPullTime = DateTime.MinValue;
     GoodNextTimeToProcess   = DateTime.MinValue;
 }