Encodes messages into the Wildfire JSON Stream Communication Protocol.

category Zend
package Zend_Wildfire
subpackage Protocol
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License

 Methods

Remove all qued messages

clearMessages(\Zend_Wildfire_Plugin_Interface $plugin) : boolean

Parameters

$plugin

\Zend_Wildfire_Plugin_Interface

The plugin for which to clear messages

Returns

booleanReturns TRUE if messages were present

Get all qued messages

getMessages() : mixed

Returns

mixedReturns qued messages or FALSE if no messages are qued

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

getPayload(\Zend_Wildfire_Channel_Interface $channel) : mixed

Parameters

$channel

\Zend_Wildfire_Channel_Interface

The instance of the channel that will be transmitting the data

Exceptions

\Zend_Wildfire_Exception

Returns

mixedReturns the data to be sent by the channel.

Record a message with the given data in the given structure

recordMessage(\Zend_Wildfire_Plugin_Interface $plugin, string $structure, array $data) : boolean

Parameters

$plugin

\Zend_Wildfire_Plugin_Interface

The plugin recording the message

$structure

string

The structure to be used for the data

$data

array

The data to be recorded

Returns

booleanReturns TRUE if message was recorded

Register a plugin that uses this protocol

registerPlugin(\Zend_Wildfire_Plugin_Interface $plugin) : boolean

Parameters

$plugin

\Zend_Wildfire_Plugin_Interface

The plugin to be registered

Returns

booleanReturns TRUE if plugin was registered, false if it was already registered

Use the JSON encoding scheme for the value specified

_encode(mixed $value) : string

Parameters

$value

mixed

The value to be encoded

Returns

stringThe encoded value

 Properties

 

All messages to be sent.

$_messages : array

Default

array()
 

Plugins that are using this protocol

$_plugins : array

Default

array()

 Constants

 

The protocol URI for this protocol

PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2'