public class DataGateClient
extends java.lang.Object
Represents a DataGate server client for synchronous access.
Constructor and Description |
---|
DataGateClient(java.lang.String serverBaseUrl)
Instantiates a new
DataGateClient . |
Modifier and Type | Method and Description |
---|---|
DataGateClient |
connectTimeout(long milliseconds)
Sets the connection timeout for the underlying http client.
|
protected okhttp3.OkHttpClient |
getHttpClient()
Gets the underlying http client for the server-client communication.
|
protected java.lang.String |
getServerBaseUrl()
Gets the server base url.
|
DataGateClient |
readTimeout(long milliseconds)
Sets the read timeout for the underlying http client.
|
DataGateClient |
trustAllCerts()
Trust all certificates.
|
DataGateClient |
withAuth(java.lang.String username,
java.lang.String password)
Sets user credentials for basic authentication.
|
DataGateClient |
withProxy(java.net.Proxy proxy)
Sets the proxy details to connect to DataGate server.
|
DataGateClient |
withUserAgent(UserAgent userAgent)
Sets the
UserAgent details. |
public DataGateClient(java.lang.String serverBaseUrl)
Instantiates a new DataGateClient
.
serverBaseUrl
- the server base urlpublic DataGateClient withAuth(java.lang.String username, java.lang.String password)
Sets user credentials for basic authentication.
username
- the usernamepassword
- the passwordDataGateClient
public DataGateClient withProxy(java.net.Proxy proxy)
Sets the proxy details to connect to DataGate server.
proxy
- the proxyDataGateClient
public DataGateClient trustAllCerts()
Trust all certificates.
DataGateClient
public DataGateClient readTimeout(long milliseconds)
Sets the read timeout for the underlying http client.
milliseconds
- the timeout value in millisecondsDataGateClient
public DataGateClient connectTimeout(long milliseconds)
Sets the connection timeout for the underlying http client.
milliseconds
- the timeout value in millisecondsDataGateClient
public DataGateClient withUserAgent(UserAgent userAgent)
Sets the UserAgent
details. The user agent details
helps to generate several analytics in DataGate server.
userAgent
- the UserAgent
DataGateClient
protected java.lang.String getServerBaseUrl()
Gets the server base url.
protected okhttp3.OkHttpClient getHttpClient()
Gets the underlying http client for the server-client communication.