PHP 클래스 Uecode\Bundle\QPushBundle\Provider\AwsProvider

저자: Keith Kirk ([email protected])
상속: extends AbstractProvider
파일 보기 프로젝트 열기: uecode/qpush-bundle

공개 메소드들

메소드 설명
__construct ( $name, array $options, $client, Doctrine\Common\Cache\Cache $cache, Logger $logger )
create ( ) Builds the configured queues
createQueue ( ) : string Creates an SQS Queue and returns the Queue Url
createSqsPolicy ( ) : string Creates a Policy for SQS that's required to allow SNS SendMessage access
createTopic ( ) : false | null Creates a SNS Topic and returns the ARN
delete ( $id ) : boolean {@inheritDoc}
destroy ( ) : boolean
getProvider ( )
getTopicSubscriptions ( string $topicArn ) : array Get a list of Subscriptions for the specified SNS Topic
onMessageReceived ( Uecode\Bundle\QPushBundle\Event\MessageEvent $event ) : boolean | void Removes the message from queue after all other listeners have fired
onNotification ( Uecode\Bundle\QPushBundle\Event\NotificationEvent $event, string $eventName, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher ) : boolean | void Handles SNS Notifications
publish ( array $message, array $options = [] ) : string {@inheritDoc}
queueExists ( ) : boolean Return the Queue Url
receive ( array $options = [] ) {@inheritDoc}
subscribeToTopic ( string $topicArn, string $protocol, string $endpoint ) : string Subscribes an endpoint to a SNS Topic
topicExists ( ) : boolean Checks to see if a Topic exists
unsubscribeFromTopic ( string $topicArn, string $protocol, string $endpoint ) : boolean Unsubscribes an endpoint from a SNS Topic

메소드 상세

__construct() 공개 메소드

public __construct ( $name, array $options, $client, Doctrine\Common\Cache\Cache $cache, Logger $logger )
$options array
$cache Doctrine\Common\Cache\Cache
$logger Monolog\Logger

create() 공개 메소드

If a Queue name is passed and configured, this method will build only that Queue. All Create methods are idempotent, if the resource exists, the current ARN will be returned
public create ( )

createQueue() 공개 메소드

The create method for SQS Queues is idempotent - if the queue already exists, this method will return the Queue Url of the existing Queue.
public createQueue ( ) : string
리턴 string

createSqsPolicy() 공개 메소드

Creates a Policy for SQS that's required to allow SNS SendMessage access
public createSqsPolicy ( ) : string
리턴 string

createTopic() 공개 메소드

The create method for the SNS Topics is idempotent - if the topic already exists, this method will return the Topic ARN of the existing Topic.
public createTopic ( ) : false | null
리턴 false | null

delete() 공개 메소드

{@inheritDoc}
public delete ( $id ) : boolean
리턴 boolean

destroy() 공개 메소드

public destroy ( ) : boolean
리턴 boolean

getProvider() 공개 메소드

public getProvider ( )

getTopicSubscriptions() 공개 메소드

Get a list of Subscriptions for the specified SNS Topic
public getTopicSubscriptions ( string $topicArn ) : array
$topicArn string The SNS Topic Arn
리턴 array

onMessageReceived() 공개 메소드

If an earlier listener has erred or stopped propagation, this method will not fire and the Queued Message should become visible in queue again. Stops Event Propagation after removing the Message
public onMessageReceived ( Uecode\Bundle\QPushBundle\Event\MessageEvent $event ) : boolean | void
$event Uecode\Bundle\QPushBundle\Event\MessageEvent The SQS Message Event
리턴 boolean | void

onNotification() 공개 메소드

For Subscription notifications, this method will automatically confirm the Subscription request For Message notifications, this method polls the queue and dispatches the {queue}.message_received event for each message retrieved
public onNotification ( Uecode\Bundle\QPushBundle\Event\NotificationEvent $event, string $eventName, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher ) : boolean | void
$event Uecode\Bundle\QPushBundle\Event\NotificationEvent The Notification Event
$eventName string Name of the event
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
리턴 boolean | void

publish() 공개 메소드

This method will either use a SNS Topic to publish a queued message or straight to SQS depending on the application configuration.
public publish ( array $message, array $options = [] ) : string
$message array
$options array
리턴 string

queueExists() 공개 메소드

This method relies on in-memory cache and the Cache provider to reduce the need to needlessly call the create method on an existing Queue.
public queueExists ( ) : boolean
리턴 boolean

receive() 공개 메소드

{@inheritDoc}
public receive ( array $options = [] )
$options array

subscribeToTopic() 공개 메소드

Subscribes an endpoint to a SNS Topic
public subscribeToTopic ( string $topicArn, string $protocol, string $endpoint ) : string
$topicArn string The ARN of the Topic
$protocol string The protocol of the Endpoint
$endpoint string The Endpoint of the Subscriber
리턴 string

topicExists() 공개 메소드

This method relies on in-memory cache and the Cache provider to reduce the need to needlessly call the create method on an existing Topic.
public topicExists ( ) : boolean
리턴 boolean

unsubscribeFromTopic() 공개 메소드

The method will return TRUE on success, or FALSE if the Endpoint did not have a Subscription on the SNS Topic
public unsubscribeFromTopic ( string $topicArn, string $protocol, string $endpoint ) : boolean
$topicArn string The ARN of the Topic
$protocol string The protocol of the Endpoint
$endpoint string The Endpoint of the Subscriber
리턴 boolean