Overview

Packages

  • ActiveSync
  • None

Classes

  • Horde_ActiveSync
  • Horde_ActiveSync_Connector_Exporter
  • Horde_ActiveSync_Connector_Importer
  • Horde_ActiveSync_Driver_Base
  • Horde_ActiveSync_Exception
  • Horde_ActiveSync_Exception_InvalidRequest
  • Horde_ActiveSync_Exception_StateGone
  • Horde_ActiveSync_Message_Base
  • Horde_ActiveSync_Request_Base
  • Horde_ActiveSync_Request_FolderCreate
  • Horde_ActiveSync_Request_FolderSync
  • Horde_ActiveSync_Request_GetHierarchy
  • Horde_ActiveSync_Request_GetItemEstimate
  • Horde_ActiveSync_Request_MeetingResponse
  • Horde_ActiveSync_Request_MoveItems
  • Horde_ActiveSync_Request_Notify
  • Horde_ActiveSync_Request_Ping
  • Horde_ActiveSync_Request_Provision
  • Horde_ActiveSync_Request_Search
  • Horde_ActiveSync_Request_SendMail
  • Horde_ActiveSync_Request_SmartForward
  • Horde_ActiveSync_Request_SmartReply
  • Horde_ActiveSync_Request_Sync
  • Horde_ActiveSync_State_File
  • Horde_ActiveSync_Sync
  • Horde_ActiveSync_Wbxml
  • Horde_ActiveSync_Wbxml_Decoder
  • Horde_ActiveSync_Wbxml_Encoder
  • Overview
  • Package
  • Class
  • Tree

Class Horde_ActiveSync_State_File

File : statemachine.php Project : Z-Push Descr : This class handles state requests; Each differential mechanism can store its own state information, which is stored through the state machine. SyncKey's are of the form {UUID}N, in which UUID is allocated during the first sync, and N is incremented for each request to 'getNewSyncKey'. A sync state is simple an opaque string value that can differ for each backend used - normally a list of items as the backend has sent them to the PIM. The backend can then use this backend information to compute the increments with current data.

Old sync states are not deleted until a sync state is requested. At that moment, the PIM is apparently requesting an update since sync key X, so any sync states before X are already on the PIM, and can therefore be removed. This algorithm is automatically enforced by the StateMachine class.

Created : 01.10.2007

� Zarafa Deutschland GmbH, www.zarafaserver.de This file is distributed under GPL-2.0. Consult COPYING file for details

Horde_ActiveSync_State_Base
Extended by Horde_ActiveSync_State_File
Located at Horde/ActiveSync/State/File.php
Methods summary
public Horde_ActiveSync_StateMachine_File
# __construct( array $params = array() )

Const'r

Const'r

Parameters

$params
Must contain 'directory' entry

Returns

Horde_ActiveSync_StateMachine_File

Overrides

Horde_ActiveSync_State_Base::__construct()
public
# loadState( string $syncKey, string $type = null, string $id = '' )

Load the sync state

Load the sync state

Parameters

$syncKey
The synckey
$type
Treat the loaded state data as this type of state.
$id
The collection id this represents

Throws

Horde_ActiveSync_Exception

Prarm

string $type Treat loaded state as this type of state.
public boolean
# isConflict( array $stat, string $type )

Determines if the server version of the message represented by $stat conflicts with the PIM version of the message according to the current state.

Determines if the server version of the message represented by $stat conflicts with the PIM version of the message according to the current state.

Parameters

$stat
A message stat array
$type
The type of change (change, delete, add)

Returns

boolean

See

Horde_ActiveSync_State_Base::isConflict()
public boolean
# save( )

Save the current state to storage

Save the current state to storage

Returns

boolean
public
# updateState( string $type, array $change, integer $origin = Horde_ActiveSync::CHANGE_ORIGIN_NA, string $user = null )

Update the state to reflect changes

Update the state to reflect changes

Parameters

$type
The type of change (change, delete, flags)
$change
Array describing change
$origin
Flag to indicate the origin of the change.
$user
The current synch user
public boolean
# setFolderData( string $devId, array $folders )

Save folder data for a specific device. Used only for compatibility with older (version 1) ActiveSync requests.

Save folder data for a specific device. Used only for compatibility with older (version 1) ActiveSync requests.

Parameters

$devId
The device Id
$folders
The folder data

Returns

boolean

Throws

Horde_ActiveSync_Exception
public mixed
# getFolderData( string $devId, string $class )

Get the folder data for a specific collection for a specific device. Used only with older (version 1) ActiveSync requests.

