public static IMQueueRawClient GetQueueRawClient(this CoreServices services, string queuePairName, bool sendOnly = false) { Init(); if (_queues?.Items?.Contains(queuePairName) == true) { return(_queues.Items[queuePairName].GetRawClient(sendOnly)); } throw new NullReferenceException($"The Queue Pair Name: {queuePairName} not found in the configuration file."); }
public static IMQueueRawServer GetQueueRawServer(this CoreServices services, bool responseServer = false) { Init(); if (_queueServer is null) { var queueSettings = Core.GetSettings <QueueConfigurationSettings>(); throw new KeyNotFoundException($"The Queue server name: {queueSettings.ServerName} couldn't be found or loaded in the queue configuration file."); } return(_queueServer.GetRawServer(responseServer)); }
public static ServerOptions GetCacheServerOptions(this CoreServices services, string name) { Init(); var cConfig = _serverCacheSettings.Caches?.FirstOrDefault((c, mName) => c.Name == mName, name); return(cConfig?.ServerOptionsList?.FirstOf( c => c.EnvironmentName?.SplitAndTrim(",").Contains(Core.EnvironmentName) == true && c.MachineName?.SplitAndTrim(",").Contains(Core.MachineName) == true, c => c.EnvironmentName?.SplitAndTrim(",").Contains(Core.EnvironmentName) == true, c => c.MachineName?.SplitAndTrim(",").Contains(Core.MachineName) == true, c => c.EnvironmentName.IsNullOrWhitespace())); }
public static IMQueueRawServer GetQueueRawServer(this CoreServices services, string queuePairName, bool responseServer = false) { Init(); if (_queues.Items?.Contains(queuePairName) != true) { throw new KeyNotFoundException( $"The Queue server name: {queuePairName} couldn't be found in the queue configuration file."); } var serverPair = _queues.Items[queuePairName]; return(serverPair.GetRawServer(responseServer)); }
public static MQueuesConfiguration GetDefaultQueuesConfiguration(this CoreServices services) { Init(); return(_queues); }
public static void SetDefaultCacheClientSettings(this CoreServices services, CacheSettings settings) { _init = true; _settings = settings; }
public static async Task <CacheClientPoolAsync> GetCacheClientAsync(this CoreServices services, string name) { Init(); Ensure.ReferenceNotNull(_settings, "The client configuration settings is null, check if the cache configuration file is setted or is previously setted with the SetDefaultCacheClientSettings method."); return(await _settings.GetCacheClientAsync(name).ConfigureAwait(false)); }
public static void SetDefaultCacheServerOptions(this CoreServices services, ServerOptions options) { _init = true; _defaultServerOptions = options; }
public static ServerOptions GetDefaultCacheServerOptions(this CoreServices services) { Init(); return(_defaultServerOptions); }
public static CacheConfiguration GetCacheServerConfiguration(this CoreServices services, string name) { Init(); return(_serverCacheSettings.Caches?.FirstOrDefault((c, mName) => c.Name == mName, name)); }
public static void SetDefaultCacheServerConfiguration(this CoreServices services, CacheConfiguration configuration) { _init = true; _defaultCacheConfiguration = configuration; }
public static CacheConfiguration GetDefaultCacheServerConfiguration(this CoreServices services) { Init(); return(_defaultCacheConfiguration); }
public static void SetDefaultCacheClientSettings(this CoreServices services, CacheSettings settings) { _init = Interlocked.Exchange(ref _init, 1); _settings = settings; }