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 |
---|---|
int |
getMaxParallelUploads()
Returns max parallel upload count
|
int |
getTimeout()
Maximum time to wait log delivery response.
|
int |
getUploadCheckPeriod()
If there are records in storage we need to periodically check isUploadNeeded method.
|
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
)int getTimeout()
int getUploadCheckPeriod()
int getMaxParallelUploads()
void onTimeout(LogFailoverCommand controller)
controller
- the controllervoid onFailure(LogFailoverCommand controller, org.kaaproject.kaa.common.endpoint.gen.LogDeliveryErrorCode code)
controller
- the controllercode
- the codeCopyright © 2016. All rights reserved.