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);
        }
Ejemplo n.º 2
0
        protected void OnConfigurationUpdatedInternal(ConfigurationUpdatedEvent eventData)
        {
            if (eventData.Configuration.ConfigurationVersion <= _configuration.ConfigurationVersion)
            {
                return;
            }

            _configuration = eventData.Configuration;
            OnConfigurationUpdated(eventData.ConfigurationUpdateSource);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
 }