PHP Класс Horde_ActiveSync_Collections, horde

Автор: Michael J Rubinsky ([email protected])
Наследование: implements IteratorAggregate
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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.
protected _haveNoChangesInPartialSync ( ) : boolean
Результат boolean

_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