public class CommonClientBuilder extends Object
| Constructor and Description |
|---|
CommonClientBuilder() |
| Modifier and Type | Method and Description |
|---|---|
CommonClientBuilder |
asUser(String user,
String pwd)
Set HTTP basic auth credentials.
|
CommonClientBuilder |
defaultHttp()
If no protocol is provided on a host string, default to http://
|
CommonClientBuilder |
defaultHttps()
If no protocol is provided on a host string, default to https://
|
CommonClientBuilder |
defaultHttps(boolean https)
If no protocol is provided on a host string, default to https:// if true,
http:// if false.
|
CommonClientBuilder |
forgetHosts()
Clear any hosts the builder already knows about.
|
Clock |
getClock() |
HttpHelper.Credentials |
getCredentials() |
boolean |
getDefaultHttps() |
List<String> |
getHosts() |
org.slf4j.Logger |
getLog() |
Proxy |
getProxy() |
String |
getProxyHost() |
int |
getProxyPort() |
long |
getSocketWaitMs() |
String |
getTopic() |
boolean |
isProxied() |
CommonClientBuilder |
logTo(org.slf4j.Logger log)
Specify the log to use.
|
CommonClientBuilder |
onTopic(String topic)
Specify the topic to publish to.
|
CommonClientBuilder |
socketWaitAtMost(long ms)
Specify the amount of time to wait on a socket connection, read, or write.
|
CommonClientBuilder |
usingProxy(String proxy)
Specify a proxy to use for the HTTP connection to Message Router.
|
CommonClientBuilder |
usingProxy(String host,
int port)
Specify a proxy to use for the HTTP connection to Message Router.
|
CommonClientBuilder |
waitingAtMost(long ms)
Deprecated.
Use socketWaitAtMost
|
CommonClientBuilder |
withApiKey(String apiKey,
String apiSecret)
Set an API key and secret.
|
CommonClientBuilder |
withClock(Clock clock)
Specify a clock to use within this implementation.
|
CommonClientBuilder |
withHost(String host)
Add a host to the set the publisher can use.
|
CommonClientBuilder |
withHosts(Collection<String> hosts)
Add each host to the host list.
|
CommonClientBuilder |
withHosts(String[] hosts)
Add each host to the host list.
|
public CommonClientBuilder withHost(String host)
host - the host to add to the host setpublic CommonClientBuilder withHosts(Collection<String> hosts)
hosts - a collection of hosts to add to the host setpublic CommonClientBuilder withHosts(String[] hosts)
hosts - a collection of hosts to add to the host setpublic CommonClientBuilder forgetHosts()
public CommonClientBuilder defaultHttp()
public CommonClientBuilder defaultHttps()
public CommonClientBuilder defaultHttps(boolean https)
https - if true, use https. if false, use httppublic CommonClientBuilder usingProxy(String proxy)
proxy - a proxy string, which can optionally end in :port, e.g. proxy.example.com:8888public CommonClientBuilder usingProxy(String host, int port)
host - a proxy host nameport - a port numberpublic CommonClientBuilder onTopic(String topic)
topic - the topic on which to post messagespublic CommonClientBuilder asUser(String user, String pwd)
user - the username for basic auth credentialspwd - the password for basic auth credentialspublic CommonClientBuilder withApiKey(String apiKey, String apiSecret)
apiKey - the API key for the userapiSecret - the API key's secret@Deprecated public CommonClientBuilder waitingAtMost(long ms)
ms - the number of milliseconds to wait for a socket operation (connect/read/write)public CommonClientBuilder socketWaitAtMost(long ms)
ms - the number of milliseconds to wait for a socket operation (connect/read/write)public CommonClientBuilder logTo(org.slf4j.Logger log)
log - the slf4j logger to use for this library. Do not pass null.public CommonClientBuilder withClock(Clock clock)
clock - the clock to use for timingpublic boolean getDefaultHttps()
public boolean isProxied()
public String getProxyHost()
public int getProxyPort()
public Proxy getProxy()
public String getTopic()
public long getSocketWaitMs()
public org.slf4j.Logger getLog()
public HttpHelper.Credentials getCredentials()
public Clock getClock()
Copyright © 2024 continual.io. All rights reserved.