Moodle  2.2.1
http://www.collinsharper.com
Zend_Service_Amazon_Sqs Class Reference
Inheritance diagram for Zend_Service_Amazon_Sqs:
Collaboration diagram for Zend_Service_Amazon_Sqs:

Public Member Functions

 __construct ($accessKey=null, $secretKey=null, $region=null)
 create ($queue_name, $timeout=null)
 delete ($queue_url)
 getQueues ()
 count ($queue_url)
 send ($queue_url, $message)
 receive ($queue_url, $max_messages=null, $timeout=null)
 deleteMessage ($queue_url, $handle)
 getAttribute ($queue_url, $attribute= 'All')

Data Fields

const CREATE_TIMEOUT_DEFAULT = 30

Protected Member Functions

 addRequiredParameters ($queue_url, array $parameters)
 _signParameters ($queue_url, array $paramaters)

Protected Attributes

 $_sqsEndpoint = 'queue.amazonaws.com'
 $_sqsApiVersion = '2009-02-01'
 $_sqsSignatureVersion = '2'
 $_sqsSignatureMethod = 'HmacSHA256'

Detailed Description

Definition at line 43 of file Sqs.php.


Constructor & Destructor Documentation

__construct ( accessKey = null,
secretKey = null,
region = null 
)

Constructor

Parameters:
string$accessKey
string$secretKey
string$region

Definition at line 77 of file Sqs.php.


Member Function Documentation

_signParameters ( queue_url,
array paramaters 
) [protected]

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 SignatureVersion and excluding Signature, 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.

Parameters:
string$queue_urlQueue URL
array$parametersthe parameters for which to get the signature.
Returns:
string the signed data.

Definition at line 418 of file Sqs.php.

Here is the call graph for this function:

Here is the caller graph for this function:

addRequiredParameters ( queue_url,
array parameters 
) [protected]

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 $parameters array, it is overwritten.

Parameters:
string$queue_urlQueue URL
array$parametersthe array to which to add the required parameters.
Returns:
array

Definition at line 386 of file Sqs.php.

Here is the call graph for this function:

count ( queue_url)

Return the approximate number of messages in the queue

Parameters:
string$queue_urlQueue URL
Returns:
integer
Exceptions:
Zend_Service_Amazon_Sqs_Exception

Definition at line 180 of file Sqs.php.

Here is the call graph for this function:

Here is the caller graph for this function:

create ( queue_name,
timeout = null 
)

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.

Parameters:
string$queue_namequeue name
integer$timeoutdefault visibility timeout
Returns:
string|boolean
Exceptions:
Zend_Service_Amazon_Sqs_Exception

Definition at line 95 of file Sqs.php.

delete ( queue_url)

Delete a queue and all of it's messages

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

Parameters:
string$queue_urlqueue URL
Returns:
boolean
Exceptions:
Zend_Service_Amazon_Sqs_Exception

Definition at line 138 of file Sqs.php.

deleteMessage ( queue_url,
handle 
)

Delete a message from the queue

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

Parameters:
string$queue_urlQueue URL
string$handleMessage handle as returned by SQS
Returns:
boolean
Exceptions:
Zend_Service_Amazon_Sqs_Exception

Definition at line 267 of file Sqs.php.

getAttribute ( queue_url,
attribute = 'All' 
)

Get the attributes for the queue

Parameters:
string$queue_urlQueue URL
string$attribute
Returns:
string
Exceptions:
Zend_Service_Amazon_Sqs_Exception

Definition at line 290 of file Sqs.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getQueues ( )

Get an array of all available queues

Returns:
array
Exceptions:
Zend_Service_Amazon_Sqs_Exception

Definition at line 156 of file Sqs.php.

receive ( queue_url,
max_messages = null,
timeout = null 
)

Get messages in the queue

Parameters:
string$queue_urlQueue name
integer$max_messagesMaximum number of messages to return
integer$timeoutVisibility timeout for these messages
Returns:
array
Exceptions:
Zend_Service_Amazon_Sqs_Exception

Definition at line 222 of file Sqs.php.

send ( queue_url,
message 
)

Send a message to the queue

Parameters:
string$queue_urlQueue URL
string$messageMessage to send to the queue
Returns:
string Message ID
Exceptions:
Zend_Service_Amazon_Sqs_Exception

Definition at line 193 of file Sqs.php.


Field Documentation

$_sqsApiVersion = '2009-02-01' [protected]

The API version to use

Definition at line 58 of file Sqs.php.

$_sqsEndpoint = 'queue.amazonaws.com' [protected]

HTTP end point for the Amazon SQS service

Definition at line 53 of file Sqs.php.

$_sqsSignatureMethod = 'HmacSHA256' [protected]

Signature Encoding Method

Definition at line 68 of file Sqs.php.

$_sqsSignatureVersion = '2' [protected]

Signature Version

Definition at line 63 of file Sqs.php.

Default timeout for createQueue() function

Definition at line 48 of file Sqs.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations