Zend Framework  1.12
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Zend_Service_Amazon_SimpleDb Class Reference

Public Member Functions

 __construct ($accessKey, $secretKey)
 Create Amazon SimpleDB client.
 
 setEndpoint ($endpoint)
 Set SimpleDB endpoint to use.
 
 getEndpoint ()
 Get SimpleDB endpoint.
 
 getAttributes ($domainName, $itemName, $attributeName=null)
 Get attributes API method.
 
 putAttributes ($domainName, $itemName, $attributes, $replace=array())
 Push attributes.
 
 batchPutAttributes ($items, $domainName, array $replace=array())
 Add many attributes at once.
 
 deleteAttributes ($domainName, $itemName, array $attributes=array())
 Delete attributes.
 
 listDomains ($maxNumberOfDomains=100, $nextToken=null)
 List domains.
 
 domainMetadata ($domainName)
 Retrieve domain metadata.
 
 createDomain ($domainName)
 Create a new domain.
 
 deleteDomain ($domainName)
 Delete a domain.
 
 select ($selectExpression, $nextToken=null)
 Select items from the database.
 
 quote ($value)
 Quote SDB value.
 
 quoteName ($name)
 Quote SDB column or table name.
 
- Public Member Functions inherited from Zend_Service_Amazon_Abstract
 __construct ($accessKey=null, $secretKey=null)
 Create Amazon client.
 

Protected Member Functions

 _sendRequest (array $params=array())
 Sends a HTTP request to the SimpleDB service using Zend_Http_Client.
 
 _addRequiredParameters (array $parameters)
 Adds required authentication and version parameters to an array of parameters.
 
 _signParameters (array $paramaters)
 Computes the RFC 2104-compliant HMAC signature for request parameters.
 
- Protected Member Functions inherited from Zend_Service_Amazon_Abstract
 _getAccessKey ()
 Method to fetch the Access Key.
 
 _getSecretKey ()
 Method to fetch the Secret AWS Key.
 

Protected Attributes

 $_sdbEndpoint = 'sdb.amazonaws.com/'
 The HTTP query server.
 
 $_httpTimeout = 10
 Period after which HTTP request will timeout in seconds.
 
 $_sdbApiVersion = '2009-04-15'
 The API version to use.
 
 $_signatureVersion = '2'
 Signature Version.
 
 $_signatureMethod = 'HmacSHA256'
 Signature Encoding Method.
 
- Protected Attributes inherited from Zend_Service_Amazon_Abstract
 $_secretKey
 
 $_accessKey
 

Additional Inherited Members

- Static Public Member Functions inherited from Zend_Service_Amazon_Abstract
static setKeys ($accessKey, $secretKey)
 Set the keys to use when accessing SQS.
 
- Static Protected Attributes inherited from Zend_Service_Amazon_Abstract
static $_defaultAccessKey = null
 
static $_defaultSecretKey = null
 

Constructor & Destructor Documentation

__construct (   $accessKey,
  $secretKey 
)

Create Amazon SimpleDB client.

Parameters
string$access_keyOverride the default Access Key
string$secret_keyOverride the default Secret Key
string$regionSets the AWS Region
Returns
void

Member Function Documentation

_addRequiredParameters ( 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
array$parametersthe array to which to add the required parameters.
Returns
array
_sendRequest ( array  $params = array())
protected

Sends a HTTP request to the SimpleDB service using Zend_Http_Client.

Parameters
array$paramsList of parameters to send with the request
Returns
Zend_Service_Amazon_SimpleDb_Response
Exceptions
Zend_Service_Amazon_SimpleDb_Exception
_signParameters ( 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
array$parametersthe parameters for which to get the signature.
string$secretKeythe secret key to use to sign the parameters.
Returns
string the signed data.
batchPutAttributes (   $items,
  $domainName,
array  $replace = array() 
)

Add many attributes at once.

Parameters
array$items
string$domainName
array$replace
Returns
void
createDomain (   $domainName)

Create a new domain.

Parameters
string$domainNameValid domain name of the domain to create
Returns
boolean True if successful, false if not
deleteAttributes (   $domainName,
  $itemName,
array  $attributes = array() 
)

Delete attributes.

Parameters
string$domainName
string$itemName
array$attributes
Returns
void
deleteDomain (   $domainName)

Delete a domain.

Parameters
string$domainNameValid domain name of the domain to delete
Returns
boolean True if successful, false if not
domainMetadata (   $domainName)

Retrieve domain metadata.

Parameters
string$domainNameName of the domain for which metadata will be requested
Returns
array Key/value array of metadatum names and values.
getAttributes (   $domainName,
  $itemName,
  $attributeName = null 
)

Get attributes API method.

Parameters
string$domainNameDomain name within database
string
getEndpoint ( )

Get SimpleDB endpoint.

Returns
Zend_Uri_Http
listDomains (   $maxNumberOfDomains = 100,
  $nextToken = null 
)

List domains.

Parameters
int$maxNumberOfDomains
int$nextToken
Returns
array 0 or more domain names
putAttributes (   $domainName,
  $itemName,
  $attributes,
  $replace = array() 
)

Push attributes.

Parameters
string$domainName
string$itemName
array | Traverable$attributes
array$replace
Returns
void
quote (   $value)

Quote SDB value.

Wraps it in ''

Parameters
string$value
Returns
string
quoteName (   $name)

Quote SDB column or table name.

Wraps it in ``

Parameters
string$name
Returns
string
select (   $selectExpression,
  $nextToken = null 
)

Select items from the database.

Parameters
string$selectExpression
null | string$nextToken
Returns
Zend_Service_Amazon_SimpleDb_Page
setEndpoint (   $endpoint)

Set SimpleDB endpoint to use.

Parameters
string | Zend_Uri_Http$endpoint
Returns
Zend_Service_Amazon_SimpleDb

Member Data Documentation

$_httpTimeout = 10
protected

Period after which HTTP request will timeout in seconds.

$_sdbApiVersion = '2009-04-15'
protected

The API version to use.

$_sdbEndpoint = 'sdb.amazonaws.com/'
protected

The HTTP query server.

$_signatureMethod = 'HmacSHA256'
protected

Signature Encoding Method.

$_signatureVersion = '2'
protected

Signature Version.