public class MonaClient extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
MonaClient.Builder |
| Modifier | Constructor and Description |
|---|---|
protected |
MonaClient(org.komamitsu.fluency.Fluency fluency,
String monaUserId) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the inner connection socket to Mona's fluentd.
|
void |
exportStandalone(String arcClass,
org.json.JSONArray jsonArray)
Export variant for using with a
JSONArray. |
void |
exportStandalone(String arcClass,
org.json.JSONObject jsonObject)
Export variant for using with a
JSONObject. |
void |
exportStandalone(String arcClass,
List<Map<String,Object>> messages)
Use this exportStandalone variant to send a batch (list) of unrelated messages to Mona.
|
void |
exportStandalone(String arcClass,
Map<String,Object> message)
Shorthand for the above exportStandalone variant, leaving the contextId empty.
|
void |
exportStandalone(String arcClass,
String jsonString)
Use this exportStandalone variant if the input is an actual json string.
|
void |
exportStandalone(String arcClass,
String contextId,
org.json.JSONArray jsonArray)
Same as above, allowing a contextId to be set as well.
|
void |
exportStandalone(String arcClass,
String contextId,
org.json.JSONObject jsonObject)
Same as above, allowing setting a contextId as well
|
void |
exportStandalone(String arcClass,
String contextId,
List<Map<String,Object>> messages)
Same as above, supporting setting contextId.
|
void |
exportStandalone(String arcClass,
String contextId,
Map<String,Object> message)
The main exporting mechanism.
|
void |
exportStandalone(String arcClass,
String contextId,
String jsonString)
Same as above, only allowing a contextId to be set as well.
|
long |
getCurrentUnsentDataSize() |
protected MonaClient(org.komamitsu.fluency.Fluency fluency,
String monaUserId)
public void close()
close in interface Closeableclose in interface AutoCloseablepublic long getCurrentUnsentDataSize()
public void exportStandalone(String arcClass, String contextId, Map<String,Object> message)
arcClass - A tag for the ARC class that will be sent using this exportStandalone method. Mona uses ARC
classes to know which arcs belong together and should be compared. See Readme for explanation
about ARCs. This string can have dots, which allows the use of sub-ARC-classes.contextId - The ID to use for this context. Can be empty or null, in which case the client will create a
random UUID as the context id.
When using sub-ARCs (i.e., when the given arcClass param has dots in it), the context id may
also contain dots (at most the amount of dots in the arcClass param), to infer the context
ids for each sub-ARC.message - A json-like object consisting of the actual message to send to Mona.public void exportStandalone(String arcClass, Map<String,Object> message)
public void exportStandalone(String arcClass, List<Map<String,Object>> messages)
messages - a list of json-like messages to send to Monapublic void exportStandalone(String arcClass, String contextId, List<Map<String,Object>> messages)
public void exportStandalone(String arcClass, String jsonString)
jsonString - A valid json string (either object or array)public void exportStandalone(String arcClass, String contextId, String jsonString)
public void exportStandalone(String arcClass, org.json.JSONObject jsonObject)
JSONObject.jsonObject - public void exportStandalone(String arcClass, String contextId, org.json.JSONObject jsonObject)
public void exportStandalone(String arcClass, org.json.JSONArray jsonArray)
JSONArray.jsonArray - Copyright © 2019. All rights reserved.