DRI/Protocol/AFNIC/WS/Domain.pm

filter: Statementstmt 25.9% 7 / 27 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 2 / 6 Podpod 0.0% 0 / 4 totaltotal 18.0% 9 / 50 CC 6 SCAR 27.3
CC
6
Cov
18%
build_msg
30.0
check_parse
6.0
register_commands
2.0
CRAP 15.3
« DRI/Logging/Files.pm ↑ Summary DRI/Protocol/EPP/Extensions/IT/Notifications.pm »
1 ## Domain Registry Interface, AFNIC Web Services Domain commands
2 ##
3 ## Copyright (c) 2005,2013 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
4 ##
5 ## This file is part of Net::DRI
6 ##
7 ## Net::DRI is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2 of the License, or
10 ## (at your option) any later version.
11 ##
12 ## See the LICENSE file that comes with this distribution for more details.
13 #########################################################################################
14  
15 package Net::DRI::Protocol::AFNIC::WS::Domain;
16  
17 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 =pod
21  
22 =head1 NAME
23  
24 Net::DRI::Protocol::AFNIC::WS::Domain - AFNIC Web Services Domain commands for Net::DRI
25  
26 =head1 DESCRIPTION
27  
28 Please see the README file for details.
29  
30 =head1 SUPPORT
31  
32 For now, support questions should be sent to:
33  
34 E<lt>netdri@dotandco.comE<gt>
35  
36 Please also see the SUPPORT file in the distribution.
37  
38 =head1 SEE ALSO
39  
40 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
41  
42 =head1 AUTHOR
43  
44 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
45  
46 =head1 COPYRIGHT
47  
48 Copyright (c) 2005,2013 Patrick Mevzek <netdri@dotandco.com>.
49 All rights reserved.
50  
51 This program is free software; you can redistribute it and/or modify
52 it under the terms of the GNU General Public License as published by
53 the Free Software Foundation; either version 2 of the License, or
54 (at your option) any later version.
55  
56 See the LICENSE file that comes with this distribution for more details.
57  
58 =cut
59  
60 ##########################################################
61  
62 sub register_commands
63 0 ▶{
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
64 0 my ($class,$version)=@_;
65 0 my %tmp=(
66 check => [ \&check, \&check_parse ],
67 );
68  
69 0 return { 'domain' => \%tmp };
70 }
71  
72 sub build_msg
73 0 ▶{
Subroutine build_msg: not called CC=5 SCAR=34.0
Pod undocumented
74 0 my ($msg,$command,$domain)=@_;
75 0 ▶ Net::DRI::Exception->die(1,'protocol/afnic/ws',2,"Domain name needed") unless defined($domain) && $domain;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $domain and $domain 0 0 0
Condition0%0/3
defined $domain and $domain
!ll&&!rl&&r
000
MC/DC0%0/2
defined $domain and $domain
defined $domain $domain
Truth table0%0/3
A and B
A= defined $domainB= $domain
ABresult
0X0
100
111
76 0 ▶ Net::DRI::Exception->die(1,'protocol/afnic/ws',10,"Invalid domain name") unless ($domain=~m/^[a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?\.[a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?$/i); ## from RRP grammar
Branch: 1 branch
BranchTrueFalseTotal
unless $domain =~ /^[a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?\.[a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?$/i 0 0 0
77  
78 0 ▶ $msg->method($command) if defined($command);
Branch: 1 branch
BranchTrueFalseTotal
if defined $command 0 0 0
79 0 return;
80 }
81  
82 sub check
83 0 ▶{
Subroutine check: not called CC=1 SCAR=6.9
Pod undocumented
84 0 my ($po,$domain)=@_;
85 0 my $msg=$po->message();
86 0 build_msg($msg,'check_domain',$domain);
87 0 $msg->params([$domain]);
88 0 $msg->service('Domain');
89 0 return;
90 }
91  
92 sub check_parse
93 0 ▶{
Subroutine check_parse: not called CC=2 SCAR=17.9
Pod undocumented
94 0 my ($po,$otype,$oaction,$oname,$rinfo)=@_;
95 0 my $mes=$po->message();
96 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
97  
98 0 my $r=$mes->result(); ## { free => 0|1, reason => \d+, message => '' }
99 0 $rinfo->{domain}->{$oname}->{exist}=1-($r->{free});
100 0 return;
101 }
102  
103 #########################################################################################################
104 1 1;
« DRI/Logging/Files.pm ↑ Summary DRI/Protocol/EPP/Extensions/IT/Notifications.pm »