PHP 클래스 Horde_SyncMl_Sync, horde

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
저자: Anthony Mills ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_clientAnchorNext integer Sync Anchors determine the interval from which changes are retrieved.
$_client_add_count integer Number of objects that have been sent to the server for adding.
$_client_addreplaces integer Add due to client replace request when map entry is not found. Happens during SlowSync.
$_client_delete_count integer Number of objects that have been sent to the server for deletion.
$_client_replace_count integer Number of objects that have been sent to the server for replacement.
$_errors integer Number of failed actions, for logging purposes only.
$_expectingMapData boolean Map data is expected whenever an add is sent to the client.
$_serverAnchorLast
$_serverAnchorNext
$_server_add_count integer Number of objects that have been sent to the client for adding.
$_server_adds array List of object UIDs (in the keys) that have been added on the server since the last synchronization and are supposed to be sent to the client.
$_server_delete_count integer Number of objects that have been sent to the client for deletion.
$_server_deletes array List of object UIDs (in the keys) that have been deleted on the server since the last synchronization and are supposed to be sent to the client.
$_server_largeobj array Array holding the remaining content when splitting a large object into multiple messages. Keys are numeric, values are: command, chunkContent, clientContentType, clientEncodingType, cuid, suid
$_server_replace_count integer Number of objects that have been sent to the client for replacement.
$_server_replaces array List of object UIDs (in the keys) that have been changed on the server since the last synchronization and are supposed to be sent to the client.
$_server_task_adds array This is only used for clients handling tasks and events in one database. We need to seperately store the server tasks adds, so when we get a Map command from the client, we know whether to put this in tasks or calendar.
$_sourceLocURI string Source (server) URI (database).
$_state constant A sync starts in Horde_SyncMl_Sync::STATE_INIT and moves on to the next state with every received from the client: Horde_SyncMl_Sync::STATE_INIT, Horde_SyncMl_Sync::STATE_SYNC, Horde_SyncMl_Sync::STATE_MAP, Horde_SyncMl_Sync::STATE_COMPLETED. Horde_SyncMl_Sync::STATE_MAP doesn't occur for _FROM_CLIENT syncs.
$_syncType integer The synchronization method, one of the Horde_SyncMl::ALERT_* constants.
$_syncsReceived integer Counts the s received by the server. Currently unused.
$_syncsSent integer Counts the s sent by the server.
$_targetLocURI string Target (client) URI (database).

공개 메소드들

메소드 설명
__construct ( string $syncType, string $serverURI, string $clientURI, integer $serverAnchorLast, integer $serverAnchorNext, string $clientAnchorNext )
addSyncReceived ( )
closeSync ( ) Completes a sync once everything is done: store the sync anchors so the next sync can be a delta sync and produce some debug info.
createSyncOutput ( &$output ) Creates a output containing the server changes.
createUidMap ( $databaseURI, $cuid, $suid )
getClientAnchorNext ( )
getClientLocURI ( )
getServerAnchorLast ( )
getServerAnchorNext ( )
getServerChange ( string $change, string $id ) : string Returns the client ID of server change identified by the change type and server ID.
getServerLocURI ( )
getSyncsReceived ( ) * Currently unused
handleClientSyncItem ( &$output, Horde_SyncMl_SyncElement &$item ) Here's where the actual processing of a client-sent Sync Item takes place. Entries are added, deleted or replaced from the server database by using backend API calls.
handleFinal ( &$output, $debug = false ) Notifies the sync that a final has been received by the client.
hasPendingElements ( ) Returns true if there are still outstanding server sync items to be sent to the client.
isComplete ( )
setServerChange ( string $change, string $sid, string $cid ) Sets the client ID of server change identified by the change type and server ID.
unsetServerChange ( string $change, string $id ) Unsets the server-client-map of server change identified by the change type and server ID.

보호된 메소드들

메소드 설명
_getServerLargeObjChunk ( integer $chunkLength ) : string Get the next chunk from the cached large object with maximum length of chunkLength or return false.
_retrieveChanges ( string $syncDB, array &$adds, array &$replaces, array &$deletes ) Retrieves and condenses the changes on the server side since the last synchronization.
_taskToCalendar ( $databaseURI ) Converts a calendar databaseURI to a tasks databaseURI for devices with handleTasksInCalendar.

