public interface LogUploadStrategy
Interface for log upload strategy.
Used by log collector on each adding of the new log record in order to check whether to send logs to server or clean up local storage.
Reference implementation used by default (DefaultLogUploadStrategy
).
Modifier and Type | Method and Description |
---|---|
long |
getBatchSize()
Retrieves maximum size of the report pack
that will be delivered in single request to server
|
int |
getTimeout()
Maximum time to wait log delivery response.
|
LogUploadStrategyDecision |
isUploadNeeded(LogStorageStatus status)
Retrieves log upload decision based on current storage status and defined
upload configuration.
|
void |
onFailure(LogFailoverCommand controller,
org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode code)
Handles failure of log delivery
|
void |
onTimeout(LogFailoverCommand controller)
Handles timeout of log delivery
|
LogUploadStrategyDecision isUploadNeeded(LogStorageStatus status)
status
- Log storage statusLogUploadStrategyDecision
)long getBatchSize()
int getTimeout()
void onTimeout(LogFailoverCommand controller)
controller
- void onFailure(LogFailoverCommand controller, org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode code)
controller
- Copyright © 2015. All rights reserved.