Net::RRP::Response - the base class for the Net::RRP::Response::* classes


Net-RRP documentation  | view source Contained in the Net-RRP distribution.

Index


NAME

Top

    Net::RRP::Response - the base class for the Net::RRP::Response::* classes

SYNOPSIS

Top

 use Net::RRP::Response;
 my $response = new Net::RRP::Response ();




DESCRIPTION

Top

This is a base class of all Response::* classes. Child class must overwrite a getCode method and setup own constrains for attributes at setAttribute method. Child classes must named Net::RRP::Response::nNNN, where NNN is a response number.

new

The constructor. You can setup attributes and description. Example:

 use Net::RRP::Response;
 my $response = new Net::RRP::Response ();
 my $otherResponse = new Net::RRP::Response ( attributes  => { qq => 'tt'},
					      description => 'this is a response description' );

newFromException

Construct new response object from exception infomation;

 my $response = newFromException Net::RRP::Response ( new Net::RRP::Exception ( "description", $code ) );

getCode

This method return a code (number) of response. Must be overwrited at child classes. Example:

 my $responseNumber = $response->getCode;

getDescription

Get response description. Example:

 my $description = $response->getDescription();

setDescription

Set response description. Example:

 $response->setDescription ( 'this is a response description' );

getAttribute

Return a named response attribute. Example:

 my $attribute = $response->getAttribute ( 'name' );

setAttribute

Setup a named attribute. Example:

 $response->setAttribute ( 'name' => 'value' );

getAttributes

Get response attributes hash ref. Example:

 my $attributes = $response->getAttributes;
 map { print "$_ = " . $attributes->{$_} } keys %$attributes;

AUTHOR AND COPYRIGHT

Top

SEE ALSO

Top

Net::RRP::Entity(3), Net::RRP::Request(3), Net::RRP::Codec(3), Net::RRP::Exception(3), RFC 2832


Net-RRP documentation  | view source Contained in the Net-RRP distribution.