RRP/Request/Check.pm untested

filter: Statementstmt 0.0% 0 / 25 Branchbran n/a Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 47 CC 1 SCAR 6.9
CC
1
Cov
0%
getName
2.0
setEntity
2.0
setOption
2.0
CRAP 2.0
1 package Net::RRP::Request::Check;
2  
3 use strict;
4 use Net::RRP::Request;
5 use Net::RRP::Exception::InvalidEntityValue;
6 use Net::RRP::Exception::InvalidCommandOption;
7 @Net::RRP::Request::Check::ISA = qw(Net::RRP::Request);
8 $Net::RRP::Request::Check::VERSION = '0.1';
9  
10 =head1 NAME
11  
12 Net::RRP::Request::Check - rrp check request representation.
13  
14 =head1 SYNOPSIS
15  
16 use Net::RRP::Request::Check;
17 my $checkRequest = new Net::RRP::Request::Check
18 ( entity => new Net::RRP::Entity::Domain ( DomainName => [ 'domain.ru' ] ) );
19 my $checkRequest1 = new Net::RRP::Request::Check ();
20 $checkRequest1->setEntity ( new Net::RRP::Entity::NameServer ( NameServer => [ 'ns1.domain.ru' ] ) );
21  
22 =head1 DESCRIPTION
23  
24 This is a rrp check request representation class.
25  
26 =cut
27  
28 =head2 getName
29  
30 return a 'Check'
31  
32 =cut
33  
34 sub getName { 'Check' };
35  
36 =head2 setEntity
37  
38 throw Net::RRP::Exception::InvalidEntityValue unless entity is Net::RRP::Entity::Domain or Net::RRP::Entity::NameServer
39  
40 =cut
41  
42 sub setEntity
43 {
44 my ( $this, $entity ) = @_;
45 my $ref = ref ( $entity ) || throw Net::RRP::Exception::InvalidEntityValue;
46 { 'Net::RRP::Entity::Domain' => 1,
47 'Net::RRP::Entity::NameServer' => 1,
48 'Net::RRP::Entity::Registrar' => 1,
49 'Net::RRP::Entity::Replica' => 1,
50 'Net::RRP::Entity::Owner' => 1,
51 'Net::RRP::Entity::Contact' => 1 }->{ $ref } || throw Net::RRP::Exception::InvalidEntityValue ();
52 $this->SUPER::setEntity ( $entity );
53 }
54  
55 =head2 setOption
56  
57 throw Net::RRP::Exception::InvalidCommandOption;
58  
59 =cut
60  
61 sub setOption
62 {
63 throw Net::RRP::Exception::InvalidCommandOption ();
64 }
65  
66 =head2 isSuccessResponse
67  
68 Command: CHECK Success: 210, 211, 212, 213
69  
70 =cut
71  
72 sub isSuccessResponse
73 {
74 my ( $this, $response ) = @_;
75 return { 210 => 1, 211 => 1, 212 => 1, 213 => 1 }->{ $response->getCode() };
76 }
77  
78 =head1 AUTHOR AND COPYRIGHT
79  
80 Net::RRP::Request::Check (C) Michael Kulakov, Zenon N.S.P. 2000
81 125124, 19, 1-st Jamskogo polja st,
82 Moscow, Russian Federation
83  
84 mkul@cpan.org
85  
86 All rights reserved.
87  
88 You may distribute this package under the terms of either the GNU
89 General Public License or the Artistic License, as specified in the
90 Perl README file.
91  
92 =head1 SEE ALSO
93  
94 L<Net::RRP::Request(3)>, L<Net::RRP::Codec(3)>, L<Net::RRP::Entity::Domain(3)>,
95 L<Net::RRP::Entity::NameServer(3)>, RFC 2832,
96 L<Net::RRP::Exception::InvalidEntityValue(3)>,
97 L<Net::RRP::Exception::InvalidCommandOption(3)>,
98  
99  
100 =cut
101  
102 1;
103  
104 __END__