Horde_Kolab_Storage_Synchronization_TimeBased
extends Horde_Kolab_Storage_Synchronization
in package
Synchronization strategy that synchronizes at certain intervals.
Copyright 2012-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Tags
Table of Contents
- $_strategy : Horde_Kolab_Storage_Synchronization
- Synchronization strategy.
- $_interval : int
- Kolab object cache resync interval with the IMAP server (in seconds).
- $_random_offset : int
- Random offset added to each folder sync interval to prevent mass sync every XX minutes. Otherwise UI latency might get too high.
- __construct() : mixed
- Constructor.
- synchronizeData() : mixed
- Synchronize the provided data in case the selected synchronization strategy requires it.
- synchronizeList() : mixed
- Synchronize the provided list in case the selected synchronization strategy requires it.
- hasNotBeenSynchronizedYet() : bool
- Check if the data store with the given data ID has been synchronized already during this session.
- syncTimeHasElapsed() : bool
- Check if the data store with the given data ID need to be resynchronized with the backend.
Properties
$_strategy
Synchronization strategy.
protected
Horde_Kolab_Storage_Synchronization
$_strategy
$_interval
Kolab object cache resync interval with the IMAP server (in seconds).
private
int
$_interval
Default: Two minutes
$_random_offset
Random offset added to each folder sync interval to prevent mass sync every XX minutes. Otherwise UI latency might get too high.
private
int
$_random_offset
Methods
__construct()
Constructor.
public
__construct([int $interval = 120 ][, int $random_offset = 90 ]) : mixed
Parameters
- $interval : int = 120
-
Kolab object cache resync interval with the IMAP server (in seconds).
- $random_offset : int = 90
-
Random offset added to each folder sync interval.
Return values
mixed —synchronizeData()
Synchronize the provided data in case the selected synchronization strategy requires it.
public
synchronizeData(Horde_Kolab_Storage_Data $data) : mixed
Parameters
- $data : Horde_Kolab_Storage_Data
-
The data to synchronize.
Return values
mixed —synchronizeList()
Synchronize the provided list in case the selected synchronization strategy requires it.
public
synchronizeList(Horde_Kolab_Storage_List $list) : mixed
Parameters
- $list : Horde_Kolab_Storage_List
-
The list to synchronize.
Return values
mixed —hasNotBeenSynchronizedYet()
Check if the data store with the given data ID has been synchronized already during this session.
private
hasNotBeenSynchronizedYet(string $data_id) : bool
Parameters
- $data_id : string
-
The ID of the data store.
Return values
bool —True, if the store has not been synchronized yet.
syncTimeHasElapsed()
Check if the data store with the given data ID need to be resynchronized with the backend.
private
syncTimeHasElapsed(string $data_id) : bool
Parameters
- $data_id : string
-
The ID of the data store.
Return values
bool —True, if the store needs to be synchronized again.