Property | Type | Description | |
---|---|---|---|
$_db | MongoDB | Mongo database | |
$_indexes | array | Mongo Indexes | |
$_mongo | MongoClient | Mongo connection | |
$_propertyMap |
Method | Description | |
---|---|---|
__construct ( array $params = [] ) : Horde_ActiveSync_State_Sql | Const'r | |
checkMongoIndices ( ) | ||
connect ( ) | (Re)open backend storage connection. | |
createMongoIndices ( ) | ||
deleteSyncCache ( string $devid, string $user = null ) | Delete a complete sync cache | |
deviceExists ( string $devId, string $user = null ) : integer | Check that a given device id is known to the server. This is regardless of Provisioning status. If $user is provided, checks that the device is attached to the provided username. | |
disconnect ( ) | Close the underlying backend storage connection. | |
getLastSyncTimestamp ( string $id = null, string $user = null ) : integer | Get the last time the loaded device issued a SYNC request. | |
getSyncCache ( string $devid, string $user, array $fields = null ) : array | Return the sync cache. | |
isDuplicatePIMAddition ( string $id ) : string | Check and see that we didn't already see the incoming change from the client. | |
listDevices ( string $user = null, array $filter = [] ) : array | List all devices that we know about. | |
loadDeviceInfo ( string $devId, string $user = null, array $params = [] ) : Horde_ActiveSync_Device | Load the device object. | |
removeState ( array $options ) | Explicitly remove a state from storage. | |
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. | |
save ( ) | Save the current state to storage | |
saveSyncCache ( array $cache, string $devid, string $user, array $dirty = [] ) | Save the provided sync_cache. | |
setDeviceInfo ( Horde_ActiveSync_Device $data, array $dirty = [] ) | Set new device info | |
setDeviceProperties ( array $data, string $deviceId ) | Set the device's properties as sent by a SETTINGS request. | |
setDeviceRWStatus ( string $devId, string $status ) | Set a new remotewipe status for the device | |
setPolicyKey ( string $devId, integer $key ) | Save a new device policy key to storage for the current user. | |
updateServerIdInState ( string $uid, string $serverid ) | Update the serverid for a given folder uid in the folder's state object. | |
updateState ( string $type, array $change, integer $origin = Horde_ActiveSync::CHANGE_ORIGIN_NA, string $user = null, string $clientid = '' ) | Update the state to reflect changes |
Method | Description | |
---|---|---|
_checkCollision ( [type] $guid ) : [type] | ||
_gc ( string $syncKey ) | Garbage collector - clean up from previous sync requests. | |
_getMailMapChanges ( array $changes ) : array | Return all available mailMap changes for the current folder. | |
_getPIMChangeTS ( array $changes ) : array | Return an array of timestamps from the map table for the last client-initiated change for the provided uid. Used to avoid mirroring back changes to the client that it sent to the server. | |
_havePIMChanges ( ) : boolean | Check for the existence of ANY entries in the map table for this device and user. | |
_loadState ( ) | Load the state represented by $syncKey from storage. | |
_loadStateFromResults ( array $results ) | Actually load the state data into the object from the query results. | |
_resetDeviceState ( string $id ) : void | Reset the sync state for this device, for the specified collection. |
public __construct ( array $params = [] ) : Horde_ActiveSync_State_Sql | ||
$params | array | Must contain: - connection: (Horde_Mongo_Client The Horde_Mongo instance. |
return | Horde_ActiveSync_State_Sql |
protected _checkCollision ( [type] $guid ) : [type] | ||
$guid | [type] | |
return | [type] |
protected _getMailMapChanges ( array $changes ) : array | ||
$changes | array | The chagnes array |
return | 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 ) |
protected _getPIMChangeTS ( array $changes ) : array | ||
$changes | array | The changes array, containing 'id' and 'type'. |
return | array | An array of UID -> timestamp of the last client-initiated change for the specified uid, or null if none found. |
protected _havePIMChanges ( ) : boolean | ||
return | boolean |
protected _loadState ( ) |
protected _loadStateFromResults ( array $results ) | ||
$results | array | The results array from the state query. |
protected _resetDeviceState ( string $id ) : void | ||
$id | string | The collection to reset. |
return | void |
public deleteSyncCache ( string $devid, string $user = null ) | ||
$devid | string | The device id |
$user | string | The user name. |
public getLastSyncTimestamp ( string $id = null, string $user = null ) : integer | ||
$id | string | The (optional) devivce id. If empty will use the currently loaded device. |
$user | string | The (optional) user id. If empty wil use the currently loaded device. |
return | integer | The timestamp of the last sync, regardless of collection |
public isDuplicatePIMAddition ( string $id ) : string | ||
$id | string | The client id sent during message addition. |
return | string | The UID for the given clientid, null if none found. |
public listDevices ( string $user = null, array $filter = [] ) : array | ||
$user | string | The username to list devices for. If empty, will return all devices. |
$filter | array | An array of optional filters where the keys are field names and the values are values to prefix-match. |
return | array | An array of device hashes |
public loadDeviceInfo ( string $devId, string $user = null, array $params = [] ) : Horde_ActiveSync_Device | ||
$devId | string | The device id to obtain |
$user | string | The user to retrieve user-specific device info for |
$params | array | Additional parameters: - force: (boolean) If true, reload the device info even if it's already loaded. Used to refresh values such as device_rwstatus that may have changed during a long running PING/SYNC. DEFAULT: false. @since 2.31.0 |
return | Horde_ActiveSync_Device | The device object |
public removeState ( array $options ) | ||
$options | array | An options array containing at least one of: - synckey: (string) Remove only the state associated with this synckey. DEFAULT: All synckeys are removed for the specified device. - devId: (string) Remove all information for this device. DEFAULT: None. If no device, a synckey is required. - user: (string) Restrict to removing data for this user only. DEFAULT: None - all users for the specified device are removed. - id: (string) When removing device state, restrict ro removing data only for this collection. |
public resetAllPolicyKeys ( ) |
public setDeviceInfo ( Horde_ActiveSync_Device $data, array $dirty = [] ) | ||
$data | Horde_ActiveSync_Device | The device information |
$dirty | array | Array of dirty properties. @since 2.9.0 |
public setDeviceProperties ( array $data, string $deviceId ) | ||
$data | array | The device settings |
$deviceId | string | The device id. |
public setDeviceRWStatus ( string $devId, string $status ) | ||
$devId | string | The device id. |
$status | string | A Horde_ActiveSync::RWSTATUS_* constant. |
public setPolicyKey ( string $devId, integer $key ) | ||
$devId | string | The device id |
$key | integer | The new policy key |
public updateServerIdInState ( string $uid, string $serverid ) | ||
$uid | string | The folder UID. |
$serverid | string | The new serverid for this uid. |
public updateState ( string $type, array $change, integer $origin = Horde_ActiveSync::CHANGE_ORIGIN_NA, string $user = null, string $clientid = '' ) | ||
$type | string | The type of change (change, delete, flags or foldersync) |
$change | array | A stat/change hash describing the change. Contains: - id: (mixed) The message uid the change applies to. - serverid: (string) The backend server id for the folder. - folderuid: (string) The EAS folder UID for the folder. - parent: (string) The parent of the current folder, if any. - flags: (array) If this is a flag change, the state of the flags. - mod: (integer) The modtime of this change. |
$origin | integer | 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 |
$user | string | The current sync user, only needed if change origin is CHANGE_ORIGIN_PIM |
$clientid | string | client clientid sent when adding a new message. |