Get the folder data for a specific collection for a specific device. Used only with older (version 1) ActiveSync requests.

Parameters

$devId
The device id
$class
The folder class to fetch (Calendar, Contacts etc.)

Returns

mixed
Either an array of folder data || false
public array
# getKnownFolders( )

Return an array of known folders. This is essentially the state for a FOLDERSYNC request. AS uses a seperate synckey for FOLDERSYNC requests also, so need to treat it as any other collection.

Return an array of known folders. This is essentially the state for a FOLDERSYNC request. AS uses a seperate synckey for FOLDERSYNC requests also, so need to treat it as any other collection.

Returns

array
public array
# initPingState( string $devId )

Perform any initialization needed to deal with pingStates For this driver, it loads the device's state file.

Perform any initialization needed to deal with pingStates For this driver, it loads the device's state file.

Parameters

$devId
The device id of the PIM to load PING state for

Returns

array
The $collection array
public object
# loadDeviceInfo( string $devId, string $user )

Obtain the device object.

Obtain the device object.

Parameters

$devId
The device id to obtain
$user
The user account to use

Returns

object
The device info object

Throws

Horde_ActiveSync_Exception
public boolean
# setDeviceInfo( string $data )

Set new device info

Set new device info

Parameters

$data
$devId The device id.

Returns

boolean
public boolean
# deviceExists( string $devId, string $user = null )

Check that a given device id is known to the server. This is regardless of Provisioning status.

Check that a given device id is known to the server. This is regardless of Provisioning status.

Parameters

$devId
$user

Returns

boolean
public
# loadPingCollectionState( array $pingCollection )

Load a specific collection's ping state. Ping state must already have been loaded.

Load a specific collection's ping state. Ping state must already have been loaded.

Parameters

$pingCollection
The collection array from the PIM request

Throws

Horde_ActiveSync_Exception
public boolean
# savePingState( )

Save the current ping state to storage

Save the current ping state to storage

Returns

boolean

Throws

Horde_ActiveSync_Exception
public integer
# getHeartbeatInterval( )

Return the heartbeat interval, or zero if we have no existing state

Return the heartbeat interval, or zero if we have no existing state

Returns

integer
The hearbeat interval, or zero if not found.

Throws

Horde_ActiveSync_Exception
public
# setHeartbeatInterval( integer $lifetime )

Set the device's heartbeat interval

Set the device's heartbeat interval

Parameters

$lifetime
public
# setPolicyKey( string $devId, integer $key )

Save a new device policy key to storage.

Save a new device policy key to storage.

Parameters

$devId
The device id
$key
The new policy key
public
# 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.

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.

Throws

Horde_ActiveSync_Exception
public boolean
# setDeviceRWStatus( string $devId, integer $status )

Set a new remotewipe status for the device

Set a new remotewipe status for the device

Parameters

$devId
$status

Returns

boolean
public array
# getChanges( integer $flags = 0 )

Get list of server changes

Get list of server changes

Parameters

$flags

Returns

array
public
# removeState( string $syncKey = null, string $devId = null )

Explicitly remove a specific state. Normally used if a request results in a synckey mismatch. This isn't strictly needed, but helps keep the state storage clean.

Explicitly remove a specific state. Normally used if a request results in a synckey mismatch. This isn't strictly needed, but helps keep the state storage clean.

Parameters

$syncKey
The specific state to remove
$devId
Remove all state for this device (ignores synckey)

Throws

Horde_ActiveSyncException
public array
# listDevices( )

List all devices that we know about.

List all devices that we know about.

Returns

array
An array of device hashes

Throws

Horde_ActiveSync_Exception
public integer
# getLastSyncTimestamp( )

Get the last time a particular device issued a SYNC request.

Get the last time a particular device issued a SYNC request.

Returns

integer
The timestamp of the last sync, regardless of collection

Throws

Horde_ActiveSync_Exception
Methods inherited from Horde_ActiveSync_State_Base
RowCmp(), __destruct(), generatePolicyKey(), getChangeCount(), getCurrentSyncKey(), getDeviceRWStatus(), getNewSyncKey(), getPolicyKey(), getSyncKeyCounter(), init(), resetPingState(), setBackend(), setLogger(), setNewSyncKey()
Constants inherited from Horde_ActiveSync_State_Base
FILTERTYPE_1DAY, FILTERTYPE_1MONTH, FILTERTYPE_1WEEK, FILTERTYPE_2WEEKS, FILTERTYPE_3DAYS, FILTERTYPE_3MONTHS, FILTERTYPE_6MONTHS, FILTERTYPE_ALL
API documentation generated by ApiGen