| 1 | ## Domain Registry Interface, ASIA domain extension | ||||||||||
| 2 | ## | ||||||||||
| 3 | ## Copyright (c) 2010,2013,2016,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::ASIA::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 | 1 | ▶ | use Net::DRI::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 1 | ▶ | use Net::DRI::Protocol::EPP::Extensions::Afilias::MaintainerUrl; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | |||||||||||
| 23 | #################################################################################################### | ||||||||||
| 24 | |||||||||||
| 25 | sub register_commands | ||||||||||
| 26 | 0 | ▶ | { | ||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 27 | 0 | my ($class,$version)=@_; | |||||||||
| 28 | 0 | my %tmp=( | |||||||||
| 29 | create => [ \&create, \&create_parse ], | ||||||||||
| 30 | update => [ \&update, undef ], | ||||||||||
| 31 | info => [ undef, \&info_parse ], | ||||||||||
| 32 | ); | ||||||||||
| 33 | |||||||||||
| 34 | 0 | return { 'domain' => \%tmp }; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | #################################################################################################### | ||||||||||
| 38 | |||||||||||
| 39 | sub create | ||||||||||
| 40 | 0 | ▶ | { | ||||||||
|
Subroutine
create: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 41 | 0 | my ($epp,$domain,$rd)=@_; | |||||||||
| 42 | |||||||||||
| 43 | 0 | my @d; | |||||||||
| 44 | 0 | push @d,Net::DRI::Protocol::EPP::Extensions::Afilias::MaintainerUrl::create($rd); | |||||||||
| 45 | |||||||||||
| 46 | 0 | ▶ | if (Net::DRI::Util::has_contact($rd)) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 47 | { | ||||||||||
| 48 | 0 | my $cs=$rd->{contact}; | |||||||||
| 49 | 0 | foreach my $type (grep { ! /^(?:registrant|admin|tech|billing|regAgent)$/ } $cs->types()) | |||||||||
| 50 | { | ||||||||||
| 51 | 0 | push @d,map { ['asia:contact',{type => $type},$_->srid()] } ($cs->get($type)); | |||||||||
| 52 | } | ||||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | 0 | ▶ | return unless @d; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 56 | |||||||||||
| 57 | 0 | $epp->message()->command_extension('asia', ['create', @d]); | |||||||||
| 58 | 0 | return; | |||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | sub create_parse | ||||||||||
| 62 | 0 | ▶ | { | ||||||||
|
Subroutine
create_parse: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 63 | 0 | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | |||||||||
| 64 | 0 | my $mes=$po->message(); | |||||||||
| 65 | 0 | my $infdata=$mes->get_extension('asia','creData'); | |||||||||
| 66 | |||||||||||
| 67 | 0 | ▶ | return unless defined $infdata; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 68 | |||||||||||
| 69 | 0 | my $c=Net::DRI::Util::xml_child_content($infdata,$mes->ns('asia'),'domainRoid'); | |||||||||
| 70 | 0 | ▶ | $rinfo->{$otype}->{$oname}->{roid}=$c if defined $c; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 71 | 0 | return; | |||||||||
| 72 | } | ||||||||||
| 73 | |||||||||||
| 74 | ## TODO: from liberty-rtk-addon-0.5.1 it seems domainRoid can be in info and update commands, in the asia extension ? | ||||||||||
| 75 | |||||||||||
| 76 | sub update | ||||||||||
| 77 | 0 | ▶ | { | ||||||||
|
Subroutine
update: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 78 | 0 | my ($epp,$domain,$todo) = @_; | |||||||||
| 79 | |||||||||||
| 80 | 0 | my @d; | |||||||||
| 81 | 0 | push @d,Net::DRI::Protocol::EPP::Extensions::Afilias::MaintainerUrl::update($todo); | |||||||||
| 82 | |||||||||||
| 83 | 0 | my $cs=$todo->set('contact'); | |||||||||
| 84 | 0 | ▶ | if (Net::DRI::Util::isa_contactset($cs)) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 85 | { | ||||||||||
| 86 | 0 | foreach my $type (grep { ! /^(?:registrant|admin|tech|billing)$/ } $cs->types()) | |||||||||
| 87 | { | ||||||||||
| 88 | 0 | push @d,map { ['asia:contact',{type => $type},$_->srid()] } ($cs->get($type)); | |||||||||
| 89 | } | ||||||||||
| 90 | } | ||||||||||
| 91 | |||||||||||
| 92 | 0 | ▶ | return unless @d; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 93 | |||||||||||
| 94 | 0 | $epp->message()->command_extension('asia',['update', ['chg', @d]]); | |||||||||
| 95 | 0 | return; | |||||||||
| 96 | } | ||||||||||
| 97 | |||||||||||
| 98 | sub info_parse | ||||||||||
| 99 | 0 | ▶ | { | ||||||||
|
Subroutine
info_parse: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 100 | 0 | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | |||||||||
| 101 | 0 | my $mes=$po->message(); | |||||||||
| 102 | 0 | my $infdata=$mes->get_extension('asia','infData'); | |||||||||
| 103 | |||||||||||
| 104 | 0 | ▶ | return unless defined $infdata; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 105 | |||||||||||
| 106 | 0 | my $c=Net::DRI::Protocol::EPP::Extensions::Afilias::MaintainerUrl::info_parse($mes->ns('asia'),$infdata); | |||||||||
| 107 | 0 | ▶ | $rinfo->{$otype}->{$oname}->{maintainer_url}=$c if defined $c; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 108 | |||||||||||
| 109 | 0 | my $cs=$rinfo->{$otype}->{$oname}->{contact}; | |||||||||
| 110 | 0 | foreach my $ct ($infdata->getElementsByTagNameNS($mes->ns('asia'),'contact')) | |||||||||
| 111 | { | ||||||||||
| 112 | 0 | $cs->add($po->create_local_object('contact')->srid($ct->textContent()),$ct->getAttribute('type')); | |||||||||
| 113 | } | ||||||||||
| 114 | 0 | return; | |||||||||
| 115 | } | ||||||||||
| 116 | |||||||||||
| 117 | #################################################################################################### | ||||||||||
| 118 | 1 | 1; | |||||||||
| 119 | |||||||||||
| 120 | __END__ | ||||||||||