메소드 상세

__construct() 공개 메소드

public __construct ( string $syncType, string $serverURI, string $clientURI, integer $serverAnchorLast, integer $serverAnchorNext, string $clientAnchorNext )
$syncType string
$serverURI string
$clientURI string
$serverAnchorLast integer
$serverAnchorNext integer
$clientAnchorNext string

_getServerLargeObjChunk() 보호된 메소드

Get the next chunk from the cached large object with maximum length of chunkLength or return false.
protected _getServerLargeObjChunk ( integer $chunkLength ) : string
$chunkLength integer The maximum length of the chunk.
리턴 string The next chunk of the cached large object.

_retrieveChanges() 보호된 메소드

Retrieves and condenses the changes on the server side since the last synchronization.
protected _retrieveChanges ( string $syncDB, array &$adds, array &$replaces, array &$deletes )
$syncDB string The database being synchronized.
$adds array Will be set with the server-client-uid mappings of added objects.
$replaces array Will be set with the server-client-uid mappings of changed objects.
$deletes array Will be set with the server-client-uid mappings of deleted objects.

_taskToCalendar() 보호된 메소드

Converts a calendar databaseURI to a tasks databaseURI for devices with handleTasksInCalendar.
protected _taskToCalendar ( $databaseURI )

addSyncReceived() 공개 메소드

public addSyncReceived ( )

closeSync() 공개 메소드

Completes a sync once everything is done: store the sync anchors so the next sync can be a delta sync and produce some debug info.
public closeSync ( )

createSyncOutput() 공개 메소드

Creates a output containing the server changes.
public createSyncOutput ( &$output )

createUidMap() 공개 메소드

public createUidMap ( $databaseURI, $cuid, $suid )

getClientAnchorNext() 공개 메소드

public getClientAnchorNext ( )

getClientLocURI() 공개 메소드

public getClientLocURI ( )

getServerAnchorLast() 공개 메소드

public getServerAnchorLast ( )

getServerAnchorNext() 공개 메소드

public getServerAnchorNext ( )

getServerChange() 공개 메소드

Returns the client ID of server change identified by the change type and server ID.
public getServerChange ( string $change, string $id ) : string
$change string The change type (add, replace, delete).
$id string The object's server UID.
리턴 string The matching client ID or null if none found.

getServerLocURI() 공개 메소드

public getServerLocURI ( )

getSyncsReceived() 공개 메소드

* Currently unused
public getSyncsReceived ( )

handleClientSyncItem() 공개 메소드

Here's where the actual processing of a client-sent Sync Item takes place. Entries are added, deleted or replaced from the server database by using backend API calls.
public handleClientSyncItem ( &$output, Horde_SyncMl_SyncElement &$item )
$output
$item Horde_SyncMl_SyncElement

handleFinal() 공개 메소드

Depending on the current state of the sync this can mean various things: a) Init phase (Alerts) done. Next package contaings actual syncs. b) Sync sending from client done. Next package are maps (or finish or finish if ONE_WAY_FROM_CLIENT sync c) Maps finished, completly done.
public handleFinal ( &$output, $debug = false )

hasPendingElements() 공개 메소드

This is the case if the MaxMsgSize has been reached and the pending elements are to be sent in another message.
public hasPendingElements ( )

isComplete() 공개 메소드

public isComplete ( )

setServerChange() 공개 메소드

Sets the client ID of server change identified by the change type and server ID.
public setServerChange ( string $change, string $sid, string $cid )
$change string The change type (add, replace, delete).
$sid string The object's server UID.
$cid string The object's client UID.

unsetServerChange() 공개 메소드

Unsets the server-client-map of server change identified by the change type and server ID.
public unsetServerChange ( string $change, string $id )
$change string The change type (add, replace, delete).
$id string The object's server UID.

프로퍼티 상세

$_clientAnchorNext 보호되어 있는 프로퍼티

