DRI/Protocol/EPP/Extensions/CloudRegistry/LaunchPhase.pm

filter: Statementstmt 18.8% 10 / 53 Branchbran 0.0% 0 / 28 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 37.5% 3 / 8 Podpod 0.0% 0 / 5 totaltotal 13.1% 13 / 99 CC 17 SCAR 35.3
CC
17
Cov
12%
create
72.0
create_parse
20.0
info
20.0
CRAP 34.2
« DRI/Protocol/AdamsNames/WS/Message.pm ↑ Summary DRI/Protocol/Gandi/WS/Domain.pm »
1 ## Domain Registry Interface, Cloud Registry LaunchPhase EPP Extension for managing Sunrise and Landrush
2 ##
3 ## Copyright (c) 2009-2011,2013 Cloud Registry Pty Ltd <http://www.cloudregistry.net>. All rights reserved.
4 ## Copyright (c) 2016 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
5 ##
6 ## This file is part of Net::DRI
7 ##
8 ## Net::DRI is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 2 of the License, or
11 ## (at your option) any later version.
12 ##
13 ## See the LICENSE file that comes with this distribution for more details.
14 ####################################################################################################
15  
16 package Net::DRI::Protocol::EPP::Extensions::CloudRegistry::LaunchPhase;
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 =pod
24  
25 =head1 NAME
26  
27 Net::DRI::Protocol::EPP::Extensions::CloudRegistry::LaunchPhase - Cloud Registry LaunchPhase (Sunrise and Land Rush) EPP Extension for Net::DRI
28  
29 =head1 DESCRIPTION
30  
31 Please see the README file for details.
32  
33 =head1 SUPPORT
34  
35 Please use the issue tracker
36  
37 E<lt>https://github.com/cloudregistry/net-dri/issuesE<gt>
38  
39 Please also see the SUPPORT file in the distribution.
40  
41 =head1 SEE ALSO
42  
43 E<lt>http://www.cloudregistry.net/E<gt> and
44 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
45  
46 =head1 AUTHOR
47  
48 Wil Tan E<lt>wil@cloudregistry.netE<gt>
49  
50 =head1 COPYRIGHT
51  
52 Copyright (c) 2009-2011,2013 Cloud Registry Pty Ltd <http://www.cloudregistry.net>.
53 Copyright (c) 2016 Patrick Mevzek <netdri@dotandco.com>
54 All rights reserved.
55  
56 This program is free software; you can redistribute it and/or modify
57 it under the terms of the GNU General Public License as published by
58 the Free Software Foundation; either version 2 of the License, or
59 (at your option) any later version.
60  
61 See the LICENSE file that comes with this distribution for more details.
62  
63 =cut
64  
65 ####################################################################################################
66  
67 sub register_commands
68 {
69 0 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
70 0 my %tmp=(
71 create => [ \&create, \&create_parse ],
72 info => [ \&info, \&info_parse ],
73 );
74  
75 0 return { 'domain' => \%tmp };
76 }
77  
78 ####################################################################################################
79  
80 sub create
81 {
82 0 ▶ my ($epp,$domain,$rd)=@_;
Subroutine create: not called CC=8 SCAR=42.8
Pod undocumented
83 0 my $mes=$epp->message();
84  
85 0 ▶ return unless Net::DRI::Util::has_key($rd,'lp');
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::has_key($rd, "lp") 0 0 0
86  
87 0 my @lpdata;
88 0 ▶ push @lpdata, ['lp:trademark_name', $rd->{lp}->{trademark_name}] if exists $rd->{lp}->{trademark_name};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"trademark_name"} 0 0 0
89 0 ▶ push @lpdata, ['lp:trademark_number', $rd->{lp}->{trademark_number}] if exists $rd->{lp}->{trademark_number};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"trademark_number"} 0 0 0
90 0 ▶ push @lpdata, ['lp:trademark_locality', $rd->{lp}->{trademark_locality}] if exists $rd->{lp}->{trademark_locality};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"trademark_locality"} 0 0 0
91 0 ▶ push @lpdata, ['lp:trademark_entitlement', $rd->{lp}->{trademark_entitlement}] if exists $rd->{lp}->{trademark_entitlement};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"trademark_entitlement"} 0 0 0
92 0 ▶ push @lpdata, ['lp:pvrc', $rd->{lp}->{pvrc}] if exists $rd->{lp}->{pvrc};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"pvrc"} 0 0 0
93 0 ▶ push @lpdata, ['lp:phase', $rd->{lp}->{phase}] if exists $rd->{lp}->{phase};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"phase"} 0 0 0
94  
95 0 my $eid=$mes->command_extension_register('lp','create');
96 0 $mes->command_extension($eid,[@lpdata]);
97 0 return;
98 }
99  
100 sub create_parse
101 {
102 0 ▶ my ($po, $otype, $oaction, $oname, $rinfo) = @_;
Subroutine create_parse: not called CC=4 SCAR=30.0
Pod undocumented
103 0 my $mes = $po->message();
104 0 my $creData = $mes->get_extension('lp','creData');
105  
106 0 ▶ return unless defined $creData;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $creData 0 0 0
107  
108 0 my $c = $creData->getElementsByTagNameNS($mes->ns('lp'), 'application_id');
109 0 ▶ $rinfo->{$otype}->{$oname}->{lp} = {application_id=>$c->get_node(1)->textContent()} if defined $c && $c->size();
Branch: 1 branch
BranchTrueFalseTotal
if defined $c and $c->size 0 0 0
Condition0%0/3
defined $c and $c->size
!ll&&!rl&&r
000
MC/DC0%0/2
defined $c and $c->size
defined $c $c->size
Truth table0%0/3
A and B
A= defined $cB= $c->size
ABresult
0X0
100
111
110 0 return;
111 }
112  
113 sub info
114 {
115 0 ▶ my ($epp,$domain,$rd)=@_;
Subroutine info: not called CC=4 SCAR=30.0
Pod undocumented
116 0 my $mes=$epp->message();
117  
118 0 ▶ return unless Net::DRI::Util::has_key($rd,'lp');
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::has_key($rd, "lp") 0 0 0
119  
120 0 my @lpdata;
121 0 ▶ push @lpdata, ['lp:application_id', $rd->{lp}->{application_id}] if exists $rd->{lp}->{application_id};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"application_id"} 0 0 0
122 0 ▶ push @lpdata, ['lp:phase', $rd->{lp}->{phase}] if exists $rd->{lp}->{phase};
Branch: 1 branch
BranchTrueFalseTotal
if exists $rd->{"lp"}{"phase"} 0 0 0
123  
124 0 my $eid=$mes->command_extension_register('lp','info');
125 0 $mes->command_extension($eid,[@lpdata]);
126 0 return;
127 }
128  
129 sub info_parse
130 {
131 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine info_parse: not called CC=4 SCAR=30.0
Pod undocumented
132 0 my $mes=$po->message();
133 0 my $infdata=$mes->get_extension('lp','infData');
134  
135 0 ▶ return unless defined $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $infdata 0 0 0
136  
137 0 my %lpdata;
138 0 my $ns=$mes->ns('lp');
139 0 foreach my $el (qw/trademark_name trademark_number trademark_locality trademark_entitlement pvrc phase/)
140 {
141 0 my $v=Net::DRI::Util::xml_child_content($infdata,$ns,$el);
142 0 ▶ $lpdata{$el}=$v if defined $v;
Branch: 1 branch
BranchTrueFalseTotal
if defined $v 0 0 0
143 }
144 0 $rinfo->{$otype}->{$oname}->{lp} = \%lpdata;
145 0 return;
146 }
147  
148 ####################################################################################################
149 1 1;
« DRI/Protocol/AdamsNames/WS/Message.pm ↑ Summary DRI/Protocol/Gandi/WS/Domain.pm »