line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, EPP AusRegistry Sync |
2
|
|
|
|
|
|
|
## |
3
|
|
|
|
|
|
|
## Copyright (c) 2016 Patrick Mevzek . 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
|
|
|
1
|
|
980
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
18
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
23
|
|
19
|
1
|
|
|
1
|
|
4
|
use feature 'state'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
54
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
4
|
use Net::DRI::Util; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
22
|
1
|
|
|
1
|
|
4
|
use Net::DRI::Exception; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
279
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#################################################################################################### |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub register_commands |
27
|
|
|
|
|
|
|
{ |
28
|
0
|
|
|
0
|
0
|
|
my ($class,$version)=@_; |
29
|
0
|
|
|
|
|
|
state $rop = { 'domain' => { 'update' => [ \&update, undef ] } }; |
30
|
0
|
|
|
|
|
|
return $rop; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub setup |
34
|
|
|
|
|
|
|
{ |
35
|
0
|
|
|
0
|
0
|
|
my ($class,$po,$version)=@_; |
36
|
0
|
|
|
|
|
|
state $ns = { 'sync' => [ 'urn:X-ar:params:xml:ns:sync-1.0','sync-1.0.xsd' ] }; |
37
|
0
|
|
|
|
|
|
$po->ns($ns); |
38
|
0
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
0
|
|
sub capabilities_add { return ('domain_update','sync',['set']); } |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
0
|
|
sub implements { return 'http://ausregistry.github.io/doc/Domain%20Expiry%20Synchronisation%20Extension%20Mapping%20for%20the%20Extensible%20Provisioning%20Protocol.docx'; } |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#################################################################################################### |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
############ Transform commands |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub update |
50
|
|
|
|
|
|
|
{ |
51
|
0
|
|
|
0
|
0
|
|
my ($epp,$domain,$todo)=@_; |
52
|
0
|
|
|
|
|
|
my $mes=$epp->message(); |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
my $sync=$todo->set('sync'); |
55
|
0
|
0
|
0
|
|
|
|
return unless defined $sync && $sync; |
56
|
|
|
|
|
|
|
|
57
|
0
|
0
|
|
|
|
|
Net::DRI::Exception::usererr_invalid_parameters('Sync operation can not be mixed with other domain changes') if grep { $_ ne 'sync' } $todo->types(); |
|
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; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |