public class DataSiftConfig
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
apiKey |
protected boolean |
compatibleSSLProtocolsFound |
protected int |
connectTimeout |
protected java.lang.String |
host |
protected io.higgs.http.client.HttpRequestBuilder |
http
This instance should be used as a base for configurations.
|
protected java.lang.String |
ingestionHost |
protected boolean |
manualPort |
protected int |
port |
protected boolean |
sslEnabled |
protected java.util.List<java.lang.String> |
sslProtocols |
protected java.lang.String |
urlEncodingFormat |
protected java.lang.String |
username |
protected java.lang.String |
versionPrefix |
protected java.lang.String |
wsHost |
| Constructor and Description |
|---|
DataSiftConfig() |
DataSiftConfig(java.lang.String username,
java.lang.String apiKey)
Initialize a new config instance with the given username and api key
|
| Modifier and Type | Method and Description |
|---|---|
DataSiftConfig |
auth(java.lang.String username,
java.lang.String apiKey)
Provide the user credentials that should be used for authentication
|
java.lang.String |
authAsHeader() |
java.net.URI |
baseIngestionURL() |
java.net.URI |
baseURL() |
boolean |
compatibleSSLProtocolsFound() |
int |
connectTimeout() |
void |
connectTimeout(int connectTimeout) |
java.lang.String |
getApiKey() |
java.lang.String |
getClientVersion() |
java.lang.String |
getUsername() |
java.lang.String |
host() |
DataSiftConfig |
host(java.lang.String host) |
io.higgs.http.client.HttpRequestBuilder |
http() |
java.lang.String |
ingestionHost() |
DataSiftConfig |
ingestionHost(java.lang.String host) |
boolean |
isAutoReconnect() |
boolean |
isSslEnabled() |
java.net.URI |
newAPIEndpointURI(java.lang.String endpoint)
Generate a new URI object given an endpoint relative to the base url of this configuration.
|
java.net.URI |
newAPIEndpointURI(java.net.URI endpoint)
Generate a new URI object given an endpoint relative to the base url of this configuration.
|
java.net.URI |
newIngestionAPIEndpointURI(java.lang.String endpoint)
Generate a new URI object given an endpoint relative to the base ingestion url of this configuration.
|
java.net.URI |
newIngestionAPIEndpointURI(java.net.URI endpoint)
Generate a new URI object given an endpoint relative to the base ingestion url of this configuration.
|
int |
port() |
void |
port(int p) |
java.lang.String |
protocol() |
DataSiftConfig |
proxy(java.lang.String host,
int port)
Sets a host and port for a proxy that all requests should be sent to
|
DataSiftConfig |
proxy(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password) |
void |
setAutoReconnect(boolean autoReconnect)
Sets whether streams are automatically reconnected when a websocket connection is closed
|
void |
setSslEnabled(boolean sslEnabled) |
java.lang.String[] |
sslProtocols()
Gets an array of compatible SSL protocols found on this JVM
|
java.lang.String |
urlEncodingFormat() |
DataSiftConfig |
urlEncodingFormat(java.lang.String format)
Sets the format that should be used to encode URL parameters when the option arises
e.g.
|
java.lang.String |
versionPrefix() |
DataSiftConfig |
versionPrefix(java.lang.String prefix)
Force the client to use a version other than the default.
|
java.lang.String |
wsHost() |
DataSiftConfig |
wsHost(java.lang.String host) |
protected boolean compatibleSSLProtocolsFound
protected java.util.List<java.lang.String> sslProtocols
protected java.lang.String username
protected java.lang.String apiKey
protected boolean sslEnabled
protected java.lang.String host
protected java.lang.String wsHost
protected java.lang.String ingestionHost
protected io.higgs.http.client.HttpRequestBuilder http
HttpRequestBuilder.copy()
Although a single instance would work, this keeps things simple and ensures no stale data is passed in
subsequent requests.
It is also very cheap in terms of Netty's thread usage because Higgs re-uses the same event loop group
so it'll never be creating a whole new load of resources for each instance.protected java.lang.String versionPrefix
protected java.lang.String urlEncodingFormat
protected int port
protected boolean manualPort
protected int connectTimeout
public DataSiftConfig()
public DataSiftConfig(java.lang.String username,
java.lang.String apiKey)
username - the DataSift usernameapiKey - the DataSift API keypublic DataSiftConfig auth(java.lang.String username, java.lang.String apiKey)
username - the DataSift usernameapiKey - the DataSift API keypublic DataSiftConfig proxy(java.lang.String host, int port)
host - proxy hostport - proxy portpublic DataSiftConfig proxy(java.lang.String host, int port, java.lang.String username, java.lang.String password)
username - the username the proxy requirespassword - the password the proxy requirespublic java.lang.String protocol()
public DataSiftConfig host(java.lang.String host)
public java.lang.String host()
public DataSiftConfig wsHost(java.lang.String host)
public java.lang.String wsHost()
public DataSiftConfig ingestionHost(java.lang.String host)
public java.lang.String ingestionHost()
public int port()
public void port(int p)
public java.net.URI baseURL()
public java.net.URI baseIngestionURL()
public java.net.URI newAPIEndpointURI(java.lang.String endpoint)
URI.resolve(String) is acceptableendpoint - the endpoint to return a URI for.public java.net.URI newAPIEndpointURI(java.net.URI endpoint)
URI.resolve(URI) is acceptableendpoint - the endpoint to return a URI for.public java.net.URI newIngestionAPIEndpointURI(java.lang.String endpoint)
URI.resolve(String) is acceptableendpoint - the endpoint to return a URI for.public java.net.URI newIngestionAPIEndpointURI(java.net.URI endpoint)
URI.resolve(String) is acceptableendpoint - the endpoint to return a URI for.public java.lang.String versionPrefix()
public DataSiftConfig versionPrefix(java.lang.String prefix)
prefix - the prefix to use, this should be along the lines of v1.3 i.e. vMajor.Minorpublic java.lang.String getUsername()
public java.lang.String getApiKey()
public boolean isSslEnabled()
public void setSslEnabled(boolean sslEnabled)
public java.lang.String authAsHeader()
public io.higgs.http.client.HttpRequestBuilder http()
public java.lang.String urlEncodingFormat()
public DataSiftConfig urlEncodingFormat(java.lang.String format)
format - the formatpublic boolean isAutoReconnect()
public void setAutoReconnect(boolean autoReconnect)
autoReconnect - true or false, defaults to truepublic java.lang.String[] sslProtocols()
public boolean compatibleSSLProtocolsFound()
public int connectTimeout()
public void connectTimeout(int connectTimeout)
public java.lang.String getClientVersion()
Copyright © 2017. All Rights Reserved.