public abstract class AbstractLogCollector extends Object implements LogCollector, LogProcessor
Modifier and Type | Field and Description |
---|---|
protected Map<Integer,BucketInfo> |
bucketInfoMap |
protected Map<Integer,List<RecordFuture>> |
deliveryFuturesMap |
protected ExecutorContext |
executorContext |
protected LogStorage |
storage |
Constructor and Description |
---|
AbstractLogCollector(LogTransport transport,
ExecutorContext executorContext,
KaaChannelManager channelManager,
FailoverManager failoverManager) |
Modifier and Type | Method and Description |
---|---|
protected void |
addDeliveryFuture(BucketInfo info,
RecordFuture future) |
void |
fillSyncRequest(org.kaaproject.kaa.common.endpoint.gen.LogSyncRequest request)
Fills the given request with the latest Logging state.
|
protected void |
notifyDeliveryFuturesOnSuccess(BucketInfo info) |
void |
onLogResponse(org.kaaproject.kaa.common.endpoint.gen.LogSyncResponse logSyncResponse)
Updates the state using response from the server.
|
protected void |
scheduleUploadCheck() |
void |
setLogDeliveryListener(LogDeliveryListener logDeliveryListener)
Set a listener which receives a delivery status of each log bucket.
|
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
protected final ExecutorContext executorContext
protected final Map<Integer,List<RecordFuture>> deliveryFuturesMap
protected final Map<Integer,BucketInfo> bucketInfoMap
protected LogStorage storage
public AbstractLogCollector(LogTransport transport, ExecutorContext executorContext, KaaChannelManager channelManager, FailoverManager failoverManager)
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
- the io exceptionpublic void stop()
GenericLogCollector
stop
in interface GenericLogCollector
protected void scheduleUploadCheck()
protected void uploadIfNeeded()
public void setLogDeliveryListener(LogDeliveryListener logDeliveryListener)
GenericLogCollector
setLogDeliveryListener
in interface GenericLogCollector
logDeliveryListener
- User-defined listener object.protected void addDeliveryFuture(BucketInfo info, RecordFuture future)
protected void notifyDeliveryFuturesOnSuccess(BucketInfo info)
Copyright © 2016. All rights reserved.