| 1 | package Net::RRP::Request::Quit; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use Net::RRP::Request; | ||
| 5 | use Net::RRP::Exception::InvalidCommandOption; | ||
| 6 | use Net::RRP::Exception::InvalidEntityValue; | ||
| 7 | |||
| 8 | @Net::RRP::Request::Quit::ISA = qw(Net::RRP::Request); | ||
| 9 | $Net::RRP::Request::Quit::VERSION = '0.1'; | ||
| 10 | |||
| 11 | =head1 NAME | ||
| 12 | |||
| 13 | Net::RRP::Request::Quit - rrp quit request representation. | ||
| 14 | |||
| 15 | =head1 SYNOPSIS | ||
| 16 | |||
| 17 | use Net::RRP::Request::Quit; | ||
| 18 | my $quitRequest = new Net::RRP::Request::Quit () | ||
| 19 | |||
| 20 | =head1 DESCRIPTION | ||
| 21 | |||
| 22 | This is a rrp quit request representation class. | ||
| 23 | |||
| 24 | =cut | ||
| 25 | |||
| 26 | =head2 getName | ||
| 27 | |||
| 28 | return a 'Quit' | ||
| 29 | |||
| 30 | =cut | ||
| 31 | |||
| 32 | sub getName { 'Quit' }; | ||
| 33 | |||
| 34 | =head2 setEntity | ||
| 35 | |||
| 36 | throw Net::RRP::Exception::InvalidEntityValue immediate | ||
| 37 | |||
| 38 | =cut | ||
| 39 | |||
| 40 | sub setEntity | ||
| 41 | { | ||
| 42 | throw Net::RRP::Exception::InvalidEntityValue (); | ||
| 43 | } | ||
| 44 | |||
| 45 | =head2 setOption | ||
| 46 | |||
| 47 | throw Net::RRP::Exception::InvalidCommandOption () immediate | ||
| 48 | |||
| 49 | =cut | ||
| 50 | |||
| 51 | sub setOption | ||
| 52 | { | ||
| 53 | throw Net::RRP::Exception::InvalidCommandOption (); | ||
| 54 | } | ||
| 55 | |||
| 56 | =head2 isSuccessResponse | ||
| 57 | |||
| 58 | Only 200 response successfull for quit. | ||
| 59 | |||
| 60 | =cut | ||
| 61 | |||
| 62 | sub isSuccessResponse | ||
| 63 | { | ||
| 64 | my ( $this, $response ) = @_; | ||
| 65 | return { 200 => 1 }->{ $response->getCode() }; | ||
| 66 | } | ||
| 67 | |||
| 68 | |||
| 69 | =head1 AUTHOR AND COPYRIGHT | ||
| 70 | |||
| 71 | Net::RRP::Request::Quit (C) Michael Kulakov, Zenon N.S.P. 2000 | ||
| 72 | 125124, 19, 1-st Jamskogo polja st, | ||
| 73 | Moscow, Russian Federation | ||
| 74 | |||
| 75 | mkul@cpan.org | ||
| 76 | |||
| 77 | All rights reserved. | ||
| 78 | |||
| 79 | You may distribute this package under the terms of either the GNU | ||
| 80 | General Public License or the Artistic License, as specified in the | ||
| 81 | Perl README file. | ||
| 82 | |||
| 83 | =head1 SEE ALSO | ||
| 84 | |||
| 85 | L<Net::RRP::Request(3)>, L<Net::RRP::Codec(3)>, RFC 2832, | ||
| 86 | L<Net::RRP::Exception::InvalidCommandOption(3)>, | ||
| 87 | L<Net::RRP::Exception::InvalidEntityValue(3)> | ||
| 88 | |||
| 89 | =cut | ||
| 90 | |||
| 91 | 1; | ||
| 92 | |||
| 93 | __END__ |