public class NetworkConfiguration extends Object implements com.snowplowanalytics.snowplow.internal.emitter.NetworkConfigurationInterface, Configuration
| Modifier and Type | Field and Description |
|---|---|
String |
customPostPath |
NetworkConnection |
networkConnection |
okhttp3.OkHttpClient |
okHttpClient |
Integer |
timeout |
| Constructor and Description |
|---|
NetworkConfiguration(JSONObject jsonObject) |
NetworkConfiguration(NetworkConnection networkConnection) |
NetworkConfiguration(String endpoint) |
NetworkConfiguration(String endpoint,
HttpMethod method) |
| Modifier and Type | Method and Description |
|---|---|
Configuration |
copy() |
NetworkConfiguration |
customPostPath(String customPostPath)
A custom path which will be added to the endpoint URL to specify the
complete URL of the collector when paired with the POST method.
|
String |
getCustomPostPath() |
String |
getEndpoint() |
HttpMethod |
getMethod() |
NetworkConnection |
getNetworkConnection() |
okhttp3.OkHttpClient |
getOkHttpClient() |
Protocol |
getProtocol() |
Integer |
getTimeout() |
NetworkConfiguration |
okHttpClient(okhttp3.OkHttpClient okHttpClient)
An OkHttp client that will be used in the emitter, you can provide your
own if you want to share your Singleton client's interceptors, connection pool etc..
|
NetworkConfiguration |
timeout(Integer timeout)
The timeout set for the requests to the collector.
|
@Nullable public NetworkConnection networkConnection
NetworkConfiguration(NetworkConnection)@Nullable public String customPostPath
customPostPath(String)@Nullable public Integer timeout
timeout(Integer)@Nullable public okhttp3.OkHttpClient okHttpClient
okHttpClient(OkHttpClient)public NetworkConfiguration(@NonNull
String endpoint)
endpoint - URL of the collector that is going to receive the events tracked by the tracker.
The URL can include the schema/protocol (e.g.: `http://collector-url.com`).
In case the URL doesn't include the schema/protocol, the HTTPS protocol is
automatically selected.public NetworkConfiguration(@NonNull
String endpoint,
@NonNull
HttpMethod method)
endpoint - URL of the collector that is going to receive the events tracked by the tracker.
The URL can include the schema/protocol (e.g.: `http://collector-url.com`).
In case the URL doesn't include the schema/protocol, the HTTPS protocol is
automatically selected.method - The method used to send the requests (GET or POST).public NetworkConfiguration(@NonNull
NetworkConnection networkConnection)
networkConnection - The NetworkConnection component which will control the
communication between the tracker and the collector.public NetworkConfiguration(@NonNull
JSONObject jsonObject)
@Nullable public String getEndpoint()
getEndpoint in interface com.snowplowanalytics.snowplow.internal.emitter.NetworkConfigurationInterface@Nullable public HttpMethod getMethod()
getMethod in interface com.snowplowanalytics.snowplow.internal.emitter.NetworkConfigurationInterface@Nullable public Protocol getProtocol()
getProtocol in interface com.snowplowanalytics.snowplow.internal.emitter.NetworkConfigurationInterface@Nullable public String getCustomPostPath()
getCustomPostPath in interface com.snowplowanalytics.snowplow.internal.emitter.NetworkConfigurationInterface@Nullable public Integer getTimeout()
getTimeout in interface com.snowplowanalytics.snowplow.internal.emitter.NetworkConfigurationInterface@Nullable public NetworkConnection getNetworkConnection()
getNetworkConnection in interface com.snowplowanalytics.snowplow.internal.emitter.NetworkConfigurationInterface@Nullable public okhttp3.OkHttpClient getOkHttpClient()
getOkHttpClient in interface com.snowplowanalytics.snowplow.internal.emitter.NetworkConfigurationInterface@NonNull public NetworkConfiguration customPostPath(@NonNull String customPostPath)
@NonNull public NetworkConfiguration timeout(@NonNull Integer timeout)
@NonNull public NetworkConfiguration okHttpClient(@NonNull okhttp3.OkHttpClient okHttpClient)
@NonNull public Configuration copy()
copy in interface Configuration