public final class LibHoney extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LibHoney.Builder
LibHoney.Builder
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Map<String,Object> fields)
Copies all of the field mappings from the specified map to this LibHoney.
|
void |
addDynField(String key,
Callable function)
Associates the specified function with the specified key in the dynamic fields map.
|
void |
addDynFields(Map<String,Callable> dynFields)
Copies all of the dynamic field mappings from the specified map to this LibHoney.
|
void |
addField(String key,
Object value)
Associates the specified value with the specified key in the fields map.
|
void |
close()
Closes Transmission
|
String |
getApiHost()
Returns the API host for this LibHoney.
|
boolean |
getBlockOnResponse()
Returns true if this LibHoney should block on response.
|
boolean |
getBlockOnSend()
Returns true if this LibHoney should block on send.
|
int |
getCloseTimeout()
Returns number of seconds Transmission's close method will wait before timing out.
|
String |
getDataSet()
Returns the data set identifier for this LibHoney.
|
Map<String,Callable> |
getDynFields()
Returns dynamic fields for this LibHoney.
|
Map<String,Object> |
getFields()
Returns fields for this LibHoney.
|
int |
getMaxConcurrentBranches()
Returns the maximum number of concurrent branches for this LibHoney.
|
Queue |
getRequestQueue()
Returns the request queue for this LibHoney.
|
int |
getRequestQueueLength()
Returns the response queue length for this LibHoney.
|
Queue |
getResponseQueue()
Returns the response queue for this LibHoney
|
int |
getResponseQueueLength()
Returns the request queue length for this LibHoney.
|
int |
getSampleRate()
Returns the sample rate for this LibHoney.
|
protected Transmission |
getTransmission()
Returns the Transmission for this LibHoney.
|
String |
getUserAgent() |
String |
getWriteKey()
Returns the write key for this LibHoney.
|
Builder |
newBuilder()
Creates a Builder from this LibHoney's fields.
|
Event |
newEvent()
Creates a Event from this LibHoney's Builder.
|
void |
send()
Creates an Event, then sends with Transmission as a request, or as a dropped response if it should be dropped.
|
void |
sendNow(Map<String,Object> fields)
Immediately send a map of keys and values as a Event
|
void |
setTransmission(Transmission transmission)
Sets the reference to transmission
|
org.json.JSONObject |
toJson()
Returns a JSON representation of this LibHoney.
|
String |
toString()
Returns a string representation of this LibHoney.
|
public void add(Map<String,Object> fields)
fields - field mappings to be added to this LibHoneypublic void addDynField(String key, Callable function)
key - key with which the specified function is to be associatedfunction - function to be associated with the specified keypublic void addDynFields(Map<String,Callable> dynFields)
dynFields - dynamic field mappings to be added this LibHoneypublic void addField(String key, Object value)
key - key with which the specified value is to be associatedvalue - value to be associated with the specified keypublic void close()
public String getApiHost()
public boolean getBlockOnResponse()
public boolean getBlockOnSend()
public int getCloseTimeout()
public String getDataSet()
public Map<String,Callable> getDynFields()
public Map<String,Object> getFields()
public int getMaxConcurrentBranches()
public Queue getRequestQueue()
public int getRequestQueueLength()
public Queue getResponseQueue()
public int getResponseQueueLength()
public int getSampleRate()
protected Transmission getTransmission()
public String getUserAgent()
public String getWriteKey()
public Builder newBuilder()
public Event newEvent()
public void send()
throws HoneyException
HoneyException - if there is something wrong with the requestpublic void sendNow(Map<String,Object> fields) throws HoneyException
fields - field keyHoneyException - if there is something wrong with the requestpublic void setTransmission(Transmission transmission)
transmission - reference to transmissionpublic org.json.JSONObject toJson()
Copyright © 2017. All rights reserved.