Overview

Packages

  • ActiveSync
  • None

Classes

  • Horde_ActiveSync_Message_Appointment
  • Horde_ActiveSync_Message_Attendee
  • Horde_ActiveSync_Message_Contact
  • Horde_ActiveSync_Message_Exception
  • Horde_ActiveSync_Message_Folder
  • Horde_ActiveSync_Message_Recurrence
  • Horde_ActiveSync_Message_Task
  • Horde_ActiveSync_State_Base
  • Horde_ActiveSync_State_History
  • Horde_ActiveSync_Timezone
  • Overview
  • Package
  • Class
  • Tree

Class Horde_ActiveSync_State_Base

Base class for managing everything related to state:

Persistence of state data Generating delta between server and PIM Caching PING related state (hearbeat interval, folder list etc...)

Copyright 2010-2012 Horde LLC (http://www.horde.org/)

Direct known subclasses

Horde_ActiveSync_State_File, Horde_ActiveSync_State_History
Abstract
Package: ActiveSync
Author: Michael J. Rubinsky mrubinsk@horde.org
Located at Horde/ActiveSync/State/Base.php
Methods summary
public Horde_ActiveSync_State_Base
# __construct( array $params = array() )

Const'r

Const'r

Parameters

$params
$collection A collection array

Returns

Horde_ActiveSync_State_Base
public
# __destruct( )
public
# setNewSyncKey( string $newKey )

Update the $oldKey syncState to $newKey.

Update the $oldKey syncState to $newKey.

Parameters

$newKey
public string
# getCurrentSyncKey( )

Get the current synckey

Get the current synckey

Returns

string
The synkey we last retrieved state for
public unknown
# generatePolicyKey( )

Generate a random 10 digit policy key

Generate a random 10 digit policy key

Returns

unknown
public integer
# getPolicyKey( string $devId )

Obtain the current policy key, if it exists.

Obtain the current policy key, if it exists.

Parameters

$devId
The device id to obtain policy key for.

Returns

integer

The current policy key for this device, or 0 if none exists.

public integer
# getDeviceRWStatus( string $devId )

Return a device wipe status

Return a device wipe status

Parameters

$devId

Returns

integer
public
# setBackend( Horde_ActiveSync_Driver_Base $backend )

Set the backend driver (should really only be called by a backend object when passing this object to client code)

Set the backend driver (should really only be called by a backend object when passing this object to client code)

Parameters

$backend
The backend driver
public
# init( array $collection = array() )

Initialize the state object

Initialize the state object

Parameters

$collection
The collection array
public
# setLogger( Horde_Log_Logger $logger )

Set the logger instance for this object.

Set the logger instance for this object.

Parameters

$logger
public
# resetPingState( )

Reset the device's PING state.

Reset the device's PING state.

public integer
# getChangeCount( )

Get the number of server changes.

Get the number of server changes.

Returns

integer
public static string
# getNewSyncKey( string $syncKey )

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().

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().

Parameters

$syncKey
The old syncKey

Returns

string
The new synckey

Throws

Horde_ActiveSync_Exception
public static mixed
# getSyncKeyCounter( mixed $syncKey )

Return the counter for the specified syncKey.

Return the counter for the specified syncKey.

Returns

mixed
integer|boolean
public static unknown_type
# RowCmp( mixed $a, mixed $b )

Helper function for the _diff method

Helper function for the _diff method

Parameters

$a
$b

Returns

unknown_type
abstract public array
# loadState( string $syncKey, string $type = null, string $id = '' )

Loads the initial state from storage for the specified syncKey and intializes the stateMachine for use.

Loads the initial state from storage for the specified syncKey and intializes the stateMachine for use.

Parameters

$syncKey
The key for the state to load.
$type
Treat the loaded state data as this type of state.
$id
The collection id this represents

Returns

array
The state array
abstract public
# initPingState( object $device )

Load/initialize the ping state for the specified device.

Load/initialize the ping state for the specified device.

Parameters

$device
abstract public
# loadPingCollectionState( string $devid )

Load the ping state for the given device id

Load the ping state for the given device id

Parameters

$devid
The device id.
abstract public array
# getKnownFolders( )

Get the list of known folders for the specified syncState

Get the list of known folders for the specified syncState

Returns

array
An array of server folder ids
abstract public
# save( )

Save the current syncstate to storage

Save the current syncstate to storage

abstract 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
A stat/change hash describing the change
$origin
Flag to indicate the origin of the change.
$user
The current synch user
abstract public boolean
# setFolderData( object $device, array $folders )

Save folder data for a specific device. This is needed for BC with older activesync versions that use GETHIERARCHY requests to get the folder info instead of maintaining the folder state with FOLDERSYNC requests.

Save folder data for a specific device. This is needed for BC with older activesync versions that use GETHIERARCHY requests to get the folder info instead of maintaining the folder state with FOLDERSYNC requests.

Parameters

$device
The device object
$folders
The folder data

Returns

boolean

Throws

Horde_ActiveSync_Exception
abstract public mixed
# getFolderData( object $device, string $class )

Get the folder data for a specific device

Get the folder data for a specific device

Parameters

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

Returns

mixed
Either an array of folder data || false
abstract public array
# getChanges( integer $flags = 0 )

Get all items that have changed since the last sync time

Get all items that have changed since the last sync time

Parameters

$flags

Returns

array
abstract 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
abstract 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
abstract 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
abstract public boolean
# setDeviceRWStatus( string $devid, string $status )

Set a new remotewipe status for the device

Set a new remotewipe status for the device

Parameters

$devid
$status

Returns

boolean
abstract public StdClass
# loadDeviceInfo( object $device, string $user )

Obtain the device object.

Obtain the device object.

Parameters

$device
$user

Returns

StdClass
abstract 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
The device id to check
$user
The device should be owned by this user.

Returns

boolean
abstract public boolean
# setDeviceInfo( object $data )

Set new device info

Set new device info

Parameters

$data
$device The device information

Returns

boolean
abstract public
# removeState( string $synckey = null, string $devId = null )

Explicitly remove a state from storage.

Explicitly remove a state from storage.

Parameters

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

Throws

Horde_ActiveSyncException
abstract 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
abstract public
# setHeartbeatInterval( integer $heartbeat )

Set the device's heartbeat interval

Set the device's heartbeat interval

Parameters

$heartbeat
The interval (in seconds).
abstract 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
abstract public integer
# getLastSyncTimestamp( )

Get the last time the currently loaded device issued a SYNC request.

Get the last time the currently loaded device issued a SYNC request.

Returns

integer
The timestamp of the last sync, regardless of collection

Throws

Horde_ActiveSync_Exception
Constants summary
integer FILTERTYPE_ALL

Filtertype constants

Filtertype constants

# 0
integer FILTERTYPE_1DAY
# 1
integer FILTERTYPE_3DAYS
# 2
integer FILTERTYPE_1WEEK
# 3
integer FILTERTYPE_2WEEKS
# 4
integer FILTERTYPE_1MONTH
# 5
integer FILTERTYPE_3MONTHS
# 6
integer FILTERTYPE_6MONTHS
# 7
API documentation generated by ApiGen