$_params
$_params : array
Configuration parameters
Base class for managing everything related to device state
$_collection : array
The collection array for the collection we are currently syncing.
Keys include:
$_deviceInfo : \Horde_ActiveSync_Device
Device object.
setBackend(\Horde_ActiveSync_Driver_Base $backend) : void
Set the backend driver (should really only be called by a backend object when passing this object to client code)
\Horde_ActiveSync_Driver_Base | $backend | The backend driver |
isConflict(array $stat, string $type) : boolean
Determines if the server version of the message represented by $stat conflicts with the client version of the message. For this driver, this is true whenever $lastSyncTime is older then $stat['mod']. Method is only called from the Importer during an import of a non-new change from the client.
array | $stat | A message stat array |
string | $type | The type of change (change, delete, add) |
getFolderUidForBackendId(string $serverid) : string|boolean
Get a EAS Folder Uid for the given backend server id.
string | $serverid | The backend server id. E.g., 'INBOX'. |
The EAS UID for the requested serverid, or false if it is not found.
getChanges(array $options = array()) : array
Get all items that have changed since the last sync time
array | $options | An options array:
|
An array of hashes describing each change:
None found |
getNewSyncKeyWrapper(string $syncKey) : string
Non-static wrapper for getNewSyncKey.
string | $syncKey | The old syncKey |
The new synckey
todo |
Remove/replace in H6 with Horde_ActiveSync_SyncKey |
---|
checkCollision(string $syncKey) : boolean
Check for the (rare) possibility of a synckey collision between collections.
string | $syncKey | The synckey to check. |
True if there was a collision.
None found |
getNewSyncKey(string $syncKey) : string
Gets the new sync key for a specified sync key. You must save the new sync state under this sync key when done sync'ing by calling setNewSyncKey(), then save().
string | $syncKey | The old syncKey |
The new synckey
None found |
getSyncKeyCounter(string $syncKey) : mixed
Return the counter for the specified syncKey.
string | $syncKey | The synckey to obtain the counter for. |
integer|boolean The increment counter or false if failed.
None found |
getSyncKeyUid(string $syncKey) : string
Return the UID portion of a synckey.
string | $syncKey | The synckey |
The UID.
None found |
RowCmp( $a, $b) : \unknown_type
Helper function for the _diff method
$a | ||
$b |
None found |
loadState(array $collection, string $syncKey, string $type = null, string $id = null)
Load and initialize the sync state
array | $collection | The collection array for the collection, if a FOLDERSYNC, pass an empty array. |
string | $syncKey | The synckey of the state to load. If empty will force a reset of the state for the class specified in $id |
string | $type | The type of state a Horde_ActiveSync::REQUEST_TYPE constant. |
string | $id | The folder id this state represents. If empty assumed to be a foldersync state. |
Horde_ActiveSync_Exception_StateGone
None found |
getLatestSynckeyForCollection(string $collection_id) : string|integer
Return the most recently seen synckey for the given collection.
string | $collection_id | The activesync collection id. |
The synckey or 0 if none found.
None found |
updateSyncStamp()
Update the syncStamp in the collection state, outside of any other changes.
Used to prevent extremely large differences in syncStamps for clients and collections that don't often have changes.
None found |
updateState(string $type, array $change, integer $origin = \Horde_ActiveSync::CHANGE_ORIGIN_NA, string $user = null, string $clientid = '')
Update the state to reflect changes
string | $type | The type of change (change, delete, flags or foldersync) |
array | $change | A stat/change hash describing the change. Contains:
|
integer | $origin | Flag to indicate the origin of the change: Horde_ActiveSync::CHANGE_ORIGIN_NA - Not applicapble/not important Horde_ActiveSync::CHANGE_ORIGIN_PIM - Change originated from client |
string | $user | The current sync user, only needed if change origin is CHANGE_ORIGIN_PIM |
string | $clientid | client clientid sent when adding a new message |
None found |
setPolicyKey(string $devId, integer $key)
Save a new device policy key to storage.
string | $devId | The device id |
integer | $key | The new policy key |
None found |
resetAllPolicyKeys()
Reset ALL device policy keys. Used when server policies have changed and you want to force ALL devices to pick up the changes. This will cause all devices that support provisioning to be reprovisioned.
None found |
setDeviceRWStatus(string $devId, string $status)
Set a new remotewipe status for the device
string | $devId | The device id. |
string | $status | A HordeActiveSync::RWSTATUS* constant. |
None found |
loadDeviceInfo( $device, string $user = null, array $params = array()) : \Horde_ActiveSync_Device
Obtain the device object.
$device | ||
string | $user | |
array | $params | Additional parameters:
|
None found |
deviceExists(string $devId, string $user = null) : boolean
Check that a given device id is known to the server. This is regardless of Provisioning status.
string | $devId | The device id to check |
string | $user | The device should be owned by this user. |
None found |
setDeviceInfo(object $data, array $dirty = array())
Set new device info
object | $data | The device information |
array | $dirty | Array of dirty properties. @since 2.9.0 |
None found |
setDeviceProperties(array $data, string $deviceId)
Set the device's properties as sent by a SETTINGS request.
array | $data | The device settings |
string | $deviceId | The device id. |
None found |
removeState(array $options)
Explicitly remove a state from storage.
array | $options | An options array containing:
|
None found |
listDevices() : array
List all devices that we know about.
An array of device hashes
None found |
getLastSyncTimestamp() : integer
Get the last time the currently loaded device issued a SYNC request.
The timestamp of the last sync, regardless of collection
None found |
getSyncCache(string $devid, string $user, array $fields = null) : array
Return the sync cache.
string | $devid | The device id. |
string | $user | The user id. |
array | $fields | An array of fields to return. Default is to return the full cache. @since 2.9.0 |
The current sync cache for the user/device combination.
None found |
saveSyncCache(array $cache, string $devid, string $user, array $dirty = array())
Save the provided sync_cache.
array | $cache | The cache to save. |
string | $devid | The device id. |
string | $user | The userid. |
array | $dirty | An array of dirty properties. @since 2.9.0 |
None found |
deleteSyncCache(string $devid, string $user)
Delete a complete sync cache
string | $devid | The device id |
string | $user | The user name. |
None found |
isDuplicatePIMAddition(string $id) : string
Check and see that we didn't already see the incoming change from the client.
This would happen e.g., if the client failed to receive the server response after successfully importing new messages.
string | $id | The client id sent during message addition. |
The UID for the given clientid, null if none found.
None found |
disconnect()
Close the underlying backend storage connection.
To be used during PING or looping SYNC operations.
None found |
_getFolderChanges()
Get folder changes. Populates $this->_changes with an array of change entries each containing 'type', 'id' and possibly 'flags'.
None found |
_getCutOffDate(integer $restrict) : integer
Returns the timestamp of the earliest modification time to consider
integer | $restrict | The time period to restrict to |
None found |
_getDiff(array $old, array $new) : \unknown_type
Helper function that performs the actual diff between client state and server state FOLDERSYNC arrays.
array | $old | The client state |
array | $new | The current server state |
None found |
_loadState()
Load the state represented by $syncKey from storage.
Horde_ActiveSync_Exception_StateGone
None found |
_havePIMChanges() : boolean
Check for the existence of ANY entries in the map table for this device and user.
An extra database query for each sync, but the payoff is that we avoid having to stat every message change we send to the client if there are no client generated changes for this sync period.
None found |
_getMailMapChanges(array $changes) : array
Return all available mailMap changes for the current folder.
array | $changes | The chagnes array |
An array of hashes, each in the form of {uid} => array( Horde_ActiveSync::CHANGE_TYPE_FLAGS => true|false, Horde_ActiveSync::CHANGE_TYPE_DELETE => true|false )
None found |