Sync Anchors determine the interval from which changes are retrieved.
protected int $_clientAnchorNext
리턴 integer

$_client_add_count 보호되어 있는 프로퍼티

Number of objects that have been sent to the server for adding.
protected int $_client_add_count
리턴 integer

$_client_addreplaces 보호되어 있는 프로퍼티

Add due to client replace request when map entry is not found. Happens during SlowSync.
protected int $_client_addreplaces
리턴 integer

$_client_delete_count 보호되어 있는 프로퍼티

Number of objects that have been sent to the server for deletion.
protected int $_client_delete_count
리턴 integer

$_client_replace_count 보호되어 있는 프로퍼티

Number of objects that have been sent to the server for replacement.
protected int $_client_replace_count
리턴 integer

$_errors 보호되어 있는 프로퍼티

Number of failed actions, for logging purposes only.
protected int $_errors
리턴 integer

$_expectingMapData 보호되어 있는 프로퍼티

Map data is expected whenever an add is sent to the client.
protected bool $_expectingMapData
리턴 boolean

$_serverAnchorLast 보호되어 있는 프로퍼티

protected $_serverAnchorLast

$_serverAnchorNext 보호되어 있는 프로퍼티

protected $_serverAnchorNext

$_server_add_count 보호되어 있는 프로퍼티

Number of objects that have been sent to the client for adding.
protected int $_server_add_count
리턴 integer

$_server_adds 보호되어 있는 프로퍼티

List of object UIDs (in the keys) that have been added on the server since the last synchronization and are supposed to be sent to the client.
protected array $_server_adds
리턴 array

$_server_delete_count 보호되어 있는 프로퍼티

Number of objects that have been sent to the client for deletion.
protected int $_server_delete_count
리턴 integer

$_server_deletes 보호되어 있는 프로퍼티

List of object UIDs (in the keys) that have been deleted on the server since the last synchronization and are supposed to be sent to the client.
protected array $_server_deletes
리턴 array

$_server_largeobj 보호되어 있는 프로퍼티

Array holding the remaining content when splitting a large object into multiple messages. Keys are numeric, values are: command, chunkContent, clientContentType, clientEncodingType, cuid, suid
protected array $_server_largeobj
리턴 array

$_server_replace_count 보호되어 있는 프로퍼티

Number of objects that have been sent to the client for replacement.
protected int $_server_replace_count
리턴 integer

$_server_replaces 보호되어 있는 프로퍼티

List of object UIDs (in the keys) that have been changed on the server since the last synchronization and are supposed to be sent to the client.
protected array $_server_replaces
리턴 array

$_server_task_adds 보호되어 있는 프로퍼티

This is only used for clients handling tasks and events in one database. We need to seperately store the server tasks adds, so when we get a Map command from the client, we know whether to put this in tasks or calendar.
protected array $_server_task_adds
리턴 array

$_sourceLocURI 보호되어 있는 프로퍼티

Source (server) URI (database).
protected string $_sourceLocURI
리턴 string

$_state 보호되어 있는 프로퍼티

A sync starts in Horde_SyncMl_Sync::STATE_INIT and moves on to the next state with every received from the client: Horde_SyncMl_Sync::STATE_INIT, Horde_SyncMl_Sync::STATE_SYNC, Horde_SyncMl_Sync::STATE_MAP, Horde_SyncMl_Sync::STATE_COMPLETED. Horde_SyncMl_Sync::STATE_MAP doesn't occur for _FROM_CLIENT syncs.
protected constant $_state
리턴 constant

$_syncType 보호되어 있는 프로퍼티

The synchronization method, one of the Horde_SyncMl::ALERT_* constants.
protected int $_syncType
리턴 integer

$_syncsReceived 보호되어 있는 프로퍼티

Counts the s received by the server. Currently unused.
protected int $_syncsReceived
리턴 integer

$_syncsSent 보호되어 있는 프로퍼티

Counts the s sent by the server.
protected int $_syncsSent
리턴 integer

$_targetLocURI 보호되어 있는 프로퍼티

Target (client) URI (database).
protected string $_targetLocURI
리턴 string