Services_Amazon_SQS
[ class tree: Services_Amazon_SQS ] [ index: Services_Amazon_SQS ] [ all elements ]

Class: Services_Amazon_SQS

Source Location: /Services_Amazon_SQS-0.1.0/Services/Amazon/SQS.php

Class Overview


Abstract base class for interfacing with Amazon Simple Queue Service (SQS) queues


Author(s):

Copyright:

  • 2008 Mike Brittain, 2008 Amazon.com, 2008 silverorange

Variables

Methods


Child classes:

Services_Amazon_SQS_QueueManager
Class for creating, managing, and deleting Amazon Simple Queue Service (SQS) queues
Services_Amazon_SQS_Queue
A queue in the Amazon SQS

Inherited Variables

Inherited Methods


Class Details

[line 86]
Abstract base class for interfacing with Amazon Simple Queue Service (SQS) queues

This class uses the HTTP query mechanism for accessing the Amazon SQS. See page 20 of the Amazon SQS Developer's Guide PDF for details about the HTTP query mechanism.



[ Top ]


Class Variables

$account =  null

[line 118]

The account to use
  • Access: protected



[ Top ]

$request =  null

[line 130]

The HTTP request object to use

This can be specified in the constructor. Note: The request object is only used as a template to create other request objects. This prevents one API call from affecting the state of the HTTP request object for subsequent API calls.

  • Access: protected

Type:   HTTP_Request2


[ Top ]



Method Detail

addRequiredParameters   [line 213]

void addRequiredParameters( array $parameters)

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 not overwritten.

  • Access: protected

Parameters:

array   $parameters   —  the array to which to add the required parameters.

[ Top ]

__construct (Constructor)   [line 151]

Services_Amazon_SQS __construct( Services_Amazon_SQS_Account|string $accessKey, [string $secretAccessKey = ''], [HTTP_Request2 $request = null])

Creates a new SQS client
  • Access: public

Overridden in child classes as:

Services_Amazon_SQS_Queue::__construct()
Creates a PHP SQS queue object

Parameters:

Services_Amazon_SQS_Account|string   $accessKey   —  either a Services_Amazon_SQS_Account object or a string containing the SQS access key for an account.
string   $secretAccessKey   —  if the first parameter is an account object, this parameter is ignored. Otherwise, this parameter is required and is the secret access key for the SQS account.
HTTP_Request2   $request   —  optional. The HTTP request object to use. If not specified, a HTTP request object is created automatically.

[ Top ]

isValidVisibilityTimeout   [line 340]

boolean isValidVisibilityTimeout( integer $timeout)

Gets whether or not a visibility timeout is valid

Visibility timeouts must be between 0 and 7200 seconds.

  • Return: true if the timeout is valid, otherwise false.
  • Access: protected

Parameters:

integer   $timeout   —  the timeout value to check (in seconds).

[ Top ]

sendRequest   [line 289]

mixed sendRequest( [array $params = array()], [string $queueUrl = null])

Sends a HTTP request to the queue service using cURL

The supplied <tt>$params</tt> array should contain only the specific parameters for the request type and should not include account, signature, or timestamp related parameters. These parameters are added automatically.

  • Return: Services_Amazon_SQS_Response object or false if the request failed.
  • Throws: Services_Amazon_SQS_ErrorException if one or more errors are returned from Amazon.
  • Throws: Services_Amazon_SQS_HttpException if the HTTP request fails.
  • Access: protected

Parameters:

array   $params   —  optional. Array of request parameters for the API call.
string   $queueUrl   —  optional. The specific queue URL for which the request is made. Does not need to be specified for general actions like listing queues.

[ Top ]

setRequest   [line 186]

void setRequest( HTTP_Request2 $request)

Sets the HTTP request object to use
  • Access: public

Parameters:

HTTP_Request2   $request   —  the HTTP request object to use.

[ Top ]

signParameters   [line 249]

string signParameters( array $parameters, string $secretKey)

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 signature to the specified parameters. Use this value for the <tt>Signature</tt> parameter.
  • Access: protected

Parameters:

array   $parameters   —  the parameters for which to get the signature.
string   $secretKey   —  the secret key to use to sign the parameters.

[ Top ]


Documentation generated on Thu, 10 Dec 2015 05:51:14 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.