PHP 클래스 Horde_ActiveSync_Collections, horde

저자: Michael J Rubinsky ([email protected])
상속: implements IteratorAggregate
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_as Horde_ActiveSync The ActiveSync server object.
$_cache Horde_ActiveSync_SyncCache The syncCache
$_changedCollections array Cache of collections that have had changes detected.
$_changes array Cache of changes.
$_collections array The collection data
$_globalWindowSize integer Global WINDOWSIZE Defaults to 100 (MS-ASCMD 2.2.3.188)
$_hangingSync boolean Flag to indicate the client is requesting a hanging SYNC.
$_importedChanges boolean Imported changes flag.
$_logger Horde_Log_Logger The logger
$_procid integer Cache the process id for logging.
$_shortSyncRequest boolean Short sync request flag.
$_synckeyCount integer Count of available synckeys
$_tempSyncCache Horde_ActiveSync_SyncCache Cache a temporary syncCache.
$_unchangedCount integer Count of unchanged collections calculated for PARTIAL sync.
$_windowsizeOverride boolean Flag to indicate we have overridden the globalWindowSize

공개 메소드들

메소드 설명
__call ( $method, $parameters ) Magic.
__construct ( Horde_ActiveSync_SyncCache $cache, Horde_ActiveSync $as ) Const'r
__get ( $property ) Property getter
__set ( $property, $value ) Property setter.
addCollection ( array $collection, boolean $requireSyncKey = false ) Add a new populated collection array to the sync cache.
cachedCollectionCount ( ) : integer Return the count of collections in the cache only.
canDoLoopingSync ( ) : boolean Return whether or not we want a looping sync. We can do a looping sync if we have no imported changes AND we have either a hbinterval, wait, or a shortSync.
canSendEmptyResponse ( ) : boolean Return if we can do an empty response
checkFilterType ( string $id, string $filter ) : boolean Check for an update FILTERTYPE
checkStaleRequest ( ) : boolean Return if the current looping sync is stale. A stale looping sync is one which has begun earlier than the most recently running sync reported by the syncCache.
collectionCount ( ) : integer Return the count of available collections.
deleteFolderFromHierarchy ( $uid ) Delete a folder from the hierarchy cache.
ensureOptions ( ) Ensure default OPTIONS values are populated, while not overwriting any existing values.
getBackendIdForFolderUid ( $folderid ) : string Translate an EAS folder uid into a backend serverid.
getChangesFlag ( string $collection_id ) : boolean Get the getchanges flag on the specified collection.
getCollectionChangeCount ( boolean $ping = false ) : integer Return the count of the current collection's chagnes.
getCollectionChanges ( boolean $ping = false, array $ensure = [] ) : array Return any changes for the current collection.
getCollectionClass ( string $id ) : string | boolean Return a collection class given the collection id.
getCollectionType ( $id )
getDefaultWindowSize ( )
getFolderUidForBackendId ( string $folderid ) : string Translate a backend id E.g., INBOX into an EAS folder uid.
getHeartbeat ( ) : integer | boolean Return the heartbeat interval. Always returned as the heartbeat (seconds) not wait interval (minutes).
getHierarchyChanges ( ) : array Return all know hierarchy changes.
getIterator ( ) Iterator
getNewCollection ( ) : array Get a new collection array, populated with default values.
haveHierarchy ( ) : boolean Return if we have a current folder hierarchy.
havePingableCollections ( ) : boolean Check if we have any pingable collections.
haveSyncableCollections ( long $version ) : boolean Determine if we have any syncable collections either locally or in the sync cache.
initCollectionState ( array &$collection, boolean $requireSyncKey = false ) Attempt to initialize the sync state.
initEmptySync ( ) : boolean Prepare the syncCache for an EMPTY sync request.
initFullSync ( ) Prepares the syncCache for a full sync request.
initHierarchySync ( string $synckey ) : array Prepare for a hierarchy sync.
initPartialSync ( ) : boolean Prepares the syncCache for a partial sync request and checks that it is allowed.
loadCollectionsFromCache ( ) Load all the collections we know about from the cache.
pollForChanges ( integer $heartbeat, integer $interval, array $options = [] ) : boolean | integer Poll the backend for changes.
resetPingCache ( ) Force reset all collection's PINGABLE flag. Used to force client to issue a non-empty PING request.
save ( boolean $preserve_folders = false ) Save the syncCache to storage.
setDefaultWindowSize ( integer $window, boolean $override = false ) Sets the default WINDOWSIZE.
setGetChangesFlag ( string $collection_id ) Set the getchanges flag on the specified collection.
setHeartbeat ( array $hb ) Set the looping sync heartbeat values.
updateCache ( ) Update the syncCache with current collection data.
updateCollectionsFromCache ( ) Updates data from the cache for collectons that are already loaded. Used to ensure looping SYNC and PING requests are operating on the most recent syncKey.
updateFolderinHierarchy ( Horde_ActiveSync_Message_Folder $folder, boolean $update = false ) Update/Add a folder in the hierarchy cache.
updateHierarchyKey ( string $key ) Update the hierarchy synckey in the cache.
updatePingableFlag ( ) Marks all loaded collections with a synckey as pingable.
validateFromCache ( ) Validates the collection data from the syncCache, filling in missing values from the folder cache.
validateHierarchyChanges ( Horde_ActiveSync_Connector_Exporter_FolderSync $exporter, array $seenFolders ) Validate and perform some sanity checks on the hierarchy changes before being sent to the client.

보호된 메소드들

메소드 설명
_checkConfirmedKeys ( )
_getMissingCollectionsFromCache ( ) Populate the collections data with missing data from the syncCache during a PARTIAL SYNC.
_haveNoChangesInPartialSync ( ) : boolean Return if we have no changes to collection options, but have requested a partial sync. A partial sync must have either a wait, hbinterval, or some subset of collections to be valid.
_sleep ( integer $interval ) Wait for specified interval, and close any backend connections while we wait.

메소드 상세

__call() 공개 메소드

..
public __call ( $method, $parameters )

__construct() 공개 메소드

Const'r
public __construct ( Horde_ActiveSync_SyncCache $cache, Horde_ActiveSync $as )
$cache Horde_ActiveSync_SyncCache The SyncCache.
$as Horde_ActiveSync The ActiveSync server object.

__get() 공개 메소드

Property getter
public __get ( $property )

__set() 공개 메소드

Property setter.
public __set ( $property, $value )

_checkConfirmedKeys() 보호된 메소드

protected _checkConfirmedKeys ( )

_getMissingCollectionsFromCache() 보호된 메소드

Populate the collections data with missing data from the syncCache during a PARTIAL SYNC.

_haveNoChangesInPartialSync() 보호된 메소드

Return if we have no changes to collection options, but have requested a partial sync. A partial sync must have either a wait, hbinterval, or some subset of collections to be valid.

_sleep() 보호된 메소드

Wait for specified interval, and close any backend connections while we wait.
protected _sleep ( integer $interval )
$interval integer The number of seconds to sleep.

addCollection() 공개 메소드

Add a new populated collection array to the sync cache.
public addCollection ( array $collection, boolean $requireSyncKey = false )
$collection array The collection array.
$requireSyncKey boolean Attempt to read missing synckey from cache if true. If not found, set to 0.

cachedCollectionCount() 공개 메소드

Return the count of collections in the cache only.
public cachedCollectionCount ( ) : integer
리턴 integer

canDoLoopingSync() 공개 메소드

Return whether or not we want a looping sync. We can do a looping sync if we have no imported changes AND we have either a hbinterval, wait, or a shortSync.
public canDoLoopingSync ( ) : boolean
리턴 boolean True if we want a looping sync, false otherwise.

canSendEmptyResponse() 공개 메소드

Return if we can do an empty response
public canSendEmptyResponse ( ) : boolean
리턴 boolean

checkFilterType() 공개 메소드

Check for an update FILTERTYPE
public checkFilterType ( string $id, string $filter ) : boolean
$id string The collection id to check
$filter string The new filter value.
리턴 boolean True if filtertype passed, false if it has changed.

checkStaleRequest() 공개 메소드

Return if the current looping sync is stale. A stale looping sync is one which has begun earlier than the most recently running sync reported by the syncCache.
public checkStaleRequest ( ) : boolean
리턴 boolean True if the current looping sync is stale. False otherwise.

collectionCount() 공개 메소드

Return the count of available collections.
public collectionCount ( ) : integer
리턴 integer

