\Horde_Kolab_Storage_Driver_Decorator_Timer

A stop watch decorator for outgoing requests from the Kolab storage drivers.

Copyright 2010-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()
getDriverName()
createBackend()
getBackend()
setBackend()
getParser()
setParser()
getAuth()
getId()
getParameters()
hasCatenateSupport()
listFolders()
create()
delete()
rename()
hasAclSupport()
getAcl()
getMyAcl()
setAcl()
deleteAcl()
listAnnotation()
getAnnotation()
setAnnotation()
getNamespace()
getStamp()
getStampFromToken()
status()
getUids()
fetch()
fetchStructure()
fetchBodypart()
fetchComplete()
fetchHeaders()
appendMessage()
deleteMessages()
moveMessage()
expunge()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$_driver
$_logger
$_timer
N/A

Properties

$_logger

$_logger : mixed

A log handler.

Type

mixed

$_timer

$_timer : \Horde_Support_Timer

A stop watch.

Type

\Horde_Support_Timer

Methods

__construct()

__construct(\Horde_Kolab_Storage_Driver  $driver, \Horde_Support_Timer  $timer, mixed  $logger) 

Constructor.

Parameters

\Horde_Kolab_Storage_Driver $driver

The decorated driver.

\Horde_Support_Timer $timer

A stop watch.

mixed $logger

The log handler. This instance must provide the debug() method.

getDriverName()

getDriverName() : string

Return the class name of the decorated driver.

Returns

string —

The class name of the decorated driver.

createBackend()

createBackend() : mixed

Create the backend driver.

Returns

mixed —

The backend driver.

getBackend()

getBackend() : mixed

Returns the actual backend driver.

If there is no driver set the driver should be constructed within this method.

Returns

mixed —

The backend driver.

setBackend()

setBackend(mixed  $backend) : NULL

Set the backend driver.

Parameters

mixed $backend

The driver that should be used.

Returns

NULL

getParser()

getParser() : \Horde_Kolab_Storage_Data_Parser

Returns the parser for data objects.

Returns

\Horde_Kolab_Storage_Data_Parser —

The parser.

setParser()

setParser(mixed  $parser) : NULL

Set the data parser.

Parameters

mixed $parser

The parser that should be used.

Returns

NULL

getAuth()

getAuth() : string

Return the id of the user currently authenticated.

Returns

string —

The id of the user that opened the connection.

getId()

getId() : string

Return the unique connection id.

Returns

string —

The connection id.

getParameters()

getParameters() : array

Return the connection parameters.

Returns

array —

The connection parameters.

hasCatenateSupport()

hasCatenateSupport() : boolean

Checks if the backend supports CATENATE.

Returns

boolean —

True if the backend supports CATENATE.

listFolders()

listFolders() : array

Retrieves a list of mailboxes from the server.

Returns

array —

The list of mailboxes.

create()

create(string  $folder) : NULL

Create the specified folder.

Parameters

string $folder

The folder to create.

Returns

NULL

delete()

delete(string  $folder) : NULL

Delete the specified folder.

Parameters

string $folder

The folder to delete.

Returns

NULL

rename()

rename(string  $old, string  $new) : NULL

Rename the specified folder.

Parameters

string $old

The folder to rename.

string $new

The new name of the folder.

Returns

NULL

hasAclSupport()

hasAclSupport() : boolean

Does the backend support ACL?

Returns

boolean —

True if the backend supports ACLs.

getAcl()

getAcl(string  $folder) : array

Retrieve the access rights for a folder.

Parameters

string $folder

The folder to retrieve the ACL for.

Returns

array —

An array of rights.

getMyAcl()

getMyAcl(string  $folder) : string

Retrieve the access rights the current user has on a folder.

Parameters

string $folder

The folder to retrieve the user ACL for.

Returns

string —

The user rights.

setAcl()

setAcl(string  $folder, string  $user, string  $acl) : NULL

Set the access rights for a folder.

Parameters

string $folder

The folder to act upon.

string $user

The user to set the ACL for.

string $acl

The ACL.

Returns

NULL

deleteAcl()

deleteAcl(string  $folder, string  $user) : NULL

Delete the access rights for user on a folder.

Parameters

string $folder

The folder to act upon.

string $user

The user to delete the ACL for

Returns

NULL

listAnnotation()

listAnnotation(string  $annotation) : array

Retrieves the specified annotation for the complete list of mailboxes.

Parameters

string $annotation

