API Documentation

Service/WindowsAzure/Storage/Queue.php

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-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
name_todo  
package
Zend_Service_WindowsAzure  
subpackage
Storage  
version
$Id: Queue.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Service_WindowsAzure_Storage_Queue

Extends from
\Zend_Service_WindowsAzure_Storage
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Service_WindowsAzure  
subpackage
Storage  

Constants

Constant  MAX_MESSAGE_SIZE = '8388608'

Maximal message size (in bytes)

Constant  MAX_MESSAGE_TTL = '604800'

Maximal message ttl (in seconds)

Methods

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

Creates a new Zend_Service_WindowsAzure_Storage_Queue instance

Parameters
Name Type Description
$host string Storage host name
$accountName string Account name for Windows Azure
$accountKey string Account key for Windows Azure
$usePathStyleUri boolean

Use path-style URI's

$retryPolicy \Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract Retry policy to use when making requests
methodprotected_generateMetadataHeaders( array $metadata = array ) : \HTTP

Generate metadata headers

Inherited from: \Zend_Service_WindowsAzure_Storage::_generateMetadataHeaders()
Parameters
Name Type Description
$metadata array
Returns
Type Description
\HTTP headers containing metadata
methodprotected_getErrorMessage( \Zend_Http_Response $response, string $alternativeError = Unknown error. ) : string

Get error message from Zend_Http_Response

Parameters
Name Type Description
$response \Zend_Http_Response Repsonse
$alternativeError string Alternative error message
Returns
Type Description
string
methodprotected_parseMetadataElement(  $element = null ) : array
Parameters
Name Type Description
$element
Returns
Type Description
array
methodprotected_parseMetadataHeaders( array $headers = array ) : array

Parse metadata headers

Inherited from: \Zend_Service_WindowsAzure_Storage::_parseMetadataHeaders()
Parameters
Name Type Description
$headers array HTTP headers containing metadata
Returns
Type Description
array
methodprotected_parseResponse( \Zend_Http_Response $response = null ) : object

Parse result from Zend_Http_Response

Inherited from: \Zend_Service_WindowsAzure_Storage::_parseResponse()
Parameters
Name Type Description
$response \Zend_Http_Response Response from HTTP call
Returns
Type Description
object
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodprotected_performRequest( string $path = /, string $queryString, string $httpVerb = Zend_Http_Client, array $headers = array, boolean $forTableStorage = false, mixed $rawData = null, string $resourceType = Zend_Service_WindowsAzure_Storage, string $requiredPermission = Zend_Service_WindowsAzure_Credentials_CredentialsAbstract ) : \Zend_Http_Response

Perform request using Zend_Http_Client channel

Inherited from: \Zend_Service_WindowsAzure_Storage::_performRequest()
Parameters
Name Type Description
$path string Path
$queryString string Query string
$httpVerb string HTTP verb the request will use
$headers array

x-ms headers to add

$forTableStorage boolean

Is the request for table storage?

$rawData mixed Optional RAW HTTP data to be sent over the wire
$resourceType string Resource type
$requiredPermission string Required permission
Returns
Type Description
\Zend_Http_Response
methodpublicclearMessages( string $queueName ) : void

Clear queue messages

Parameters
Name Type Description
$queueName string Queue name
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpubliccreateQueryStringFromArray( array $queryString ) : string
static

Builds a query string from an array of elements

Inherited from: \Zend_Service_WindowsAzure_Storage::createQueryStringFromArray()
Parameters
Name Type Description
$queryString array Array of elements
Returns
Type Description
string Assembled query string
methodpubliccreateQueue( string $queueName, array $metadata = array ) : object

Create queue

Parameters
Name Type Description
$queueName string Queue name
$metadata array

Key/value pairs of meta data

Returns
Type Description
object Queue properties
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicdeleteMessage( string $queueName, \Zend_Service_WindowsAzure_Storage_QueueMessage $message ) : void

Delete queue message

Parameters
Name Type Description
$queueName string Queue name
$message \Zend_Service_WindowsAzure_Storage_QueueMessage

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

Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicdeleteQueue( string $queueName ) : void

Delete queue

Parameters
Name Type Description
$queueName string Queue name
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicgetAccountName( ) : string

Returns the Windows Azure account name

Inherited from: \Zend_Service_WindowsAzure_Storage::getAccountName()
Returns
Type Description
string
methodpublicgetBaseUrl( ) : string

Get base URL for creating requests

Inherited from: \Zend_Service_WindowsAzure_Storage::getBaseUrl()
Returns
Type Description
string
methodpublicgetCredentials( ) : \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract

Get Zend_Service_WindowsAzure_Credentials_CredentialsAbstract instance

