public static class OnapMsgRouterSubscriber.Builder extends CommonClientBuilder
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_RECV_LIMIT |
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
OnapMsgRouterSubscriber.Builder |
asUser(String user,
String pwd)
Set HTTP basic auth credentials.
|
OnapMsgRouterSubscriber |
build()
Build the subscriber given this specification.
|
OnapMsgRouterSubscriber.Builder |
defaultHttp()
If no protocol is provided on a host string, default to http://
|
OnapMsgRouterSubscriber.Builder |
defaultHttps()
If no protocol is provided on a host string, default to https://
|
OnapMsgRouterSubscriber.Builder |
defaultHttps(boolean https)
If no protocol is provided on a host string, default to https:// if true,
http:// if false.
|
OnapMsgRouterSubscriber.Builder |
forgetHosts()
Clear any hosts the builder already knows about.
|
OnapMsgRouterSubscriber.Builder |
inGroup(String group)
Specify the subscriber group that this subscriber belongs to.
|
OnapMsgRouterSubscriber.Builder |
logTo(org.slf4j.Logger log)
Specify the log to use.
|
OnapMsgRouterSubscriber.Builder |
noRecvLimit()
Do not specify a maximum number of events to return on a fetch, allowing the
server to determine the number to send.
|
OnapMsgRouterSubscriber.Builder |
onTopic(String topic)
Specify the topic to publish to.
|
OnapMsgRouterSubscriber.Builder |
parseWith(JsonResponseParser p)
Provide a response parser.
|
OnapMsgRouterSubscriber.Builder |
recvAtMostEvents(int eventCount)
Specify the maximum number of events to return on a fetch.
|
OnapMsgRouterSubscriber.Builder |
socketWaitAtMost(long ms)
Specify the amount of time to wait on a socket connection, read, or write.
|
OnapMsgRouterSubscriber.Builder |
usingProxy(String proxy)
Specify a proxy to use for the HTTP connection to Message Router.
|
OnapMsgRouterSubscriber.Builder |
usingProxy(String host,
int port)
Specify a proxy to use for the HTTP connection to Message Router.
|
OnapMsgRouterSubscriber.Builder |
waitAtServerAtMost(long ms)
Specify the amount of time to wait at the server for messages.
|
OnapMsgRouterSubscriber.Builder |
withApiKey(String apiKey,
String apiSecret)
Set an API key and secret.
|
OnapMsgRouterSubscriber.Builder |
withClock(Clock clock)
Specify a clock to use within this implementation.
|
OnapMsgRouterSubscriber.Builder |
withHost(String host)
Add a host to the set the publisher can use.
|
OnapMsgRouterSubscriber.Builder |
withHosts(Collection<String> hosts)
Add each host to the host list.
|
OnapMsgRouterSubscriber.Builder |
withHosts(String[] hosts)
Add each host to the host list.
|
OnapMsgRouterSubscriber.Builder |
withSubscriberId(String id)
Specify the subscriber id for this subscriber.
|
getClock, getCredentials, getDefaultHttps, getHosts, getLog, getProxy, getProxyHost, getProxyPort, getSocketWaitMs, getTopic, isProxied, waitingAtMostpublic static final int NO_RECV_LIMIT
public OnapMsgRouterSubscriber.Builder withHost(String host)
withHost in class CommonClientBuilderhost - the host to add to the host setpublic OnapMsgRouterSubscriber.Builder withHosts(Collection<String> hosts)
withHosts in class CommonClientBuilderhosts - a collection of hosts to add to the host setpublic OnapMsgRouterSubscriber.Builder withHosts(String[] hosts)
withHosts in class CommonClientBuilderhosts - a collection of hosts to add to the host setpublic OnapMsgRouterSubscriber.Builder forgetHosts()
forgetHosts in class CommonClientBuilderpublic OnapMsgRouterSubscriber.Builder onTopic(String topic)
onTopic in class CommonClientBuildertopic - the topic on which to post messagespublic OnapMsgRouterSubscriber.Builder inGroup(String group)
group - the subscriber group namepublic OnapMsgRouterSubscriber.Builder withSubscriberId(String id)
id - the unique subscriber ID in the grouppublic OnapMsgRouterSubscriber.Builder waitAtServerAtMost(long ms)
ms - the number of milliseconds to wait at the server for messages.public OnapMsgRouterSubscriber.Builder recvAtMostEvents(int eventCount)
eventCount - the number of events to return at mostpublic OnapMsgRouterSubscriber.Builder logTo(org.slf4j.Logger log)
logTo in class CommonClientBuilderlog - the slf4j logger to use for this library. Do not pass null.public OnapMsgRouterSubscriber.Builder noRecvLimit()
public OnapMsgRouterSubscriber.Builder socketWaitAtMost(long ms)
socketWaitAtMost in class CommonClientBuilderms - the number of milliseconds to wait for a socket operation (connect/read/write)public OnapMsgRouterSubscriber.Builder asUser(String user, String pwd)
asUser in class CommonClientBuilderuser - the username for basic auth credentialspwd - the password for basic auth credentialspublic OnapMsgRouterSubscriber.Builder withApiKey(String apiKey, String apiSecret)
withApiKey in class CommonClientBuilderapiKey - the API key for the userapiSecret - the API key's secretpublic OnapMsgRouterSubscriber.Builder defaultHttp()
defaultHttp in class CommonClientBuilderpublic OnapMsgRouterSubscriber.Builder defaultHttps()
defaultHttps in class CommonClientBuilderpublic OnapMsgRouterSubscriber.Builder defaultHttps(boolean https)
defaultHttps in class CommonClientBuilderhttps - if true, use https. if false, use httppublic OnapMsgRouterSubscriber.Builder withClock(Clock clock)
withClock in class CommonClientBuilderclock - the clock to use for timingpublic OnapMsgRouterSubscriber.Builder usingProxy(String proxy)
usingProxy in class CommonClientBuilderproxy - a proxy string, which can optionally end in :port, e.g. proxy.example.com:8888public OnapMsgRouterSubscriber.Builder usingProxy(String host, int port)
usingProxy in class CommonClientBuilderhost - a proxy host nameport - a port numberpublic OnapMsgRouterSubscriber.Builder parseWith(JsonResponseParser p)
p - the reponse parserpublic OnapMsgRouterSubscriber build()
Copyright © 2023 continual.io. All rights reserved.