@@ -27,38 +27,57 @@ public ConnectionConfiguration(IConnectionPool connectionPool)
2727 public class ConnectionConfiguration < T > : IConnectionConfigurationValues
2828 where T : ConnectionConfiguration < T >
2929 {
30- public IConnectionPool ConnectionPool { get ; private set ; }
31- //public Uri Uri { get; private set; }
32- //public string Host { get; private set; }
33- //public int Port { get; private set; }
34- public int Timeout { get ; private set ; }
35- public int ? PingTimeout { get ; private set ; }
36- public int ? DeadTimeout { get ; private set ; }
37- public int ? MaxDeadTimeout { get ; private set ; }
38- public string ProxyUsername { get ; private set ; }
39- public string ProxyPassword { get ; private set ; }
40- public bool DisablePings { get ; private set ; }
41- public string ProxyAddress { get ; private set ; }
42- public int MaximumAsyncConnections { get ; private set ; }
43- public int ? MaxRetries { get ; private set ; }
44- public bool UsesPrettyResponses { get ; private set ; }
45- public bool SniffsOnStartup { get ; private set ; }
46- public bool SniffsOnConnectionFault { get ; private set ; }
47- public TimeSpan ? SniffInformationLifeSpan { get ; private set ; }
48- public bool TraceEnabled { get ; private set ; }
49- public Action < ElasticsearchResponse > ConnectionStatusHandler { get ; private set ; }
50- public NameValueCollection QueryStringParameters { get ; private set ; }
51- public bool UriSpecifiedBasicAuth { get ; private set ; }
30+ private IConnectionPool _connectionPool ;
31+ IConnectionPool IConnectionConfigurationValues . ConnectionPool { get { return _connectionPool ; } }
32+
33+ private int _timeout ;
34+ int IConnectionConfigurationValues . Timeout { get { return _timeout ; } }
35+ private int ? _pingTimeout ;
36+ int ? IConnectionConfigurationValues . PingTimeout { get { return _pingTimeout ; } }
37+
38+ private int ? _deadTimeout ;
39+ int ? IConnectionConfigurationValues . DeadTimeout { get { return _deadTimeout ; } }
40+ private int ? _maxDeadTimeout ;
41+ int ? IConnectionConfigurationValues . MaxDeadTimeout { get { return _maxDeadTimeout ; } }
42+ private string _proxyUsername ;
43+ string IConnectionConfigurationValues . ProxyUsername { get { return _proxyUsername ; } }
44+ private string _proxyPassword ;
45+ string IConnectionConfigurationValues . ProxyPassword { get { return _proxyPassword ; } }
46+ private bool _disablePings ;
47+ bool IConnectionConfigurationValues . DisablePings { get { return _disablePings ; } }
48+ private string _proxyAddress ;
49+ string IConnectionConfigurationValues . ProxyAddress { get { return _proxyAddress ; } }
50+
51+ private int _maximumAsyncConnections ;
52+ int IConnectionConfigurationValues . MaximumAsyncConnections { get { return _maximumAsyncConnections ; } }
53+ private int ? _maxRetries ;
54+ int ? IConnectionConfigurationValues . MaxRetries { get { return _maxRetries ; } }
55+ private bool _usePrettyResponses ;
56+ bool IConnectionConfigurationValues . UsesPrettyResponses { get { return _usePrettyResponses ; } }
57+ private bool _sniffOnStartup ;
58+ bool IConnectionConfigurationValues . SniffsOnStartup { get { return _sniffOnStartup ; } }
59+ private bool _sniffOnConectionFault ;
60+ bool IConnectionConfigurationValues . SniffsOnConnectionFault { get { return _sniffOnConectionFault ; } }
61+ private TimeSpan ? _sniffLifeSpan ;
62+ TimeSpan ? IConnectionConfigurationValues . SniffInformationLifeSpan { get { return _sniffLifeSpan ; } }
63+ private bool _traceEnabled ;
64+ bool IConnectionConfigurationValues . TraceEnabled { get { return _traceEnabled ; } }
65+ private Action < ElasticsearchResponse > _connectionStatusHandler ;
66+ Action < ElasticsearchResponse > IConnectionConfigurationValues . ConnectionStatusHandler { get { return _connectionStatusHandler ; } }
67+ private NameValueCollection _queryString ;
68+ NameValueCollection IConnectionConfigurationValues . QueryStringParameters { get { return _queryString ; } }
69+
70+
5271 IElasticsearchSerializer IConnectionConfigurationValues . Serializer { get ; set ; }
5372
5473 public ConnectionConfiguration ( IConnectionPool connectionPool )
5574 {
56- this . Timeout = 60 * 1000 ;
75+ this . _timeout = 60 * 1000 ;
5776 //this.UriSpecifiedBasicAuth = !uri.UserInfo.IsNullOrEmpty();
5877 //this.Uri = uri;
59- this . ConnectionStatusHandler = this . ConnectionStatusDefaultHandler ;
60- this . MaximumAsyncConnections = 0 ;
61- this . ConnectionPool = connectionPool ;
78+ this . _connectionStatusHandler = this . ConnectionStatusDefaultHandler ;
79+ this . _maximumAsyncConnections = 0 ;
80+ this . _connectionPool = connectionPool ;
6281 }
6382
6483 public ConnectionConfiguration ( Uri uri = null )
@@ -68,25 +87,25 @@ public ConnectionConfiguration(Uri uri = null)
6887 //this.Port = uri.Port;
6988 }
7089
71- public T SetMaxRetries ( int maxRetries )
90+ public T MaximumRetries ( int maxRetries )
7291 {
73- this . MaxRetries = maxRetries ;
92+ this . _maxRetries = maxRetries ;
7493 return ( T ) this ;
7594 }
7695
77- public T SnifsOnConnectionFault ( bool sniffsOnConnectionFault = true )
96+ public T SniffOnConnectionFault ( bool sniffsOnConnectionFault = true )
7897 {
79- this . SniffsOnConnectionFault = sniffsOnConnectionFault ;
98+ this . _sniffOnConectionFault = sniffsOnConnectionFault ;
8099 return ( T ) this ;
81100 }
82101 public T SniffOnStartup ( bool sniffsOnStartup = true )
83102 {
84- this . SniffsOnStartup = sniffsOnStartup ;
103+ this . _sniffOnStartup = sniffsOnStartup ;
85104 return ( T ) this ;
86105 }
87106 public T SniffLifeSpan ( TimeSpan sniffTimeSpan )
88107 {
89- this . SniffInformationLifeSpan = sniffTimeSpan ;
108+ this . _sniffLifeSpan = sniffTimeSpan ;
90109 return ( T ) this ;
91110 }
92111
@@ -95,7 +114,7 @@ public T SniffLifeSpan(TimeSpan sniffTimeSpan)
95114 /// </summary>
96115 public T EnableTrace ( bool enabled = true )
97116 {
98- this . TraceEnabled = enabled ;
117+ this . _traceEnabled = enabled ;
99118 return ( T ) this ;
100119 }
101120
@@ -106,19 +125,19 @@ public T EnableTrace(bool enabled = true)
106125 /// </summary>
107126 public T DisablePing ( bool disable = true )
108127 {
109- this . DisablePings = disable ;
128+ this . _disablePings = disable ;
110129 return ( T ) this ;
111130 }
112131 /// <summary>
113132 /// This NameValueCollection will be appended to every url NEST calls, great if you need to pass i.e an API key.
114133 /// </summary>
115134 public T SetGlobalQueryStringParameters ( NameValueCollection queryStringParameters )
116135 {
117- if ( this . QueryStringParameters != null )
136+ if ( this . _queryString != null )
118137 {
119- this . QueryStringParameters . Add ( queryStringParameters ) ;
138+ this . _queryString . Add ( queryStringParameters ) ;
120139 }
121- this . QueryStringParameters = queryStringParameters ;
140+ this . _queryString = queryStringParameters ;
122141 return ( T ) this ;
123142 }
124143
@@ -129,7 +148,7 @@ public T SetGlobalQueryStringParameters(NameValueCollection queryStringParameter
129148 /// <param name="timeout">time out in milliseconds</param>
130149 public T SetTimeout ( int timeout )
131150 {
132- this . Timeout = timeout ;
151+ this . _timeout = timeout ;
133152 return ( T ) this ;
134153 }
135154
@@ -139,7 +158,7 @@ public T SetTimeout(int timeout)
139158 /// <param name="timeout">The ping timeout in milliseconds defaults to 50</param>
140159 public T SetPingTimeout ( int timeout )
141160 {
142- this . PingTimeout = timeout ;
161+ this . _pingTimeout = timeout ;
143162 return ( T ) this ;
144163 }
145164
@@ -150,7 +169,7 @@ public T SetPingTimeout(int timeout)
150169 /// <param name="timeout"></param>
151170 public T SetDeadTimeout ( int timeout )
152171 {
153- this . DeadTimeout = timeout ;
172+ this . _deadTimeout = timeout ;
154173 return ( T ) this ;
155174 }
156175
@@ -161,7 +180,7 @@ public T SetDeadTimeout(int timeout)
161180 /// <param name="timeout">The timeout in milliseconds</param>
162181 public T SetMaxDeadTimeout ( int timeout )
163182 {
164- this . MaxDeadTimeout = timeout ;
183+ this . _maxDeadTimeout = timeout ;
165184 return ( T ) this ;
166185 }
167186 /// <summary>
@@ -171,7 +190,7 @@ public T SetMaxDeadTimeout(int timeout)
171190 /// <param name="maximum">defaults to 0 (unbounded)</param>
172191 public T SetMaximumAsyncConnections ( int maximum )
173192 {
174- this . MaximumAsyncConnections = maximum ;
193+ this . _maximumAsyncConnections = maximum ;
175194 return ( T ) this ;
176195 }
177196
@@ -181,9 +200,9 @@ public T SetMaximumAsyncConnections(int maximum)
181200 public T SetProxy ( Uri proxyAdress , string username , string password )
182201 {
183202 proxyAdress . ThrowIfNull ( "proxyAdress" ) ;
184- this . ProxyAddress = proxyAdress . ToString ( ) ;
185- this . ProxyUsername = username ;
186- this . ProxyPassword = password ;
203+ this . _proxyAddress = proxyAdress . ToString ( ) ;
204+ this . _proxyUsername = username ;
205+ this . _proxyPassword = password ;
187206 return ( T ) this ;
188207 }
189208
@@ -192,7 +211,7 @@ public T SetProxy(Uri proxyAdress, string username, string password)
192211 /// </summary>
193212 public T UsePrettyResponses ( bool b = true )
194213 {
195- this . UsesPrettyResponses = b ;
214+ this . _usePrettyResponses = b ;
196215 this . SetGlobalQueryStringParameters ( new NameValueCollection { { "pretty" , b . ToString ( ) . ToLowerInvariant ( ) } } ) ;
197216 return ( T ) this ;
198217 }
@@ -208,7 +227,7 @@ protected void ConnectionStatusDefaultHandler(ElasticsearchResponse status)
208227 public T SetConnectionStatusHandler ( Action < ElasticsearchResponse > handler )
209228 {
210229 handler . ThrowIfNull ( "handler" ) ;
211- this . ConnectionStatusHandler = handler ;
230+ this . _connectionStatusHandler = handler ;
212231 return ( T ) this ;
213232 }
214233 }
0 commit comments