DRI/Protocol/EPP/Extensions/AusRegistry/Sync.pm

filter: Statementstmt 44.4% 16 / 36 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 5 / 10 Podpod 0.0% 0 / 5 totaltotal 35.0% 21 / 60 CC 4 SCAR 19.7
CC
4
Cov
37%
update
20.0
register_commands
2.0
setup
2.0
CRAP 7.2
« DRI/Protocol/EPP/Extensions/Afilias/MaintainerUrl.pm ↑ Summary DRI/DRD/DotCooperation.pm »
1 ## Domain Registry Interface, EPP AusRegistry Sync
2 ##
3 ## Copyright (c) 2016,2018 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::EPP::Extensions::AusRegistry::Sync;
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 1 ▶use feature 'state';
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 ####################################################################################################
25  
26 sub register_commands
27 {
28 0 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
29 0 state $rop = { 'domain' => { 'update' => [ \&update, undef ] } };
30 0 return $rop;
31 }
32  
33 sub setup
34 {
35 0 ▶ my ($class,$po,$version)=@_;
Subroutine setup: not called CC=1 SCAR=6.9
Pod undocumented
36 0 state $ns = { 'sync' => 'urn:X-ar:params:xml:ns:sync-1.0' };
37 0 $po->ns($ns);
38 0 return;
39 }
40  
41 0 ▶sub capabilities_add { return ('domain_update','sync',['set']); }
Subroutine capabilities_add: not called CC=1 SCAR=6.9
Pod undocumented
42  
43 0 ▶sub implements { return 'http://ausregistry.github.io/doc/Domain%20Expiry%20Synchronisation%20Extension%20Mapping%20for%20the%20Extensible%20Provisioning%20Protocol.docx'; }
Subroutine implements: not called CC=1 SCAR=6.9
Pod undocumented
44  
45 ####################################################################################################
46  
47 ############ Transform commands
48  
49 sub update
50 {
51 0 ▶ my ($epp,$domain,$todo)=@_;
Subroutine update: not called CC=4 SCAR=30.0
Pod undocumented
52 0 my $mes=$epp->message();
53  
54 0 my $sync=$todo->set('sync');
55 0 ▶ return unless defined $sync && $sync;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $sync and $sync 0 0 0
Condition0%0/3
defined $sync and $sync
!ll&&!rl&&r
000
MC/DC0%0/2
defined $sync and $sync
defined $sync $sync
Truth table0%0/3
A and B
A= defined $syncB= $sync
ABresult
0X0
100
111
56  
57 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Sync operation can not be mixed with other domain changes') if grep { $_ ne 'sync' } $todo->types();
Branch: 1 branch
BranchTrueFalseTotal
if grep {$_ ne "sync";} $todo->types 0 0 0
58  
59 0 Net::DRI::Util::check_isa($sync,'DateTime');
60 0 my $date = $sync->clone()->set_time_zone('UTC')->strftime('%FT%T.%6NZ');
61  
62 0 my $eid=$mes->command_extension_register('sync', 'update');
63 0 $mes->command_extension($eid,['sync:exDate', $date]);
64 0 return;
65 }
66  
67 ####################################################################################################
68 1 1;
69  
70 __END__
71  
72 =pod
73  
74 =head1 NAME
75  
76 Net::DRI::Protocol::EPP::Extensions::AusRegistry::Sync - EPP AusRegistry Sync command (Domain Expiry Synchronisation Extension) for Net::DRI
77  
78 =head1 DESCRIPTION
79  
80 Please see the README file for details.
81  
82 =head1 SUPPORT
83  
84 For now, support questions should be sent to:
85  
86 E<lt>netdri@dotandco.comE<gt>
87  
88 Please also see the SUPPORT file in the distribution.
89  
90 =head1 SEE ALSO
91  
92 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
93  
94 =head1 AUTHOR
95  
96 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
97  
98 =head1 COPYRIGHT
99  
100 Copyright (c) 2016,2018 Patrick Mevzek <netdri@dotandco.com>.
101 All rights reserved.
102  
103 This program is free software; you can redistribute it and/or modify
104 it under the terms of the GNU General Public License as published by
105 the Free Software Foundation; either version 2 of the License, or
106 (at your option) any later version.
107  
108 See the LICENSE file that comes with this distribution for more details.
109  
110 =cut
« DRI/Protocol/EPP/Extensions/Afilias/MaintainerUrl.pm ↑ Summary DRI/DRD/DotCooperation.pm »