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