deleteFolderFromHierarchy() 공개 메소드

Delete a folder from the hierarchy cache.
public deleteFolderFromHierarchy ( $uid )

ensureOptions() 공개 메소드

Ensure default OPTIONS values are populated, while not overwriting any existing values.
부터: 2.20.0
public ensureOptions ( )

getBackendIdForFolderUid() 공개 메소드

Translate an EAS folder uid into a backend serverid.
public getBackendIdForFolderUid ( $folderid ) : string
리턴 string The backend server id.

getChangesFlag() 공개 메소드

Get the getchanges flag on the specified collection.
public getChangesFlag ( string $collection_id ) : boolean
$collection_id string The collection id.
리턴 boolean

getCollectionChangeCount() 공개 메소드

Return the count of the current collection's chagnes.
public getCollectionChangeCount ( boolean $ping = false ) : integer
$ping boolean Only ping the collection if true.
리턴 integer The change count.

getCollectionChanges() 공개 메소드

Return any changes for the current collection.
public getCollectionChanges ( boolean $ping = false, array $ensure = [] ) : array
$ping boolean True if this is a PING request, false otherwise. If true, we only detect that a change has occured, not the data on all of the changes.
$ensure array An array of UIDs that should be sent in the current response if possible, and not put off because of a MOREAVAILABLE situation. @deprecated and no longer used.
리턴 array The changes array.

getCollectionClass() 공개 메소드

Return a collection class given the collection id.
public getCollectionClass ( string $id ) : string | boolean
$id string The collection id.
리턴 string | boolean The collection class or false if not found.

getCollectionType() 공개 메소드

public getCollectionType ( $id )

getDefaultWindowSize() 공개 메소드

getFolderUidForBackendId() 공개 메소드

Translate a backend id E.g., INBOX into an EAS folder uid.
public getFolderUidForBackendId ( string $folderid ) : string
$folderid string The backend id.
리턴 string The EAS uid.

getHeartbeat() 공개 메소드

Return the heartbeat interval. Always returned as the heartbeat (seconds) not wait interval (minutes).
public getHeartbeat ( ) : integer | boolean
리턴 integer | boolean The number of seconds in a heartbeat, or false if no heartbeat set.

getHierarchyChanges() 공개 메소드

Return all know hierarchy changes.
public getHierarchyChanges ( ) : array
리턴 array An array of changes.

getIterator() 공개 메소드

Iterator
public getIterator ( )

getNewCollection() 공개 메소드

Get a new collection array, populated with default values.
public getNewCollection ( ) : array
리턴 array

haveHierarchy() 공개 메소드

Return if we have a current folder hierarchy.
public haveHierarchy ( ) : boolean
리턴 boolean

havePingableCollections() 공개 메소드

Check if we have any pingable collections.
public havePingableCollections ( ) : boolean
리턴 boolean True if we have collections marked as pingable.

haveSyncableCollections() 공개 메소드

Determine if we have any syncable collections either locally or in the sync cache.
public haveSyncableCollections ( long $version ) : boolean
$version long The EAS version
리턴 boolean

initCollectionState() 공개 메소드

Attempt to initialize the sync state.
public initCollectionState ( array &$collection, boolean $requireSyncKey = false )
$collection array The collection array.
$requireSyncKey boolean Require collection to have a synckey and throw exception if it's not present.

initEmptySync() 공개 메소드

Prepare the syncCache for an EMPTY sync request.
부터: 2.25.0
public initEmptySync ( ) : boolean
리턴 boolean False if EMPTY request cannot be performed, otherwise true.

initFullSync() 공개 메소드

Prepares the syncCache for a full sync request.
public initFullSync ( )

initHierarchySync() 공개 메소드

Prepare for a hierarchy sync.
public initHierarchySync ( string $synckey ) : array
$synckey string The current synckey from the client.
리턴 array An array of known folders.

initPartialSync() 공개 메소드

MS-ASCMD 2.2.3.124
public initPartialSync ( ) : boolean
리턴 boolean True if parital sync is possible, false otherwise.

loadCollectionsFromCache() 공개 메소드

Load all the collections we know about from the cache.

pollForChanges() 공개 메소드

