Wildfire/Protocol/JsonStream.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Wildfire  
Subpackage
Protocol  
Version
$Id$  

\Zend_Wildfire_Protocol_JsonStream

Package: Zend_Wildfire\Protocol
Encodes messages into the Wildfire JSON Stream Communication Protocol.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2'
The protocol URI for this protocol

Properties

>VPropertyprotectedarray $_messages = array()
All messages to be sent.
Default valuearray()Details
Type
array
>VPropertyprotectedarray $_plugins = array()
Plugins that are using this protocol
Default valuearray()Details
Type
array

Methods

methodprotected_encode(mixed $value) : string

Use the JSON encoding scheme for the value specified

Parameters
NameTypeDescription
$valuemixed

The value to be encoded

Returns
TypeDescription
stringThe encoded value
methodpublicclearMessages(\Zend_Wildfire_Plugin_Interface $plugin) : boolean

Remove all qued messages

Parameters
NameTypeDescription
$plugin\Zend_Wildfire_Plugin_Interface

The plugin for which to clear messages

Returns
TypeDescription
booleanReturns TRUE if messages were present
methodpublicgetMessages() : mixed

Get all qued messages

Returns
TypeDescription
mixedReturns qued messages or FALSE if no messages are qued
methodpublicgetPayload(\Zend_Wildfire_Channel_Interface $channel) : mixed

Retrieves all formatted data ready to be sent by the channel.

Parameters
NameTypeDescription
$channel\Zend_Wildfire_Channel_Interface

The instance of the channel that will be transmitting the data

Returns
TypeDescription
mixedReturns the data to be sent by the channel.
Throws
ExceptionDescription
\Zend_Wildfire_Exception
methodpublicrecordMessage(\Zend_Wildfire_Plugin_Interface $plugin, string $structure, array $data) : boolean

Record a message with the given data in the given structure

Parameters
NameTypeDescription
$plugin\Zend_Wildfire_Plugin_Interface

The plugin recording the message

$structurestring

The structure to be used for the data

$dataarray

The data to be recorded

Returns
TypeDescription
booleanReturns TRUE if message was recorded
methodpublicregisterPlugin(\Zend_Wildfire_Plugin_Interface $plugin) : boolean

Register a plugin that uses this protocol

Parameters
NameTypeDescription
$plugin\Zend_Wildfire_Plugin_Interface

The plugin to be registered

Returns
TypeDescription
booleanReturns TRUE if plugin was registered, false if it was already registered
Documentation was generated by phpDocumentor 2.2.0 .