\Horde_SyncMl_State

The Horde_SyncMl_State class provides a SyncML state object.

Copyright 2003-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.

Summary

Methods
Properties
Constants
__construct()
getVerDTD()
getDevInfURI()
getProtocolName()
setVersion()
getURI()
getDevice()
setSync()
getSync()
getSyncs()
hasPendingSyncs()
getPendingSyncs()
isAllSyncsComplete()
handleFinal()
$sessionID
$messageID
$targetURI
$sourceURI
$version
$user
$authenticated
$uriMeta
$uriDevInf
$wbxml
$maxMsgSize
$maxObjSize
$serverChanges
$deviceInfo
$curSyncItem
$delayedFinal
No constants found
No protected methods found
$_uri
$_syncs
$_deviceDriver
N/A
No private methods found
No private properties found
N/A

Properties

$sessionID

$sessionID : string

Id of this SyncML session.

This is not to confuse with the PHP session id, though it is part of the generated PHP session id.

Type

string

$messageID

$messageID : integer

Id of the current message.

Type

integer

$targetURI

$targetURI : string

The target URI as sent by the client.

This is normally the URL of the RPC server. However the client is free to send anything.

Type

string

$sourceURI

$sourceURI : string

The source URI as sent by the client.

Can be used to identify the client and is part of the PHP session id.

Type

string

$version

$version : integer

SyncML protocol version.

0 for SyncML 1.0, 1 for SyncML 1.1, etc.

Type

integer

$user

$user : string

Username used to authenticate with the backend.

Type

string

$authenticated

$authenticated : boolean

Whether this session has authenticated successfully.

Type

boolean

$uriMeta

$uriMeta : string

<Meta> namespace uri.

Type

string

$uriDevInf

$uriDevInf : string

<DevInf> namespace uri.

Type

string

$wbxml

$wbxml : boolean

Whether WBXML encoding is used.

Type

boolean

$maxMsgSize

$maxMsgSize : integer

The maximum allowed message size in bytes.

Type

integer

$maxObjSize

$maxObjSize : integer

The maximum allowed object size in bytes.

Type

integer

$serverChanges

$serverChanges : array

The list of all server changes being sent to the client as a reference for Status responses from the client.

Type

array

$deviceInfo

$deviceInfo : \Horde_SyncMl_DeviceInfo

Device info provided by the SyncML DevInf data.

Type

\Horde_SyncMl_DeviceInfo

$curSyncItem

$curSyncItem : \Horde_SyncMl_SyncElement

Current sync element sent from client.

Stored in state if one element is split into multiple message packets.

Type

\Horde_SyncMl_SyncElement

$delayedFinal

$delayedFinal : boolean

Flag that is set if the client sends a Final but we are not finished with the current package and thus can't final this package yet.

Type

boolean

$_uri

$_uri : string

<SyncML> namespace uri.

Type

string

$_syncs

$_syncs : array

Array of Horde_SyncMl_Sync objects.

Type

array

$_deviceDriver

$_deviceDriver : string

Name of the appropriate device driver.

Type

string

Methods

__construct()

__construct(  $sourceURI,   $user,   $sessionID) 

Constructor.

Parameters

$sourceURI
$user
$sessionID

getVerDTD()

getVerDTD() 

Returns the <DevInf><VerDTD> content based on the protocol version.

getDevInfURI()

getDevInfURI() 

Returns the DevInf URI based on the protocol version.

getProtocolName()

getProtocolName() 

Returns the protocol name based on the protocol version.

setVersion()

setVersion(integer  $version) 

Sets the protocol version

Parameters

integer $version

The protocol version: 0 for SyncML 1.0, 1 for SyncML 1.1 etc.

getURI()

getURI() : string

Returns the namespace URI for the <SyncML> element.

Returns

string —

The namespace URI to use, if any.

getDevice()

getDevice() : \Horde_SyncMl_Device

Returns a Horde_SyncMl_Device instance for the device used in this session.

Returns

\Horde_SyncMl_Device

A Horde_SyncMl_Device instance.

setSync()

setSync(string  $target, \Horde_SyncMl_Sync  $sync) 

Parameters

string $target
\Horde_SyncMl_Sync $sync

getSync()

getSync(string  $target) : \Horde_SyncMl_Sync

Parameters

string $target

Returns

\Horde_SyncMl_Sync

getSyncs()

getSyncs() : array

Returns

array

hasPendingSyncs()

hasPendingSyncs() : boolean

Returns whether there are any pending elements that have not been sent to due to message size restrictions. These will be sent int the next message.

Returns

boolean —

True if there are pending elements that have yet to be sent.

getPendingSyncs()

getPendingSyncs() : array

Returns all syncs which have pending elements left.

Returns

array —

Array of TargetLocURIs which can be used as a key in getSync() calls.

isAllSyncsComplete()

isAllSyncsComplete() : boolean

Returns whether all syncs are in completed state or no syncs are present.

Returns

boolean —

True if all syncs are in completed state.

handleFinal()

handleFinal(  $output,   $debug = false) 

Propagates final tags here and then further to every sync.

This allows the sync objects to determine if they are complete.

Parameters

$output
$debug