Poll the backend for changes.
public pollForChanges ( integer $heartbeat, integer $interval, array $options = [] ) : boolean | integer
$heartbeat integer The heartbeat lifetime to wait for changes.
$interval integer The wait interval between poll iterations.
$options array An options array containing any of: - pingable: (boolean) Only poll collections with the pingable flag set. DEFAULT: false
리턴 boolean | integer True if changes were detected in any of the collections, false if no changes detected or a status code if failed.

resetPingCache() 공개 메소드

Force reset all collection's PINGABLE flag. Used to force client to issue a non-empty PING request.
public resetPingCache ( )

save() 공개 메소드

Save the syncCache to storage.
public save ( boolean $preserve_folders = false )
$preserve_folders boolean If true, ensure the folder cache is not overwritten. @since 2.18.0

setDefaultWindowSize() 공개 메소드

Note that this is really a ceiling on the number of TOTAL responses that can be sent (including all collections). This method should be renamed for 3.0
public setDefaultWindowSize ( integer $window, boolean $override = false )
$window integer The windowsize
$override boolean If true, this value will override any client supplied value.

setGetChangesFlag() 공개 메소드

Set the getchanges flag on the specified collection.
public setGetChangesFlag ( string $collection_id )
$collection_id string The collection id.

setHeartbeat() 공개 메소드

Set the looping sync heartbeat values.
public setHeartbeat ( array $hb )
$hb array An array containing one or both of: hbinterval, wait.

updateCache() 공개 메소드

Update the syncCache with current collection data.
public updateCache ( )

updateCollectionsFromCache() 공개 메소드

Updates data from the cache for collectons that are already loaded. Used to ensure looping SYNC and PING requests are operating on the most recent syncKey.

updateFolderinHierarchy() 공개 메소드

Update/Add a folder in the hierarchy cache.
public updateFolderinHierarchy ( Horde_ActiveSync_Message_Folder $folder, boolean $update = false )
$folder Horde_ActiveSync_Message_Folder The folder object.
$update boolean Update the state objects? @since 2.4.0

updateHierarchyKey() 공개 메소드

Update the hierarchy synckey in the cache.
public updateHierarchyKey ( string $key )
$key string The new/existing synckey.

updatePingableFlag() 공개 메소드

Marks all loaded collections with a synckey as pingable.
public updatePingableFlag ( )

validateFromCache() 공개 메소드

Validates the collection data from the syncCache, filling in missing values from the folder cache.
public validateFromCache ( )

validateHierarchyChanges() 공개 메소드

Validate and perform some sanity checks on the hierarchy changes before being sent to the client.
public validateHierarchyChanges ( Horde_ActiveSync_Connector_Exporter_FolderSync $exporter, array $seenFolders )
$exporter Horde_ActiveSync_Connector_Exporter_FolderSync The exporter.
$seenFolders array An array of folders.

프로퍼티 상세

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

The ActiveSync server object.
protected Horde_ActiveSync $_as
리턴 Horde_ActiveSync

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

The syncCache
protected Horde_ActiveSync_SyncCache $_cache
리턴 Horde_ActiveSync_SyncCache

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

Cache of collections that have had changes detected.
protected array $_changedCollections
리턴 array

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

Cache of changes.
protected array $_changes
리턴 array

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

The collection data
protected array $_collections
리턴 array

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

Global WINDOWSIZE Defaults to 100 (MS-ASCMD 2.2.3.188)
protected int $_globalWindowSize
리턴 integer

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

Flag to indicate the client is requesting a hanging SYNC.
protected bool $_hangingSync
리턴 boolean

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

Imported changes flag.
protected bool $_importedChanges
리턴 boolean

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

The logger
protected Horde_Log_Logger $_logger
리턴 Horde_Log_Logger

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

Cache the process id for logging.
protected int $_procid
리턴 integer

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

Short sync request flag.
protected bool $_shortSyncRequest
리턴 boolean

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

Count of available synckeys
protected int $_synckeyCount
리턴 integer

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

Cache a temporary syncCache.
protected Horde_ActiveSync_SyncCache $_tempSyncCache
리턴 Horde_ActiveSync_SyncCache

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

Count of unchanged collections calculated for PARTIAL sync.
protected int $_unchangedCount
리턴 integer

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

Flag to indicate we have overridden the globalWindowSize
protected bool $_windowsizeOverride
리턴 boolean