Class Zend_Service_Amazon_Sqs

Description

Class for connecting to the Amazon Simple Queue Service (SQS)

Located in /Service/Amazon/Sqs.php (line 43)

Zend_Service_Abstract
   |
   --Zend_Service_Amazon_Abstract
      |
      --Zend_Service_Amazon_Sqs
Class Constant Summary
Variable Summary
Method Summary
 Zend_Service_Amazon_Sqs __construct ([string $accessKey = null], [string $secretKey = null], [string $region = null])
 array addRequiredParameters (string $queue_url,  $parameters)
 integer count (string $queue_url)
 string|boolean create (string $queue_name, [integer $timeout = null])
 boolean delete (string $queue_url)
 boolean deleteMessage (string $queue_url, string $handle)
 string getAttribute (string $queue_url, [string $attribute = 'All'])
 array getQueues ()
 array receive (string $queue_url, [integer $max_messages = null], [integer $timeout = null])
 string send (string $queue_url, string $message)
 string _signParameters (string $queue_url,  $paramaters, array $parameters)
Variables
mixed $_sqsApiVersion = '2009-02-01' (line 58)

The API version to use

  • access: protected
mixed $_sqsEndpoint = 'queue.amazonaws.com' (line 53)

HTTP end point for the Amazon SQS service

  • access: protected
mixed $_sqsSignatureMethod = 'HmacSHA256' (line 68)

Signature Encoding Method

  • access: protected
mixed $_sqsSignatureVersion = '2' (line 63)

Signature Version

  • access: protected

Inherited Variables

Inherited from Zend_Service_Amazon_Abstract

Zend_Service_Amazon_Abstract::$_accessKey
Zend_Service_Amazon_Abstract::$_defaultAccessKey
Zend_Service_Amazon_Abstract::$_defaultSecretKey
Zend_Service_Amazon_Abstract::$_secretKey

Inherited from Zend_Service_Abstract

Zend_Service_Abstract::$_httpClient
Methods
Constructor __construct (line 77)

Constructor

  • access: public
Zend_Service_Amazon_Sqs __construct ([string $accessKey = null], [string $secretKey = null], [string $region = null])
  • string $accessKey
  • string $secretKey
  • string $region

Redefinition of:
Zend_Service_Amazon_Abstract::__construct()
Create Amazon client.
addRequiredParameters (line 386)

Adds required authentication and version parameters to an array of parameters

The required parameters are:

  • AWSAccessKey
  • SignatureVersion
  • Timestamp
  • Version and
  • Signature
If a required parameter is already set in the <tt>$parameters</tt> array, it is overwritten.

  • access: protected
array addRequiredParameters (string $queue_url,  $parameters)
  • string $queue_url: Queue URL
  • array $parameters: the array to which to add the required parameters.
count (line 180)

Return the approximate number of messages in the queue

  • throws: Zend_Service_Amazon_Sqs_Exception
  • access: public
integer count (string $queue_url)
  • string $queue_url: Queue URL
create (line 95)

Create a new queue

Visibility timeout is how long a message is left in the queue "invisible" to other readers. If the message is acknowleged (deleted) before the timeout, then the message is deleted. However, if the timeout expires then the message will be made available to other queue readers.

  • throws: Zend_Service_Amazon_Sqs_Exception
  • access: public
string|boolean create (string $queue_name, [integer $timeout = null])
  • string $queue_name: queue name
  • integer $timeout: default visibility timeout
delete (line 138)

Delete a queue and all of it's messages

Returns false if the queue is not found, true if the queue exists

  • throws: Zend_Service_Amazon_Sqs_Exception
  • access: public
boolean delete (string $queue_url)
  • string $queue_url: queue URL
deleteMessage (line 267)

Delete a message from the queue

Returns true if the message is deleted, false if the deletion is unsuccessful.

  • throws: Zend_Service_Amazon_Sqs_Exception
  • access: public
boolean deleteMessage (string $queue_url, string $handle)
  • string $queue_url: Queue URL
  • string $handle: Message handle as returned by SQS
getAttribute (line 290)

Get the attributes for the queue

  • throws: Zend_Service_Amazon_Sqs_Exception
  • access: public
string getAttribute (string $queue_url, [string $attribute = 'All'])
  • string $queue_url: Queue URL
  • string $attribute
getQueues (line 156)

Get an array of all available queues

  • throws: Zend_Service_Amazon_Sqs_Exception
  • access: public
array getQueues ()
receive (line 222)

Get messages in the queue

  • throws: Zend_Service_Amazon_Sqs_Exception
  • access: public
array receive (string $queue_url, [integer $max_messages = null], [integer $timeout = null])
  • string $queue_url: Queue name
  • integer $max_messages: Maximum number of messages to return
  • integer $timeout: Visibility timeout for these messages
send (line 193)

Send a message to the queue

  • return: Message ID
  • throws: Zend_Service_Amazon_Sqs_Exception
  • access: public
string send (string $queue_url, string $message)
  • string $queue_url: Queue URL
  • string $message: Message to send to the queue
_signParameters (line 418)

Computes the RFC 2104-compliant HMAC signature for request parameters

This implements the Amazon Web Services signature, as per the following specification:

  1. Sort all request parameters (including <tt>SignatureVersion</tt> and excluding <tt>Signature</tt>, the value of which is being created), ignoring case.
2. Iterate over the sorted list and append the parameter name (in its original case) and then its value. Do not URL-encode the parameter values before constructing this string. Do not use any separator characters when appending strings.

  • return: the signed data.
  • access: protected
string _signParameters (string $queue_url,  $paramaters, array $parameters)
  • string $queue_url: Queue URL
  • array $parameters: the parameters for which to get the signature.
  • array $paramaters

Inherited Methods

Inherited From Zend_Service_Amazon_Abstract

 Zend_Service_Amazon_Abstract::__construct()
 Zend_Service_Amazon_Abstract::setKeys()
 Zend_Service_Amazon_Abstract::_getAccessKey()
 Zend_Service_Amazon_Abstract::_getSecretKey()

Inherited From Zend_Service_Abstract

 Zend_Service_Abstract::getHttpClient()
 Zend_Service_Abstract::setHttpClient()
Class Constants
CREATE_TIMEOUT_DEFAULT = 30 (line 48)

Default timeout for createQueue() function

Documentation generated on Mon, 21 Jun 2010 15:46:21 -0400 by phpDocumentor 1.4.3