JSON::RPC::Dispatcher::Procedure - The data holder between RPC requests and responses.
version 0.0508
use JSON::RPC::Dispatcher::Procedure; my $proc = JSON::RPC::Dispatcher::Procedure->new; $proc->error_code(300); my $method = $proc->method;
Something needs to act as an intermediary to hold the data and state of requests coming in, RPC being called, and responses going out. THis module fits that bill.
Returns the current error code.
An integer. Sets an error code.
Returns a boolean indicating whether an error code has been set.
Returns the current error message.
A string. Sets an error message.
Returns the current error data. Error data is entirely defined by the application (e.g. detailed error information, nested errors etc.).
A scalar or reference. Sets an error data.
Sets an Invalid Request error as defined by the JSON-RPC 2.0 spec.
Optionally set some error data for the error.
Sets a Method Not Found error as defined by the JSON-RPC 2.0 spec.
Sets an Invalid Params error as defined by the JSON-RPC 2.0 spec.
Sets an Internal Error as defined by the JSON-RPC 2.0 spec.
Returns the name of the procedure to be called.
Per specification, any string is accepted as a potential JSON-RPC method name.
Returns the parameters to be passed into the procedure.
An array or hashref. Sets the parameters. Will set an error if the params are not an array ref or hash ref.
Returns the id of the request.
Sets the id of the request.
Returns the data that will be sent back to the client.
Sets the data that will be sent back to the client.
Formats the data stored in this object into the data structure expected by JSON::RPC::Dispatcher, which will ultimately be returned to the client.
JSON::RPC::Dispatcher is Copyright 2009-2010 Plain Black Corporation (http://www.plainblack.com/) and is licensed under the same terms as Perl itself.
To install JSON::RPC::Dispatcher, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSON::RPC::Dispatcher
CPAN shell
perl -MCPAN -e shell install JSON::RPC::Dispatcher
For more information on module installation, please visit the detailed CPAN module installation guide.