/// <summary> /// Refreshes the Config of the OPS when running in-process with BSL. /// </summary> /// <param name="key"></param> /// <param name="configService"></param> /// <param name="csUser"></param> /// <returns>Int success code.</returns> public int refreshOPSConfig(ConfigurationKeyValues key, ConfigurationService configService, bool notifyNodes, ServiceUsers csUser) { int returnCode= ConfigUtility.CLUSTER_UPDATE_FULL_SUCCESS; string value = key.ConfigurationKeyValue; string targetHostID = null; if (ConfigUtility.onAzure) targetHostID = Trade.Utility.StockTraderUtility.ORDER_PROCESSOR_SERVICE_AZURE; else targetHostID = Trade.Utility.StockTraderUtility.ORDER_PROCESSOR_SERVICE_SELFHOST; List<TraverseNode> traversePath = configService.getTraversePath(null, targetHostID, StockTraderUtility.ORDER_PROCESSOR_SERVICE_CONFIG, csUser); key = configService.getServiceConfigurationKey(targetHostID, StockTraderUtility.ORDER_PROCESSOR_SERVICE_CONFIG, key.ConfigurationKeyFieldName, traversePath, csUser); if (key != null) { key.ConfigurationKeyValue = value; traversePath = configService.getTraversePath(null, targetHostID, StockTraderUtility.ORDER_PROCESSOR_SERVICE_CONFIG, csUser); if (traversePath!=null || Trade.BusinessServiceConfigurationSettings.Settings.ORDER_PROCESSING_MODE.Equals(StockTraderUtility.OPS_INPROCESS)) returnCode = configService.receiveConfigurationKey(targetHostID, StockTraderUtility.ORDER_PROCESSOR_SERVICE_CONFIG, key, key, notifyNodes, ConfigUtility.UPDATE_KEY_VALUE, traversePath, csUser); } return returnCode; }
/// <summary> /// Not part of service contract; special for Web app to return a single requested specific configurationkey /// from Business Service when running BSL in-process. /// </summary> /// <param name="targetHostNameIdentifier"></param> /// <param name="targetConfigServiceNameIdentifier"></param> /// <param name="settingsClassFieldName"></param> /// <param name="traversePath"></param> /// <param name="csUser"></param> /// <returns></returns> private ConfigurationKeyValues callBSLConfigKeyLocal(string targetHostNameIdentifier, string targetConfigServiceNameIdentifier, string settingsClassFieldName, List<TraverseNode> traversePath, ServiceUsers csUser) { Trade.BusinessServiceHostConfigurationImplementation.ConfigurationService BSLConfig = new Trade.BusinessServiceHostConfigurationImplementation.ConfigurationService(); return BSLConfig.getServiceConfigurationKey(targetHostNameIdentifier, targetConfigServiceNameIdentifier, settingsClassFieldName, traversePath, csUser); }