7 #ifndef CFG_EXPIRATION_H
8 #define CFG_EXPIRATION_H
13 #include <boost/shared_ptr.hpp>
133 return (reclaim_timer_wait_time_);
143 return (flush_reclaimed_timer_wait_time_);
153 return (hold_reclaimed_time_);
163 return (max_reclaim_leases_);
173 return (max_reclaim_time_);
183 return (unwarned_reclaim_cycles_);
221 template<
typename Instance>
222 void setupTimers(
void (Instance::*reclaim_fun)(
const size_t,
const uint16_t,
223 const bool,
const uint16_t),
224 void (Instance::*delete_fun)(
const uint32_t),
225 Instance* instance_ptr)
const;
244 void rangeCheck(
const int64_t value,
const uint64_t max_value,
245 const std::string& config_parameter_name)
const;
248 uint16_t reclaim_timer_wait_time_;
251 uint16_t flush_reclaimed_timer_wait_time_;
254 uint32_t hold_reclaimed_time_;
257 uint32_t max_reclaim_leases_;
260 uint16_t max_reclaim_time_;
263 uint16_t unwarned_reclaim_cycles_;
282 template<
typename Instance>
288 void (Instance::*delete_fun)(
const uint32_t),
289 Instance* instance_ptr)
const {
305 timer_mgr_->registerTimer(RECLAIM_EXPIRED_TIMER_NAME,
306 std::bind(reclaim_fun, instance_ptr,
309 flush_timer_disabled,
313 timer_mgr_->setup(RECLAIM_EXPIRED_TIMER_NAME);
318 if (!flush_timer_disabled) {
321 const long flush_interval = test_mode_ ?
325 timer_mgr_->registerTimer(FLUSH_RECLAIMED_TIMER_NAME,
326 std::bind(delete_fun, instance_ptr,
330 timer_mgr_->setup(FLUSH_RECLAIMED_TIMER_NAME);
338 #endif // CFG_EXPIRATION_H
void setMaxReclaimLeases(const int64_t max_reclaim_leases)
Sets max-reclaim-leases.
uint16_t getReclaimTimerWaitTime() const
Returns reclaim-timer-wait-time.
boost::shared_ptr< TimerMgr > TimerMgrPtr
Type definition of the shared pointer to TimerMgr.
uint16_t getUnwarnedReclaimCycles() const
Returns unwarned-reclaim-cycles.
static const uint32_t DEFAULT_HOLD_RECLAIMED_TIME
Default value for hold-reclaimed-time.
uint16_t getFlushReclaimedTimerWaitTime() const
Returns flush-reclaimed-timer-wait-time.
static const uint16_t LIMIT_FLUSH_RECLAIMED_TIMER_WAIT_TIME
Maximum value for flush-reclaimed-timer-wait-time.
uint16_t getMaxReclaimTime() const
Returns max-reclaim-time.
CfgExpiration(const bool test_mode=false)
Constructor.
boost::shared_ptr< Element > ElementPtr
static const uint32_t LIMIT_HOLD_RECLAIMED_TIME
Maximum value for hold-reclaimed-time.
static const uint16_t LIMIT_MAX_RECLAIM_TIME
Default value for max-reclaim-time.
Holds configuration parameters pertaining to lease expiration and lease affinity. ...
void setUnwarnedReclaimCycles(const int64_t unwarned_reclaim_cycles)
Sets unwarned-reclaim-cycles.
uint32_t getHoldReclaimedTime() const
Returns hold-reclaimed-time.
boost::shared_ptr< CfgExpiration > CfgExpirationPtr
Pointer to the Non-const object.
static const uint16_t DEFAULT_RECLAIM_TIMER_WAIT_TIME
Default value for reclaim-timer-wait-time.
static const std::string FLUSH_RECLAIMED_TIMER_NAME
Name of the timer for flushing reclaimed leases.
Abstract class for configuration Cfg_* classes.
boost::shared_ptr< const CfgExpiration > ConstCfgExpirationPtr
Pointer to the const object.
static const uint16_t DEFAULT_FLUSH_RECLAIMED_TIMER_WAIT_TIME
Default value for flush-reclaimed-timer-wait-time.
static const uint32_t DEFAULT_MAX_RECLAIM_LEASES
Default value for max-reclaim-leases.
static const uint32_t LIMIT_MAX_RECLAIM_LEASES
Maximum value for max-reclaim-leases.
void setHoldReclaimedTime(const int64_t hold_reclaimed_time)
Sets hold-reclaimed-time.
Defines the logger used by the top-level component of kea-dhcp-ddns.
static const uint16_t LIMIT_UNWARNED_RECLAIM_CYCLES
Maximum value for unwarned-reclaim-cycles.
static const std::string RECLAIM_EXPIRED_TIMER_NAME
Name of the timer for reclaiming expired leases.
void setFlushReclaimedTimerWaitTime(const int64_t flush_reclaimed_wait_time)
Sets flush-reclaimed-timer-wait-time.
void setReclaimTimerWaitTime(const int64_t reclaim_timer_wait_time)
Sets reclaim-timer-wait-time.
static const uint16_t LIMIT_RECLAIM_TIMER_WAIT_TIME
Maximum value for reclaim-timer-wait-time.
static const uint16_t DEFAULT_MAX_RECLAIM_TIME
Default value for max-reclaim-time.
void setMaxReclaimTime(const int64_t max_reclaim_time)
Sets max-reclaim-time.
static const uint16_t DEFAULT_UNWARNED_RECLAIM_CYCLES
Default value for unwarned-reclaim-cycles.
uint32_t getMaxReclaimLeases() const
Returns max-reclaim-leases.
void setupTimers(void(Instance::*reclaim_fun)(const size_t, const uint16_t, const bool, const uint16_t), void(Instance::*delete_fun)(const uint32_t), Instance *instance_ptr) const
Setup timers for the reclamation of expired leases according to the configuration parameters...
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.