Net::RRP::Request - rrp request abstraction class
use Net::RRP::Request; my $request = new Net::RRP::Request;
This is a base class for all Request::* classes.
The constructor. You can pass entity && options attributes to this method. Example:
my $request = new Net::RRP::Request ( entity => new Net::RRP::Entity ( .... ), options => { key => 'value' } ); my $request1 = new Net::RRP::Request ( );
Return a *real* name of this request. You must overwrite this method at child class. Example:
my $requestName = $request->getName(); print STDERR "EntityName is $requestName\n";
Setup the rrp entity for this request. Example:
$request->setEntity ( new Net::RRP::Entity ( ... ) );
Return a entity of this request. Example:
my $entity = $request->getEntity();
Can throw Net::RRP::Exception::MissingRequiredEntity exception
Return a request option by $optionName. Example:
print $request->getOption ( $optionName ); print $request->getOption ( 'ttt' ); # no '-' here
Can throw Net::RRP::Exception::MissingCommandOption() exception.
Set $optionName rrp request option to the $optionValue. Example:
$request->setOption ( $optionName => $optionValue ); $request->setOption ( tt => 'qq' );
Return a hash ref to the request options. Example:
my $options = $request->gtOptions(); map { print "$_ = " . $options->{$_} } keys %$options;
Return a true if response is successfull.
my $protocol = new Net::RRP::Protocol ( .... ); my $request = new Net::RRP::Request::Add ( .... ); $protocol->sendRequest ( $request ); my $response = $protocol->getResponse (); die "error" unless $request->isSuccessResponse ( $response );
Net::RRP::Request (C) Michael Kulakov, Zenon N.S.P. 2000 125124, 19, 1-st Jamskogo polja st, Moscow, Russian Federation mkul@cpan.org All rights reserved. You may distribute this package under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
Net::RRP::Entity(3), Net::RRP::Response(3), Net::RRP::Codec(3), RFC 2832, Net::RRP::Exception::MissingCommandOption(3), Net::RRP::Exception::MissingRequiredEntity(3)
To install Net::RRP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::RRP
CPAN shell
perl -MCPAN -e shell install Net::RRP
For more information on module installation, please visit the detailed CPAN module installation guide.