client-cpp  0.10.0
kaa::StorageSizeLogUploadStrategy Class Reference

#include <StorageSizeLogUploadStrategy.hpp>

+ Inheritance diagram for kaa::StorageSizeLogUploadStrategy:
+ Collaboration diagram for kaa::StorageSizeLogUploadStrategy:

Public Member Functions

 StorageSizeLogUploadStrategy (std::size_t volumeThreshold, IKaaClientContext &context)
 
virtual LogUploadStrategyDecision isUploadNeeded (ILogStorageStatus &status) override
 Decides whether the log upload is needed. More...
 
- Public Member Functions inherited from kaa::DefaultLogUploadStrategy
 DefaultLogUploadStrategy (IKaaClientContext &context)
 
virtual void onTimeout (ILogFailoverCommand &controller)
 Callback is used when the log delivery timeout detected. More...
 
virtual void onFailure (ILogFailoverCommand &controller, LogDeliveryErrorCode code)
 Callback is used when the log delivery is failed. More...
 
virtual std::size_t getTimeout ()
 Maximum time to wait the log delivery response. More...
 
void setUploadTimeout (std::size_t timeout)
 
virtual std::size_t getTimeoutCheckPeriod ()
 
void setTimeoutCheckPeriod (std::size_t period)
 
virtual std::size_t getLogUploadCheckPeriod ()
 
void setLogUploadCheckPeriod (std::size_t period)
 
virtual std::size_t getMaxParallelUploads ()
 Max amount of log batches allowed to be uploaded parallel. More...
 
void setMaxParallelUploads (std::size_t count)
 
std::size_t getRetryPeriod ()
 
void setRetryPeriod (std::size_t period)
 
std::size_t getVolumeThreshold () const
 
void setVolumeThreshold (std::size_t maxVolume)
 
std::size_t getCountThreshold () const
 
void setCountThreshold (std::size_t maxCount)
 
- Public Member Functions inherited from kaa::ILogUploadStrategy
virtual ~ILogUploadStrategy ()
 

Additional Inherited Members

- Static Public Attributes inherited from kaa::DefaultLogUploadStrategy
static const std::size_t DEFAULT_UPLOAD_TIMEOUT = 2 * 60
 
static const std::size_t DEFAULT_TIMEOUT_CHECK_PERIOD = 10
 
static const std::size_t DEFAULT_LOG_UPLOAD_CHECK_PERIOD = 30
 
static const std::size_t DEFAULT_RETRY_PERIOD = 5 * 60
 
static const std::size_t DEFAULT_UPLOAD_VOLUME_THRESHOLD = 8 * 1024
 
static const std::size_t DEFAULT_UPLOAD_COUNT_THRESHOLD = 64
 
static const std::size_t DEFAULT_MAX_PARALLEL_UPLOADS = INT32_MAX
 
- Protected Attributes inherited from kaa::DefaultLogUploadStrategy
std::size_t uploadTimeout_ = DEFAULT_UPLOAD_TIMEOUT
 
std::size_t retryReriod_ = DEFAULT_RETRY_PERIOD
 
std::size_t timeoutCheckPeriod_ = DEFAULT_TIMEOUT_CHECK_PERIOD
 
std::size_t logUploadCheckReriod_ = DEFAULT_LOG_UPLOAD_CHECK_PERIOD
 
std::size_t uploadVolumeThreshold_ = DEFAULT_UPLOAD_VOLUME_THRESHOLD
 
std::size_t uploadCountThreshold_ = DEFAULT_UPLOAD_COUNT_THRESHOLD
 
std::size_t maxParallelUploads_ = DEFAULT_MAX_PARALLEL_UPLOADS
 
IKaaClientContextcontext_
 

Detailed Description

Definition at line 29 of file StorageSizeLogUploadStrategy.hpp.

Constructor & Destructor Documentation

kaa::StorageSizeLogUploadStrategy::StorageSizeLogUploadStrategy ( std::size_t  volumeThreshold,
IKaaClientContext context 
)
inline

Definition at line 31 of file StorageSizeLogUploadStrategy.hpp.

Member Function Documentation

virtual LogUploadStrategyDecision kaa::StorageSizeLogUploadStrategy::isUploadNeeded ( ILogStorageStatus status)
inlineoverridevirtual

Decides whether the log upload is needed.

The decision is made based on the current log storage status and, depending on the strategy implementation, on some additional information.

Parameters
[in]statusThe log storage status.
Returns
The log upload decision.
See Also
ILogStorageStatus
LogUploadStrategyDecision

Reimplemented from kaa::DefaultLogUploadStrategy.

Definition at line 37 of file StorageSizeLogUploadStrategy.hpp.


The documentation for this class was generated from the following file: