private void UpdateAndPublishConfiguration(ConfigurationUpdateSource configurationUpdateSource)
        {
            Configuration = new InternalConfiguration(_environment, _localConfiguration, _serverConfiguration, _runTimeConfiguration, _securityPoliciesConfiguration, _processStatic, _httpRuntimeStatic, _configurationManagerStatic, _dnsStatic);

            var configurationUpdatedEvent = new ConfigurationUpdatedEvent(Configuration, configurationUpdateSource);

            EventBus <ConfigurationUpdatedEvent> .Publish(configurationUpdatedEvent);
        }
Example #2
0
        protected void OnConfigurationUpdatedInternal(ConfigurationUpdatedEvent eventData)
        {
            if (eventData.Configuration.ConfigurationVersion <= _configuration.ConfigurationVersion)
            {
                return;
            }

            _configuration = eventData.Configuration;
            OnConfigurationUpdated(eventData.ConfigurationUpdateSource);
        }
        public string GetToken()
        {
            AuthApi authAPI     = new AuthApi(ConnectionSettings.ServerURL);
            var     apiResponse = authAPI.ApiV1AuthTokenPostWithHttpInfo(new LoginModel(ConnectionSettings.AgentUsername, ConnectionSettings.AgentPassword));

            Configuration.AccessToken = apiResponse.Data.Token.ToString();
            ConfigurationUpdatedEvent?.Invoke(this, Configuration);

            ConnectionSettings.AgentId = apiResponse.Data.AgentId;
            return(Configuration.AccessToken);
        }
Example #4
0
        private void OnConfigurationUpdated(ConfigurationUpdatedEvent eventData)
        {
            // It is *CRITICAL* that this method never do anything more complicated than clearing data and starting and ending subscriptions.
            // If this method ends up trying to send data synchronously (even indirectly via the EventBus or RequestBus) then the user's application will deadlock (!!!).

            if (eventData.Configuration.ConfigurationVersion <= Configuration.ConfigurationVersion)
            {
                return;
            }

            Configuration = eventData.Configuration;
        }
Example #5
0
        public void Initialize(String pEndpoint)
        {
            base.Initialize();
            Endpoint = pEndpoint;

            _connection = new HubConnectionBuilder().WithUrl(Endpoint).Build();
            _connection.On("RequestRNNPrediction", (PredictionRequestPackage pPackage) =>
            {
                PredictionRequestedEvent?.Invoke(pPackage);
            });
            _connection.On("UpdateConfig", (ConductorConfiguration pConfig) =>
            {
                ConfigurationUpdatedEvent?.Invoke(pConfig);
            });
            _connection.Closed += async delegate(Exception arg)
            {
                NotifyNewLogMessageEvent("Connection closed... restarting...");
                IsConnected = false;
                await ConnectAsync();
            };
        }
 public Task Handle(ConfigurationUpdatedEvent notification, CancellationToken cancellationToken)
 {
     //Envia algum e-mail ou algo assim
     return(Task.CompletedTask);
 }