E - the entity type to postpublic class TheonClient<E extends Serializable> extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TheonClient.TheonMessage<E extends Serializable>
Encapsulates a theon message with topic and key
|
static class |
TheonClient.TheonStatus
Theon event enum
|
| Constructor and Description |
|---|
TheonClient()
The default one
|
TheonClient(String theonUrl,
String username,
String password)
With url and credentials
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Stop the bulk util and close the http client
|
long |
getBigQueueTimerInterval() |
int |
getBulkMessageSize() |
BulkOperationUtil.BulkOperation<TheonClient.TheonMessage<E>> |
getBulkOperation() |
BulkOperationUtil<TheonClient.TheonMessage<E>> |
getBulkOperationUtil() |
int |
getBulkPollIntervalSecs() |
Charset |
getCharset() |
String |
getDefaultKey() |
org.apache.http.impl.client.CloseableHttpClient |
getHttpClient() |
int |
getHttpConnPoolSize() |
int |
getMaxPostEntitySize() |
BulkOperationUtil<TheonClient.TheonMessage<E>> |
getParallelBulkOperationUtil() |
String |
getPassword() |
int |
getQueueCapacity() |
String |
getQueueDir() |
String |
getQueueName() |
org.apache.http.client.config.RequestConfig |
getRequestConfig() |
EnumCounter<TheonClient.TheonStatus> |
getTheonCounter() |
URI |
getTheonUri() |
String |
getTheonUrl() |
String |
getUsername() |
void |
init()
Initialized the bulk util and the http client
|
boolean |
isCertValidationDisabled() |
boolean |
isFileBasedQueue() |
boolean |
isGzipEnabled() |
boolean |
isInitialized() |
boolean |
isParallelEnabled() |
boolean |
isPeekEnabled() |
boolean |
isPostPerKey() |
boolean |
isStringType() |
boolean |
isWaitEnabled() |
void |
postMessage(String topic,
String key,
E message)
Add the message to the bulk queue
|
void |
postMessage(String topic,
String key,
E message,
boolean parallel)
Add the message to the bulk queue
|
void |
postMessageNow(String topic,
String key,
E message)
Post the given message now
|
void |
postMessagesNow(String topic,
String key,
E... messages)
Post all the given messages now for the given key
|
boolean |
postMessagesNow(String topic,
String key,
List<E> messages)
Post the given list of messages now for specific key
|
boolean |
postMessagesNow(String topic,
String defaultKey,
Map<String,List<E>> messagesMap)
Post the given list of messages now
|
void |
setBigQueueTimerInterval(long bigQueueTimerInterval) |
void |
setBulkMessageSize(int bulkMessageSize) |
void |
setBulkPollIntervalSecs(int bulkPollIntervalSecs) |
void |
setCertValidationDisabled(boolean certValidationDisabled) |
void |
setCharset(Charset charset) |
void |
setDefaultKey(String defaultKey) |
void |
setFileBasedQueue(boolean fileBasedQueue) |
void |
setGzipEnabled(boolean gzipEnabled) |
void |
setHttpConnPoolSize(int httpConnPoolSize) |
void |
setMaxPostEntitySize(int maxPostEntitySize) |
void |
setParallelEnabled(boolean parallelEnabled) |
void |
setPassword(String password) |
void |
setPeekEnabled(boolean peekEnabled) |
void |
setPostPerKey(boolean postPerKey) |
void |
setQueueCapacity(int queueCapacity) |
void |
setQueueDir(String queueDir) |
void |
setQueueName(String queueName) |
void |
setStringType(boolean stringType) |
void |
setTheonUrl(String theonUrl) |
void |
setUsername(String username) |
@PostConstruct public void init() throws URISyntaxException
URISyntaxException - if invalid theon url@PreDestroy public void destroy()
public boolean postMessagesNow(String topic, String defaultKey, Map<String,List<E>> messagesMap)
topic - the topicdefaultKey - the defaultKeymessagesMap - the key messages mappublic void postMessagesNow(String topic, String key, E... messages)
topic - the topickey - the keymessages - the messagespublic boolean postMessagesNow(String topic, String key, List<E> messages)
topic - the topickey - the keymessages - the message listpublic void postMessageNow(String topic, String key, E message)
topic - the topickey - the keymessage - the messagepublic void postMessage(String topic, String key, E message)
topic - the topickey - the keymessage - the messagepublic void postMessage(String topic, String key, E message, boolean parallel)
topic - the topickey - the keymessage - the messageparallel - is message posted to parallel bulk op / notpublic String getTheonUrl()
public void setTheonUrl(String theonUrl)
theonUrl - the theonUrl to setpublic Charset getCharset()
public void setCharset(Charset charset)
charset - the charset to setpublic boolean isWaitEnabled()
public org.apache.http.client.config.RequestConfig getRequestConfig()
public URI getTheonUri()
public String getUsername()
public void setUsername(String username)
username - the username to setpublic String getPassword()
public void setPassword(String password)
password - the password to setpublic int getBulkPollIntervalSecs()
public void setBulkPollIntervalSecs(int bulkPollIntervalSecs)
bulkPollIntervalSecs - the bulkPollIntervalSecs to setpublic int getQueueCapacity()
public void setQueueCapacity(int queueCapacity)
queueCapacity - the queueCapacity to setpublic int getMaxPostEntitySize()
public void setMaxPostEntitySize(int maxPostEntitySize)
maxPostEntitySize - the maxPostEntitySize to setpublic BulkOperationUtil<TheonClient.TheonMessage<E>> getBulkOperationUtil()
public BulkOperationUtil.BulkOperation<TheonClient.TheonMessage<E>> getBulkOperation()
public BulkOperationUtil<TheonClient.TheonMessage<E>> getParallelBulkOperationUtil()
public boolean isFileBasedQueue()
public void setFileBasedQueue(boolean fileBasedQueue)
fileBasedQueue - the fileBasedQueue to setpublic org.apache.http.impl.client.CloseableHttpClient getHttpClient()
public boolean isInitialized()
public EnumCounter<TheonClient.TheonStatus> getTheonCounter()
public int getHttpConnPoolSize()
public void setHttpConnPoolSize(int httpConnPoolSize)
httpConnPoolSize - the httpConnPoolSize to setpublic int getBulkMessageSize()
public void setBulkMessageSize(int bulkMessageSize)
bulkMessageSize - the bulkMessageSize to setpublic boolean isPostPerKey()
public void setPostPerKey(boolean postPerKey)
postPerKey - the postPerKey to setpublic String getDefaultKey()
public void setDefaultKey(String defaultKey)
defaultKey - the defaultKey to setpublic boolean isGzipEnabled()
public void setGzipEnabled(boolean gzipEnabled)
gzipEnabled - the gzipEnabled to setpublic boolean isParallelEnabled()
public void setParallelEnabled(boolean parallelEnabled)
parallelEnabled - the parallelEnabled to setpublic String getQueueDir()
public void setQueueDir(String queueDir)
queueDir - the queueDir to setpublic String getQueueName()
public void setQueueName(String queueName)
queueName - the queueName to setpublic long getBigQueueTimerInterval()
public void setBigQueueTimerInterval(long bigQueueTimerInterval)
bigQueueTimerInterval - the bigQueueTimerInterval to setpublic boolean isPeekEnabled()
public void setPeekEnabled(boolean peekEnabled)
peekEnabled - the peekEnabled to setpublic boolean isCertValidationDisabled()
public void setCertValidationDisabled(boolean certValidationDisabled)
certValidationDisabled - the certValidationDisabled to setpublic boolean isStringType()
public void setStringType(boolean stringType)
stringType - the stringType to setCopyright © 2017. All rights reserved.