public abstract class Emitter
extends java.lang.Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
Emitter.EmitterBuilder
Builder for the Emitter.
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected BufferOption |
bufferOption |
protected long |
byteLimitGet |
protected long |
byteLimitPost |
protected Call |
call |
protected android.content.Context |
context |
protected int |
emitterTick |
protected int |
emptyLimit |
protected javax.net.ssl.HostnameVerifier |
hostnameVerifier |
protected HttpMethod |
httpMethod |
protected java.util.concurrent.atomic.AtomicBoolean |
isRunning |
protected MediaType |
JSON |
protected int |
POST_STM_BYTES |
protected int |
POST_WRAPPER_BYTES |
protected RequestCallback |
requestCallback |
protected RequestSecurity |
requestSecurity |
protected int |
sendLimit |
protected javax.net.ssl.SSLSocketFactory |
sslSocketFactory |
protected java.util.concurrent.TimeUnit |
timeUnit |
protected java.lang.String |
uri |
protected android.net.Uri.Builder |
uriBuilder |
| 构造器和说明 |
|---|
Emitter(Emitter.EmitterBuilder builder)
Creates an emitter object
|
| 限定符和类型 | 方法和说明 |
|---|---|
abstract void |
add(DataLoad payload) |
abstract void |
add(DataLoad payload,
boolean attemptEmit) |
protected java.util.LinkedList<ReadyRequest> |
buildRequests(EmittableEvents events)
Returns a list of ReadyRequests which can
all be sent regardless of if it is GET or POST
|
protected void |
close(Response response)
close response source
|
abstract void |
flush()
Sends everything in the database to the endpoint.
|
BufferOption |
getBufferOption() |
long |
getByteLimitGet() |
long |
getByteLimitPost() |
abstract boolean |
getEmitterStatus() |
int |
getEmitterTick() |
java.lang.String |
getEmitterUri() |
int |
getEmptyLimit() |
abstract Store |
getEventStore() |
HttpMethod |
getHttpMethod() |
RequestCallback |
getRequestCallback() |
RequestSecurity |
getRequestSecurity() |
int |
getSendLimit() |
protected boolean |
isSuccessfulSend(int code)
Returns truth on if the request
was sent successfully.
|
protected java.util.LinkedList<RequestResult> |
performSyncEmit(java.util.LinkedList<ReadyRequest> requests)
Performs a synchronous sending of a list of
ReadyRequests.
|
protected int |
requestSender(Request request)
The function responsible for actually sending
the request to the collector.
|
void |
setBufferOption(BufferOption option)
Sets whether the buffer should send events instantly or after the buffer has reached
it's limit.
|
void |
setEmitterUri(java.lang.String uri)
Updates the URI for the Emitter
|
void |
setHttpMethod(HttpMethod method)
Sets the HttpMethod for the Emitter
|
void |
setRequestSecurity(RequestSecurity security)
Sets the RequestSecurity for the Emitter
|
abstract void |
shutdown()
Shuts the emitter down!
|
protected int POST_WRAPPER_BYTES
protected int POST_STM_BYTES
protected final MediaType JSON
protected android.content.Context context
protected android.net.Uri.Builder uriBuilder
protected RequestCallback requestCallback
protected HttpMethod httpMethod
protected BufferOption bufferOption
protected RequestSecurity requestSecurity
protected javax.net.ssl.SSLSocketFactory sslSocketFactory
protected javax.net.ssl.HostnameVerifier hostnameVerifier
protected java.lang.String uri
protected int emitterTick
protected int emptyLimit
protected int sendLimit
protected long byteLimitGet
protected long byteLimitPost
protected java.util.concurrent.TimeUnit timeUnit
protected Call call
protected java.util.concurrent.atomic.AtomicBoolean isRunning
public Emitter(Emitter.EmitterBuilder builder)
builder - The builder that constructs an emitterpublic abstract void add(DataLoad payload)
payload - the payload to be added to
the EventStorepublic abstract void add(DataLoad payload, boolean attemptEmit)
payload - the payload to be added to
the EventStoreattemptEmit - attempt emit to serverpublic abstract void shutdown()
public abstract void flush()
protected java.util.LinkedList<RequestResult> performSyncEmit(java.util.LinkedList<ReadyRequest> requests)
requests - the requests to sendprotected int requestSender(Request request)
request - The request to be sentprotected void close(Response response)
response - the receive responseprotected java.util.LinkedList<ReadyRequest> buildRequests(EmittableEvents events)
events - a list of EmittableEvents pulled
from the database.public abstract Store getEventStore()
public abstract boolean getEmitterStatus()
protected boolean isSuccessfulSend(int code)
code - the response codepublic void setBufferOption(BufferOption option)
option - Set the BufferOption enum to Instant send events upon creation.public void setHttpMethod(HttpMethod method)
method - the HttpMethodpublic void setRequestSecurity(RequestSecurity security)
security - the RequestSecuritypublic void setEmitterUri(java.lang.String uri)
uri - new Emitter URIpublic java.lang.String getEmitterUri()
public RequestCallback getRequestCallback()
public HttpMethod getHttpMethod()
public BufferOption getBufferOption()
public RequestSecurity getRequestSecurity()
public int getEmitterTick()
public int getEmptyLimit()
public int getSendLimit()
public long getByteLimitGet()
public long getByteLimitPost()