| 1 | ## Domain Registry Interface, EPP AusRegistry Sync | ||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2016,2018-2019 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 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 28 | 0 | my ($class,$version)=@_; | |||||||||||||||||||||||||||
| 29 | 0 | state $rop = { 'domain' => { 'update' => [ \&update, undef ] } }; | |||||||||||||||||||||||||||
| 30 | 0 | return $rop; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | sub setup | ||||||||||||||||||||||||||||
| 34 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
setup: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 35 | 0 | my ($class,$po,$version)=@_; | |||||||||||||||||||||||||||
| 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 | 0 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
update: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 51 | 0 | my ($epp,$domain,$todo)=@_; | |||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||
| 53 | 0 | my $sync=$todo->set('sync'); | |||||||||||||||||||||||||||
| 54 | 0 | ▶ | return unless defined $sync && $sync; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $sync and $sync
MC/DC0%0/2
defined $sync and $sync
defined $sync
$sync
Truth table0%0/3
A and B
A= defined $syncB= $sync
| |||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 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
| |||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | 0 | Net::DRI::Util::check_isa($sync,'DateTime'); | |||||||||||||||||||||||||||
| 59 | 0 | my $date = $sync->clone()->set_time_zone('UTC')->strftime('%FT%T.%6NZ'); | |||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||
| 61 | 0 | $epp->message()->command_extension('sync', ['update', ['exDate', $date]]); | |||||||||||||||||||||||||||
| 62 | 0 | return; | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | #################################################################################################### | ||||||||||||||||||||||||||||
| 66 | 1 | 1; | |||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||
| 68 | __END__ | ||||||||||||||||||||||||||||