11using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Text ;
5- using System . Threading . Tasks ;
62using GeneXus . Encryption ;
7- using GeneXus . Messaging . Common ;
83using GeneXus . Services ;
94using log4net ;
105
116namespace GeneXus . Messaging . Common
127{
138 public class ServiceSettings
149 {
15- static readonly ILog logger = log4net . LogManager . GetLogger ( typeof ( ServiceSettings ) ) ;
10+ static readonly ILog logger = LogManager . GetLogger ( typeof ( ServiceSettings ) ) ;
1611
1712 internal GXService service ;
1813 public string serviceNameResolver { get ; }
@@ -22,61 +17,61 @@ public ServiceSettings(string serviceNameResolver, string name, GXService gXServ
2217 {
2318 this . serviceNameResolver = serviceNameResolver ;
2419 this . name = name ;
25- this . service = gXService ;
20+ service = gXService ;
2621 }
2722
2823 public string GetEncryptedOptPropertyValue ( string propertyName , string alternativePropertyName = null )
2924 {
30- String value = GetEncryptedPropertyValue ( propertyName , alternativePropertyName , null ) ;
25+ string value = GetEncryptedPropertyValue ( propertyName , alternativePropertyName , null ) ;
3126 return value ;
3227 }
3328 public string GetEncryptedPropertyValue ( string propertyName , string alternativePropertyName = null )
3429 {
35- String value = GetEncryptedPropertyValue ( propertyName , alternativePropertyName , null ) ;
30+ string value = GetEncryptedPropertyValue ( propertyName , alternativePropertyName , null ) ;
3631 if ( value == null )
3732 {
38- String errorMessage = String . Format ( $ "Service configuration error - Property name { ResolvePropertyName ( propertyName ) } must be defined") ;
39- logger . Fatal ( errorMessage ) ;
33+ string errorMessage = string . Format ( $ "Service configuration error - Property name { ResolvePropertyName ( propertyName ) } must be defined") ;
34+ GXLogging . Error ( logger , errorMessage ) ;
4035 throw new Exception ( errorMessage ) ;
4136 }
4237 return value ;
4338 }
4439 public string GetEncryptedPropertyValue ( string propertyName , string alternativePropertyName , string defaultValue )
4540 {
46- String value = GetPropertyValue ( propertyName , alternativePropertyName , defaultValue ) ;
47- if ( ! String . IsNullOrEmpty ( value ) )
41+ string value = GetPropertyValue ( propertyName , alternativePropertyName , defaultValue ) ;
42+ if ( ! string . IsNullOrEmpty ( value ) )
4843 {
4944 try
5045 {
51- string ret = String . Empty ;
46+ string ret = string . Empty ;
5247 if ( CryptoImpl . Decrypt ( ref ret , value ) )
5348 {
5449 value = ret ;
5550 }
5651 }
5752 catch ( Exception )
5853 {
59- logger . Warn ( $ "Could not decrypt property name: { ResolvePropertyName ( propertyName ) } ") ;
54+ GXLogging . Warn ( logger , $ "Could not decrypt property name: { ResolvePropertyName ( propertyName ) } ") ;
6055 }
6156 }
6257 return value ;
6358 }
6459
6560 internal string GetPropertyValue ( string propertyName , string alternativePropertyName = null )
6661 {
67- String value = GetPropertyValue ( propertyName , alternativePropertyName , null ) ;
62+ string value = GetPropertyValue ( propertyName , alternativePropertyName , null ) ;
6863 if ( value == null )
6964 {
70- String errorMessage = String . Format ( $ "Service configuration error - Property name { ResolvePropertyName ( propertyName ) } must be defined") ;
71- logger . Fatal ( errorMessage ) ;
65+ string errorMessage = string . Format ( $ "Service configuration error - Property name { ResolvePropertyName ( propertyName ) } must be defined") ;
66+ GXLogging . Error ( logger , errorMessage ) ;
7267 throw new Exception ( errorMessage ) ;
7368 }
7469 return value ;
7570 }
7671
7772 internal string GetPropertyValue ( string propertyName , string alternativePropertyName , string defaultValue )
7873 {
79- String value = null ;
74+ string value = null ;
8075 value = string . IsNullOrEmpty ( value ) ? GetPropertyValueImpl ( ResolvePropertyName ( propertyName ) ) : value ;
8176 value = string . IsNullOrEmpty ( value ) ? GetPropertyValueImpl ( propertyName ) : value ;
8277 value = string . IsNullOrEmpty ( value ) ? GetPropertyValueImpl ( alternativePropertyName ) : value ;
@@ -86,7 +81,7 @@ internal string GetPropertyValue(string propertyName, string alternativeProperty
8681
8782 internal string GetPropertyValueImpl ( string propertyName )
8883 {
89- String value = null ;
84+ string value = null ;
9085 if ( ! string . IsNullOrEmpty ( propertyName ) )
9186 {
9287 value = Environment . GetEnvironmentVariable ( propertyName ) ;
0 commit comments