Service/WindowsAzure/Storage/Queue.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
name_todo  
Package
Zend_Service_WindowsAzure  
Subpackage
Storage  
Version
$Id$  

\Zend_Service_WindowsAzure_Storage_Queue

Package: Zend_Service_WindowsAzure\Storage
Parent(s)
\Zend_Service_WindowsAzure_Storage
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  MAX_MESSAGE_SIZE = 8388608
Maximal message size (in bytes)
>VConstant  MAX_MESSAGE_TTL = 604800
Maximal message ttl (in seconds)

Methods

methodpublic__construct(string $host = \Zend_Service_WindowsAzure_Storage::URL_DEV_QUEUE, string $accountName = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_ACCOUNT, string $accountKey = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_KEY, boolean $usePathStyleUri = false, \Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null) : void

Creates a new Zend_Service_WindowsAzure_Storage_Queue instance

Parameters
NameTypeDescription
$hoststring

Storage host name

$accountNamestring

Account name for Windows Azure

$accountKeystring

Account key for Windows Azure

$usePathStyleUriboolean

Use path-style URI's

$retryPolicy\Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract

Retry policy to use when making requests

methodprotected_getErrorMessage(\Zend_Http_Response $response, string $alternativeError = 'Unknown error.') : string

Get error message from Zend_Http_Response

Parameters
NameTypeDescription
$response\Zend_Http_Response

Repsonse

$alternativeErrorstring

Alternative error message

Returns
TypeDescription
string
methodpublicclearMessages(string $queueName = '') : void

Clear queue messages

Parameters
NameTypeDescription
$queueNamestring

Queue name

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpubliccreateQueue(string $queueName = '', array $metadata = array()) : object

Create queue

Parameters
NameTypeDescription
$queueNamestring

Queue name

$metadataarray

Key/value pairs of meta data

Returns
TypeDescription
objectQueue properties
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpubliccreateQueueIfNotExists(string $queueName = '', array $metadata = array()) : void

Create queue if it does not exist

Parameters
NameTypeDescription
$queueNamestring

Queue name

$metadataarray

Key/value pairs of meta data

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicdeleteMessage(string $queueName = '', \Zend_Service_WindowsAzure_Storage_QueueMessage $message) : void

Delete queue message

Parameters
NameTypeDescription
$queueNamestring

Queue name

$message\Zend_Service_WindowsAzure_Storage_QueueMessage

Message to delete from queue. A message retrieved using "peekMessages" can NOT be deleted!

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicdeleteQueue(string $queueName = '') : void

Delete queue

Parameters
NameTypeDescription
$queueNamestring

Queue name

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicgetMessages(string $queueName = '', string $numOfMessages = 1, int $visibilityTimeout = null, string $peek = false) : array

Get queue messages

Parameters
NameTypeDescription
$queueNamestring

Queue name

$numOfMessagesstring

Optional. A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. By default, a single message is retrieved from the queue with this operation.

$visibilityTimeoutint

Optional. An integer value that specifies the message's visibility timeout in seconds. The maximum value is 2 hours. The default message visibility timeout is 30 seconds.

$peekstring

Peek only?

Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicgetQueue(string $queueName = '') : \Zend_Service_WindowsAzure_Storage_QueueInstance

Get queue

Parameters
NameTypeDescription
$queueNamestring

Queue name

Returns
TypeDescription
\Zend_Service_WindowsAzure_Storage_QueueInstance
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicgetQueueMetadata(string $queueName = '') : array

Get queue metadata

Parameters
NameTypeDescription
$queueNamestring

Queue name

Returns
TypeDescription
arrayKey/value pairs of meta data
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublichasMessages(string $queueName = '') : boolean

Checks to see if a given queue has messages

Parameters
NameTypeDescription
$queueNamestring

Queue name

Returns
TypeDescription
boolean
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicisValidQueueName(string $queueName = '') : boolean
static

Is valid queue name?

Parameters
NameTypeDescription
$queueNamestring

Queue name

Returns
TypeDescription
boolean
methodpubliclistQueues(string $prefix = null, int $maxResults = null, string $marker = null, string $include = null, int $currentResultCount = 0) : array

List queues

Parameters
NameTypeDescription
$prefixstring

Optional. Filters the results to return only queues whose name begins with the specified prefix.

$maxResultsint

Optional. Specifies the maximum number of queues to return per call to Azure storage. This does NOT affect list size returned by this function. (maximum: 5000)

$markerstring

Optional string value that identifies the portion of the list to be returned with the next list operation.

$includestring

Optional. Include this parameter to specify that the queue's metadata be returned as part of the response body. (allowed values: '', 'metadata')

$currentResultCountint

Current result count (internal use)

Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicpeekMessages(string $queueName = '', string $numOfMessages = 1) : array

Peek queue messages

Parameters
NameTypeDescription
$queueNamestring

Queue name

$numOfMessagesstring

Optional. A nonzero integer value that specifies the number of messages to retrieve from the queue, up to a maximum of 32. By default, a single message is retrieved from the queue with this operation.

Returns
TypeDescription
array
Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicputMessage(string $queueName = '', string $message = '', int $ttl = null) : void

Put message into queue

Parameters
NameTypeDescription
$queueNamestring

Queue name

$messagestring

Message

$ttlint

Message Time-To-Live (in seconds). Defaults to 7 days if the parameter is omitted.

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
methodpublicqueueExists(string $queueName = '') : boolean

Check if a queue exists

Parameters
NameTypeDescription
$queueNamestring

Queue name

Returns
TypeDescription
boolean
methodpublicsetQueueMetadata(string $queueName = '', array $metadata = array()) : void

Set queue metadata

Calling the Set Queue Metadata operation overwrites all existing metadata that is associated with the queue. It's not possible to modify an individual name/value pair.
Parameters
NameTypeDescription
$queueNamestring

Queue name

$metadataarray

Key/value pairs of meta data

Throws
ExceptionDescription
\Zend_Service_WindowsAzure_Exception
Documentation was generated by phpDocumentor 2.2.0 .