The name of the annotation to retrieve.

Returns

array —

An associative array combining the folder names as key with the corresponding annotation value.

getAnnotation()

getAnnotation(string  $entry, string  $folder) : string

Fetches the annotation on a folder.

Parameters

string $entry

The entry to fetch.

string $folder

The name of the folder.

Returns

string —

The annotation value.

setAnnotation()

setAnnotation(string  $folder, string  $annotation, array  $value) : NULL

Sets the annotation on a folder.

Parameters

string $folder

The name of the folder.

string $annotation

The annotation to set.

array $value

The values to set

Returns

NULL

getNamespace()

getNamespace() : \Horde_Kolab_Storage_Driver_Namespace

Retrieve the namespace information for this connection.

Returns

\Horde_Kolab_Storage_Driver_Namespace —

The initialized namespace handler.

getStamp()

getStamp(string  $folder) : \Horde_Kolab_Storage_Folder_Stamp

Returns a stamp for the current folder status. This stamp can be used to identify changes in the folder data.

Parameters

string $folder

Return the stamp for this folder.

Returns

\Horde_Kolab_Storage_Folder_Stamp

A stamp indicating the current folder status.

getStampFromToken()

getStampFromToken(string  $folder, string  $token, array  $ids) : \Horde_Kolab_Storage_Folder_Stamp

Returns a stamp for the current folder status. This stamp can be used to identify changes in the folder data. This method, as opposed to self::getStamp(), uses the IMAP client's token to calculate the changes.

Parameters

string $folder

Return the stamp for this folder.

string $token

A sync token provided by the IMAP server.

array $ids

An array of UIDs that we know about.

Returns

\Horde_Kolab_Storage_Folder_Stamp

A stamp indicating the current folder status.

status()

status(string  $folder) : array

Returns the status of the current folder.

Parameters

string $folder

Check the status of this folder.

Returns

array —

An array that contains 'uidvalidity' and 'uidnext'.

getUids()

getUids(string  $folder) : array

Returns the message ids of the messages in this folder.

Parameters

string $folder

Check the status of this folder.

Returns

array —

The message ids.

fetch()

fetch(string  $folder,   $uids,   $options = array()) : array

Fetches the objects for the specified UIDs.

Parameters

string $folder

The folder to access.

$uids
$options

Returns

array —

The parsed objects.

fetchStructure()

fetchStructure(string  $folder, array  $uids) : array

Retrieves the messages for the given message ids.

Parameters

string $folder

The folder to fetch the messages from.

array $uids

The message UIDs.

Returns

array —

An array of message structures parsed into Horde_Mime_Part instances.

fetchBodypart()

fetchBodypart(string  $folder, array  $uid, array  $id) : resource

Retrieves a bodypart for the given message ID and mime part ID.

Parameters

string $folder

The folder to fetch the messages from.

array $uid

The message UID.

array $id

The mime part ID.

Returns

resource —

The body part, as a stream resource.

fetchComplete()

fetchComplete(string  $folder, array  $uid) : array

Retrieves a complete message.

Parameters

string $folder

The folder to fetch the messages from.

array $uid

The message UID.

Returns

array —

The message encapsuled as an array that contains a Horde_Mime_Headers and a Horde_Mime_Part object.

fetchHeaders()

fetchHeaders(string  $folder, array  $uid) : \Horde_Mime_Headers

Retrieves the message headers.

Parameters

string $folder

The folder to fetch the message from.

array $uid

The message UID.

Returns

\Horde_Mime_Headers —

The message headers.

appendMessage()

appendMessage(string  $folder, resource  $msg) : mixed

Appends a message to the given folder.

Parameters

string $folder

The folder to append the message(s) to.

resource $msg

The message to append.

Returns

mixed —

True or the UID of the new message in case the backend supports UIDPLUS.

deleteMessages()

deleteMessages(string  $folder, integer  $uids) : NULL

Deletes messages from the specified folder.

Parameters

string $folder

The folder to delete messages from.

integer $uids

IMAP message ids.

Returns

NULL

moveMessage()

moveMessage(integer  $uid, string  $old_folder, string  $new_folder) : NULL

Moves a message to a new folder.

Parameters

integer $uid

IMAP message id.

string $old_folder

Source folder.

string $new_folder

Target folder.

Returns

NULL

expunge()

expunge(string  $folder) : NULL

Expunges messages in the current folder.

Parameters

string $folder

The folder to expunge.

Returns

NULL