Inherited from: \Zend_Service_WindowsAzure_Storage::getCredentials()
methodpublicgetHttpClientChannel( ) : \Zend_Http_Client_Adapter_Interface

Retrieve HTTP client channel

Inherited from: \Zend_Service_WindowsAzure_Storage::getHttpClientChannel()
Returns
Type Description
\Zend_Http_Client_Adapter_Interface
methodpublicgetMessages( string $queueName, string $numOfMessages = 1, int $visibilityTimeout = null, string $peek = false ) : array

Get queue messages

Parameters
Name Type Description
$queueName string Queue name
$numOfMessages string 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.
$visibilityTimeout int

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.

$peek string

Peek only?

Returns
Type Description
array
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicgetQueue( string $queueName ) : \Zend_Service_WindowsAzure_Storage_QueueInstance

Get queue

Parameters
Name Type Description
$queueName string Queue name
Returns
Type Description
\Zend_Service_WindowsAzure_Storage_QueueInstance
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicgetQueueMetadata( string $queueName ) : array

Get queue metadata

Parameters
Name Type Description
$queueName string Queue name
Returns
Type Description
array Key/value pairs of meta data
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicisValidMetadataName( string $metadataName ) : boolean
static

Is valid metadata name?

Inherited from: \Zend_Service_WindowsAzure_Storage::isValidMetadataName()
Parameters
Name Type Description
$metadataName string Metadata name
Returns
Type Description
boolean
methodpublicisValidQueueName( string $queueName ) : boolean
static

Is valid queue name?

Parameters
Name Type Description
$queueName string Queue name
Returns
Type Description
boolean
methodpublicisoDate( int $timestamp = null ) : string

Generate ISO 8601 compliant date string in UTC time zone

Inherited from: \Zend_Service_WindowsAzure_Storage::isoDate()
Parameters
Name Type Description
$timestamp int
Returns
Type Description
string
methodpubliclistQueues( string $prefix = null, int $maxResults = null, string $marker = null, string $include = null, int $currentResultCount = 0 ) : array

List queues

Parameters
Name Type Description
$prefix string Optional. Filters the results to return only queues whose name begins with the specified prefix.
$maxResults int

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)

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

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

$currentResultCount int

Current result count (internal use)

Returns
Type Description
array
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicpeekMessages( string $queueName, string $numOfMessages = 1 ) : array

Peek queue messages

Parameters
Name Type Description
$queueName string Queue name
$numOfMessages string 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
Type Description
array
Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicputMessage( string $queueName, string $message, int $ttl = null ) : void

Put message into queue

Parameters
Name Type Description
$queueName string Queue name
$message string Message
$ttl int

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

Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicqueueExists( string $queueName ) : boolean

Check if a queue exists

Parameters
Name Type Description
$queueName string Queue name
Returns
Type Description
boolean
methodpublicsetCredentials( \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract $credentials ) : void

Set Zend_Service_WindowsAzure_Credentials_CredentialsAbstract instance

Inherited from: \Zend_Service_WindowsAzure_Storage::setCredentials()
Parameters
Name Type Description
$credentials \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract Zend_Service_WindowsAzure_Credentials_CredentialsAbstract instance to use for request signing.
methodpublicsetHttpClientChannel( \Zend_Http_Client_Adapter_Interface|string $adapterInstance = Zend_Http_Client_Adapter_Proxy ) : void

Set the HTTP client channel to use

Inherited from: \Zend_Service_WindowsAzure_Storage::setHttpClientChannel()
Parameters
Name Type Description
$adapterInstance \Zend_Http_Client_Adapter_Interface|string Adapter instance or adapter class name.
methodpublicsetProxy( boolean $useProxy = false, string $proxyUrl, int $proxyPort = 80, string $proxyCredentials ) : void
Parameters
Name Type Description
$useProxy boolean

Use proxy?

$proxyUrl string Proxy URL
$proxyPort int Proxy port
$proxyCredentials string Proxy credentials
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
Name Type Description
$queueName string Queue name
$metadata array

Key/value pairs of meta data

Throws
Exception Description
\Zend_Service_WindowsAzure_Exception
methodpublicsetRetryPolicy( \Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract $retryPolicy = null ) : void

Set retry policy to use when making requests

Inherited from: \Zend_Service_WindowsAzure_Storage::setRetryPolicy()
Parameters
Name Type Description
$retryPolicy \Zend_Service_WindowsAzure_RetryPolicy_RetryPolicyAbstract Retry policy to use when making requests
methodpublicurlencode( string $value ) : string
static

URL encode function

Inherited from: \Zend_Service_WindowsAzure_Storage::urlencode()
Parameters
Name Type Description
$value string Value to encode
Returns
Type Description
string Encoded value
Documentation was generated by DocBlox 0.13.3.