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

Public Member Functions

 __construct ($options=array())
 Constructor.
 
 createQueue ($name, $options=null)
 Create a queue.
 
 deleteQueue ($queueId, $options=null)
 Delete a queue.
 
 listQueues ($options=null)
 List all queues.
 
 fetchQueueMetadata ($queueId, $options=null)
 Get a key/value array of metadata for the given queue.
 
 storeQueueMetadata ($queueId, $metadata, $options=null)
 Store a key/value array of metadata for the specified queue.
 
 sendMessage ($queueId, $message, $options=null)
 Send a message to the specified queue.
 
 receiveMessages ($queueId, $max=1, $options=null)
 Recieve at most $max messages from the specified queue and return the message IDs for messages recieved.
 
 deleteMessage ($queueId, $message, $options=null)
 Delete the specified message from the specified queue.
 
 peekMessages ($queueId, $num=1, $options=null)
 Peek at the messages from the specified queue without removing them.
 
 getClient ()
 Get SQS implementation.
 
- Public Member Functions inherited from Zend_Cloud_QueueService_Adapter_AbstractAdapter
 setMessageClass ($class)
 Set class to use for message objects.
 
 getMessageClass ()
 Get class to use for message objects.
 
 setMessageSetClass ($class)
 Set class to use for message collection objects.
 
 getMessageSetClass ()
 Get class to use for message collection objects.
 

Public Attributes

const AWS_ACCESS_KEY = 'aws_accesskey'
 
const AWS_SECRET_KEY = 'aws_secretkey'
 
const CREATE_TIMEOUT = 30
 Defaults.
 
- Public Attributes inherited from Zend_Cloud_QueueService_Adapter_AbstractAdapter
const MESSAGE_CLASS = 'message_class'
 @+ option keys
 
const MESSAGESET_CLASS = 'messageset_class'
 
- Public Attributes inherited from Zend_Cloud_QueueService_Adapter
const HTTP_ADAPTER = 'http_adapter'
 Ctor HTTP adapter option.
 
const VISIBILITY_TIMEOUT = 'visibility_timeout'
 Message visibility timeout option.
 
const DEFAULT_TIMEOUT = 30
 Default visibility timeout.
 

Protected Member Functions

 _makeMessages ($messages)
 Create Zend_Cloud_QueueService_Message array for Sqs messages.
 

Protected Attributes

 $_sqs
 
- Protected Attributes inherited from Zend_Cloud_QueueService_Adapter_AbstractAdapter
 $_messageClass = 'Zend_Cloud_QueueService_Message'
 
 $_messageSetClass = 'Zend_Cloud_QueueService_MessageSet'
 

Constructor & Destructor Documentation

__construct (   $options = array())

Constructor.

Parameters
array | Zend_Config$options
Returns
void

Member Function Documentation

_makeMessages (   $messages)
protected

Create Zend_Cloud_QueueService_Message array for Sqs messages.

Parameters
array$messages
Returns
Zend_Cloud_QueueService_Message[]
createQueue (   $name,
  $options = null 
)

Create a queue.

Returns the ID of the created queue (typically the URL). It may take some time to create the queue. Check your vendor's documentation for details.

Parameters
string$name
array$options
Returns
string Queue ID (typically URL)

Implements Zend_Cloud_QueueService_Adapter.

deleteMessage (   $queueId,
  $message,
  $options = null 
)

Delete the specified message from the specified queue.

Parameters
string$queueId
Zend_Cloud_QueueService_Message$message
array$options
Returns
void

Implements Zend_Cloud_QueueService_Adapter.

deleteQueue (   $queueId,
  $options = null 
)

Delete a queue.

All messages in the queue will also be deleted.

Parameters
string$queueId
array$options
Returns
boolean true if successful, false otherwise

Implements Zend_Cloud_QueueService_Adapter.

fetchQueueMetadata (   $queueId,
  $options = null 
)

Get a key/value array of metadata for the given queue.

Parameters
string$queueId
array$options
Returns
array

Implements Zend_Cloud_QueueService_Adapter.

getClient ( )

Get SQS implementation.

Returns
Zend_Service_Amazon_Sqs

Implements Zend_Cloud_QueueService_Adapter.

listQueues (   $options = null)

List all queues.

Parameters
array$options
Returns
array Queue IDs

Implements Zend_Cloud_QueueService_Adapter.

peekMessages (   $queueId,
  $num = 1,
  $options = null 
)

Peek at the messages from the specified queue without removing them.

Parameters
string$queueId
int$numHow many messages
array$options
Returns
Zend_Cloud_QueueService_Message[]

Implements Zend_Cloud_QueueService_Adapter.

receiveMessages (   $queueId,
  $max = 1,
  $options = null 
)

Recieve at most $max messages from the specified queue and return the message IDs for messages recieved.

Parameters
string$queueId
int$max
array$options
Returns
array

Implements Zend_Cloud_QueueService_Adapter.

sendMessage (   $queueId,
  $message,
  $options = null 
)

Send a message to the specified queue.

Parameters
string$message
string$queueId
array$options
Returns
string Message ID

Implements Zend_Cloud_QueueService_Adapter.

storeQueueMetadata (   $queueId,
  $metadata,
  $options = null 
)

Store a key/value array of metadata for the specified queue.

WARNING: This operation overwrites any metadata that is located at $destinationPath. Some adapters may not support this method.

Parameters
array$metadata
string$queueId
array$options
Returns
void

Implements Zend_Cloud_QueueService_Adapter.

Member Data Documentation

$_sqs
protected
const AWS_ACCESS_KEY = 'aws_accesskey'
const AWS_SECRET_KEY = 'aws_secretkey'
const CREATE_TIMEOUT = 30

Defaults.