-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathIConnectionConfiguration.cs
60 lines (49 loc) · 1.97 KB
/
IConnectionConfiguration.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
using System.Collections.Specialized;
namespace Elasticsearch.Net.Connection
{
public interface IConnectionConfiguration :
IConnectionConfiguration<IConnectionConfiguration>
{
}
public interface IConnectionConfiguration<out T> where T : IConnectionConfiguration<T>
{
/// <summary>
/// Enable Trace signals to the IConnection that it should put debug information on the Trace.
/// </summary>
T EnableTrace(bool enabled = true);
/// <summary>
/// This NameValueCollection will be appended to every url NEST calls, great if you need to pass i.e an API key.
/// </summary>
/// <param name="queryStringParameters"></param>
/// <returns></returns>
T SetGlobalQueryStringParameters(NameValueCollection queryStringParameters); /// <summary>
/// Timeout in milliseconds when the .NET webrequest should abort the request, note that you can set this to a high value here,
/// and specify the timeout in various calls on Elasticsearch's side.
/// </summary>
/// <param name="timeout">time out in milliseconds</param>
T SetTimeout(int timeout);
/// <summary>
/// If your connection has to go through proxy use this method to specify the proxy url
/// </summary>
/// <returns></returns>
T SetProxy(Uri proxyAdress, string username, string password);
/// <summary>
/// Append ?pretty=true to requests, this helps to debug send and received json.
/// </summary>
/// <returns></returns>
T UsePrettyResponses(bool b = true);
/// <summary>
/// Semaphore asynchronous connections automatically by giving
/// it a maximum concurrent connections. Great to prevent
/// out of memory exceptions
/// </summary>
/// <param name="maximum">defaults to 20</param>
/// <returns></returns>
T SetMaximumAsyncConnections(int maximum);
/// <summary>
/// Global callback for every response that NEST receives, useful for custom logging.
/// </summary>
T SetConnectionStatusHandler(Action<ElasticsearchResponse> handler);
}
}