public abstract class AbstractLogCollector extends Object implements LogCollector, LogProcessor
Modifier and Type | Field and Description |
---|---|
protected ExecutorContext |
executorContext |
static long |
MAX_BATCH_VOLUME |
protected LogStorage |
storage |
Constructor and Description |
---|
AbstractLogCollector(LogTransport transport,
ExecutorContext executorContext,
KaaChannelManager manager) |
Modifier and Type | Method and Description |
---|---|
void |
fillSyncRequest(org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest request)
Fills the given request with the latest Logging state.
|
protected boolean |
isDeliveryTimeout() |
void |
onLogResponse(org.kaaproject.kaa.common.endpoint.gen.LogSyncResponse logSyncResponse)
Updates the state using response from the server.
|
void |
setStorage(LogStorage storage)
Set user implementation of a log storage.
|
void |
setStrategy(LogUploadStrategy strategy)
Set user implementation of a log upload strategy.
|
void |
stop()
Stops and/or cleanup resources.
|
protected void |
uploadIfNeeded() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLogRecord
public static final long MAX_BATCH_VOLUME
protected final ExecutorContext executorContext
protected LogStorage storage
public AbstractLogCollector(LogTransport transport, ExecutorContext executorContext, KaaChannelManager manager)
public void setStrategy(LogUploadStrategy strategy)
GenericLogCollector
setStrategy
in interface GenericLogCollector
strategy
- User-defined log upload strategy object.public void setStorage(LogStorage storage)
GenericLogCollector
setStorage
in interface GenericLogCollector
storage
- User-defined log storage objectpublic void fillSyncRequest(org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest request)
LogProcessor
fillSyncRequest
in interface LogProcessor
request
- the Log request which is going to be filled.public void onLogResponse(org.kaaproject.kaa.common.endpoint.gen.LogSyncResponse logSyncResponse) throws IOException
LogProcessor
onLogResponse
in interface LogProcessor
logSyncResponse
- the response from the remote server.IOException
public void stop()
GenericLogCollector
stop
in interface GenericLogCollector
protected boolean isDeliveryTimeout()
protected void uploadIfNeeded()
Copyright © 2015. All rights reserved.