public StandardEngine( ISettingsManager settingsManager, IBranchManager branchManager, ICommandLineManager commandLineManager, IBannerManager bannerManager, IAppearanceManager appearanceManager, IErrorManager errorManager, IDialogsManager dialogsManager, IHelpManager helpManager, IAdvancedMenuManager advancedMenuManager, IEndpointManager endpointManager ) { SettingsManager = settingsManager; BranchManager = branchManager; BannerManager = bannerManager; AppearanceManager = appearanceManager; CommandLineManager = commandLineManager; ErrorManager = errorManager; DialogsManager = dialogsManager; HelpManager = helpManager; AdvancedMenuManager = advancedMenuManager; EndpointManager = endpointManager; Identifier = Guid.NewGuid(); }
private static T ReloadItem <T>(IEndpointManager <T> manager, IRequestResponse response) where T : CommonEndpointModel { if (response.Status == "success") { return(manager.Get((int)response.Payload.Id)); } // FIXME - an error occured. Handle appropriately return(null); }
public BackendInfo(string backendId, IEndpointManager endpointManager, IProxyHttpClientFactory proxyHttpClientFactory) { Contracts.CheckNonEmpty(backendId, nameof(backendId)); Contracts.CheckValue(endpointManager, nameof(endpointManager)); Contracts.CheckValue(proxyHttpClientFactory, nameof(proxyHttpClientFactory)); BackendId = backendId; EndpointManager = endpointManager; ProxyHttpClientFactory = proxyHttpClientFactory; DynamicState = CreateDynamicStateQuery(); }
public HelpManager(IAppearanceManager appearanceManager, ISettingsManager settingsManager, IEndpointManager endpointManager) { _settingsManager = settingsManager; _endpointManager = endpointManager; _model = new HelpDialogModel(this, appearanceManager); SchemeHandlers = new Dictionary<string, IHelpSchemeHandler> { {"archive", new ArchiveSchemeHandler()} }; PreserveContentText = "Preserve this content in a new window when the utility exits."; DialogTitle = "Help Resources"; InitialLeftOffset = -75; InitialTopOffset = -75; }
public DefaultAquilesCluster(CassandraClusterElement configuration) { this.KeySpaces = new Dictionary<string, AquilesKeyspace>(); this.FriendlyName = configuration.FriendlyName; this.connectionFactory = ConnectionFactoryHelper.Create(configuration.Connection.FactoryType); this.connectionFactory.SpecialConnectionParameters = configuration.Connection.SpecialConnectionParameters; this.endpointManager = EndpointManagerHelper.Create(configuration.EndpointManager); this.connectionPool = ConnectionPoolHelper.Create(configuration.Connection.PoolType); this.connectionPool.Name = String.Format(CultureInfo.InvariantCulture, "{0}_Pool", this.FriendlyName); this.endpointManager.ConnectionFactory = this.connectionFactory; this.connectionPool.ConnectionFactory = this.connectionFactory; this.connectionPool.EndpointManager = this.endpointManager; this.connectionPool.SpecialConnectionParameters = configuration.Connection.SpecialConnectionParameters; }
IDictionary<string, IHubProtocol> SetupProtocols(IEndpointManager endpointManager) { var protocols = new Dictionary<string, IHubProtocol>(); foreach (var endpoint in endpointManager.Endpoints.Where(e => !protocols.Keys.Contains(e.Key))) { var hubProtocol = Create.New<IHubProtocol>(); hubProtocol.Connection = new HubConnection(endpoint.Value.Uri) { TraceLevel = TraceLevels.All, TraceWriter = Console.Out }; hubProtocol.Proxy = hubProtocol.Connection.CreateHubProxy("Messaging"); protocols.Add(endpoint.Key, hubProtocol); } return protocols; }
protected void Initialize(IConnectionHandler connectionHandler, IMessageParser parser, IConnectionStorage connectionStorage, IEndpointManager endpointManager, IMessenger broadcaster, IModuleFramework moduleFramework, IModuleControl moduleControl, LogManager logManager) { if (Initialized) { throw new Exception("Server is already initialized!"); } LogManager = logManager; log = LogManager.GetLogger("Server"); _network = endpointManager; Framework = moduleFramework; Framework.Messenger = broadcaster; Framework.Server = this; ConnectionHandler = connectionHandler; ConnectionStorage = connectionStorage; _network.ConnectionHandler = connectionHandler; _network.MessageParser = parser; connectionHandler.Modules = moduleControl; connectionHandler.Messenger = broadcaster; parser.Modules = moduleControl; parser.ConnectionHandler = connectionHandler; broadcaster.Connections = connectionStorage; Initialized = true; }
/// <summary> /// Initializes a new instance of the <see cref="BackendProber"/> class. /// HealthProber is the unit that checks the health state for all endpoints(replica) of a backend(service) /// HealthProbe would query the health controller of the endpoint and update the health state for every endpoint /// periodically base on the time interval user specified in backend. /// </summary> public BackendProber(string backendId, BackendConfig config, IEndpointManager endpointManager, IMonotonicTimer timer, ILogger <BackendProber> logger, IOperationLogger operationLogger, HttpClient httpClient, IRandomFactory randomFactory) { Contracts.CheckValue(backendId, nameof(backendId)); Contracts.CheckValue(config, nameof(config)); Contracts.CheckValue(endpointManager, nameof(endpointManager)); Contracts.CheckValue(timer, nameof(timer)); Contracts.CheckValue(logger, nameof(logger)); Contracts.CheckValue(operationLogger, nameof(operationLogger)); Contracts.CheckValue(httpClient, nameof(httpClient)); Contracts.CheckValue(randomFactory, nameof(randomFactory)); BackendId = backendId; Config = config; _endpointManager = endpointManager; _timer = timer; _logger = logger; _operationLogger = operationLogger; _randomFactory = randomFactory; _healthControllerUrl = new Uri(Config.HealthCheckOptions.Path, UriKind.Relative); _healthCheckInterval = Config.HealthCheckOptions.Interval; _backendProbeHttpClient = httpClient; }
public ComputerNameRequest(IEndpointManager endpointManager) : base(endpointManager) { }
public ReportingRequest(IEndpointManager endpointManager) : base(endpointManager) { }
private void UpdateRuntimeEndpoints(IDictionary <string, BackendEndpoint> configEndpoints, IEndpointManager endpointManager) { var desiredEndpoints = new HashSet <string>(StringComparer.Ordinal); foreach (var configEndpoint in configEndpoints) { desiredEndpoints.Add(configEndpoint.Key); endpointManager.GetOrCreateItem( itemId: configEndpoint.Key, setupAction: endpoint => { if (endpoint.Config.Value?.Address != configEndpoint.Value.Address) { if (endpoint.Config.Value == null) { _logger.LogDebug("Endpoint {endpointId} has been added.", configEndpoint.Key); } else { _logger.LogDebug("Endpoint {endpointId} has changed.", configEndpoint.Key); } endpoint.Config.Value = new EndpointConfig(configEndpoint.Value.Address); } }); } foreach (var existingEndpoint in endpointManager.GetItems()) { if (!desiredEndpoints.Contains(existingEndpoint.EndpointId)) { // NOTE 1: This is safe to do within the `foreach` loop // because `IEndpointManager.GetItems` returns a copy of the list of endpoints. // // NOTE 2: Removing the endpoint from `IEndpointManager` is safe and existing // backends will continue to work with their existing behavior (until those backends are updated) // and the Garbage Collector won't destroy this backend object while it's referenced elsewhere. _logger.LogDebug("Endpoint {endpointId} has been removed.", existingEndpoint.EndpointId); endpointManager.TryRemoveItem(existingEndpoint.EndpointId); } } }
public MacAddressReport(IEndpointManager endpointManager) : base(endpointManager) { }
public RegistrationQueryStringRequest(IEndpointManager endpointManager) : base(endpointManager) { }
protected AbstractUserCampusContract(IEndpointManager endpointManager) : base(endpointManager) { }
protected AbstractUrlContract(IEndpointManager endpointManager) : base(endpointManager) { }
public WebServiceAppender(IEndpointManager endpointManager) { _endpointManager = endpointManager; }
public IdentityQueryRequest(IEndpointManager endpointManager) : base(endpointManager) { }
public ChannelProxyFactory(IEndpointManager endpointManager, IConnectionManager connectionManager) { _endpointManager = endpointManager; _connectionManager = connectionManager; }
public SynchronousLogRequest(IEndpointManager endpointManager) : base(endpointManager) { }
protected AbstractStatusInfoContract(IEndpointManager endpointManager) : base(endpointManager) { }
public StatusInfoRequest(IEndpointManager endpointManager) : base(endpointManager) { }
protected AbstractGetCertificateContract(IEndpointManager endpointManager) : base(endpointManager) { }
protected AbstractComputerNameContract(IEndpointManager endpointManager) : base(endpointManager) { }
protected AbstractLocationQueryContract(IEndpointManager endpointManager) : base(endpointManager) { }
public UserCampusRequest(IEndpointManager endpointManager) : base(endpointManager) { }
public LocationQueryRequest(IEndpointManager endpointManager) : base(endpointManager) { }
public static PhysicalAddress GetActiveMacAddress(IEndpointManager endpointManager) { var address = GetActiveIpAddress(endpointManager); var adapter = GetAdapterForIpAddress(address); return adapter == null ? null : adapter.GetPhysicalAddress(); }
public static IPAddress GetActiveIpAddress(IEndpointManager endpointManager) { try { var primaryAdapter = GetPrimaryAdapter(endpointManager.GetDefaultHost()); if (primaryAdapter == null) return GetIpAddressFromDns(); foreach (var entry in primaryAdapter.GetIPProperties().UnicastAddresses .Where(entry => entry.Address.AddressFamily == AddressFamily.InterNetwork)) { return entry.Address; } throw new Exception("Could not determine client ip address"); } catch (Exception e) { Log.WarnFormat("An exception occurred while attempting to get this computer's ip address from primary adapter: {0}", e.Message); return null; } }
protected AbstractIdentityQueryContract(IEndpointManager endpointManager) : base(endpointManager) { }
public static NetworkInterface GetPrimaryAdapter(IEndpointManager endpointManager) { return GetPrimaryAdapter(endpointManager.GetDefaultHost()); }
/// <inheritdoc/> public IBackendProber CreateBackendProber(string backendId, BackendConfig config, IEndpointManager endpointManager) { return(new BackendProber(backendId, config, endpointManager, _timer, _loggerFactory.CreateLogger <BackendProber>(), _operationLogger, _httpClientFactory.CreateHttpClient(), _randomFactory)); }
public StandardTokens(ISettingsManager settingsManager, IEndpointManager endpointManager, IAppearanceManager appearanceManager) { _settingsManager = settingsManager; _endpointManager = endpointManager; _appearanceManager = appearanceManager; }
public RegisterComputerRequest(IEndpointManager endpointManager) : base(endpointManager) { }
protected AbstractAuthenticationContract(IEndpointManager endpointManager) : base(endpointManager) { }
public GetCertificateRequest(IEndpointManager endpointManager) : base(endpointManager) { }
public HubProtocolConnectionManager(IEndpointManager endpointManager) { Protocols = SetupProtocols(endpointManager); Connect(); }