| 1 | ## Domain Registry Interface, ASIA domain extension | ||||||||||
| 2 | ## | ||||||||||
| 3 | ## Copyright (c) 2010,2013,2016 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 | { | ||||||||||
| 27 | 0 | ▶ | my ($class,$version)=@_; | ||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 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 | { | ||||||||||
| 41 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||
|
Subroutine
create: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 42 | |||||||||||
| 43 | 0 | my @d; | |||||||||
| 44 | 0 | push @d,Net::DRI::Protocol::EPP::Extensions::Afilias::MaintainerUrl::create('asia',$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 | my $mes=$epp->message(); | |||||||||
| 58 | 0 | my $eid=$mes->command_extension_register('asia', 'create'); | |||||||||
| 59 | 0 | $mes->command_extension($eid,\@d); | |||||||||
| 60 | 0 | return; | |||||||||
| 61 | } | ||||||||||
| 62 | |||||||||||
| 63 | sub create_parse | ||||||||||
| 64 | { | ||||||||||
| 65 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||
|
Subroutine
create_parse: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 66 | 0 | my $mes=$po->message(); | |||||||||
| 67 | 0 | my $infdata=$mes->get_extension('asia','creData'); | |||||||||
| 68 | |||||||||||
| 69 | 0 | ▶ | return unless defined $infdata; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 70 | |||||||||||
| 71 | 0 | my $c=Net::DRI::Util::xml_child_content($infdata,$mes->ns('asia'),'domainRoid'); | |||||||||
| 72 | 0 | ▶ | $rinfo->{$otype}->{$oname}->{roid}=$c if defined $c; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 73 | 0 | return; | |||||||||
| 74 | } | ||||||||||
| 75 | |||||||||||
| 76 | ## TODO: from liberty-rtk-addon-0.5.1 it seems domainRoid can be in info and update commands, in the asia extension ? | ||||||||||
| 77 | |||||||||||
| 78 | sub update | ||||||||||
| 79 | { | ||||||||||
| 80 | 0 | ▶ | my ($epp,$domain,$todo) = @_; | ||||||||
|
Subroutine
update: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 81 | |||||||||||
| 82 | 0 | my @d; | |||||||||
| 83 | 0 | push @d,Net::DRI::Protocol::EPP::Extensions::Afilias::MaintainerUrl::update('asia',$todo); | |||||||||
| 84 | |||||||||||
| 85 | 0 | my $cs=$todo->set('contact'); | |||||||||
| 86 | 0 | ▶ | if (Net::DRI::Util::isa_contactset($cs)) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 87 | { | ||||||||||
| 88 | 0 | foreach my $type (grep { ! /^(?:registrant|admin|tech|billing)$/ } $cs->types()) | |||||||||
| 89 | { | ||||||||||
| 90 | 0 | push @d,map { ['asia:contact',{type => $type},$_->srid()] } ($cs->get($type)); | |||||||||
| 91 | } | ||||||||||
| 92 | } | ||||||||||
| 93 | |||||||||||
| 94 | 0 | ▶ | return unless @d; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 95 | |||||||||||
| 96 | 0 | my $mes=$epp->message(); | |||||||||
| 97 | 0 | my $eid=$mes->command_extension_register('asia', 'update'); | |||||||||
| 98 | 0 | $mes->command_extension($eid,['asia:chg',@d]); | |||||||||
| 99 | 0 | return; | |||||||||
| 100 | } | ||||||||||
| 101 | |||||||||||
| 102 | sub info_parse | ||||||||||
| 103 | { | ||||||||||
| 104 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||
|
Subroutine
info_parse: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 105 | 0 | my $mes=$po->message(); | |||||||||
| 106 | 0 | my $infdata=$mes->get_extension('asia','infData'); | |||||||||
| 107 | |||||||||||
| 108 | 0 | ▶ | return unless defined $infdata; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 109 | |||||||||||
| 110 | 0 | my $c=Net::DRI::Protocol::EPP::Extensions::Afilias::MaintainerUrl::info_parse($mes->ns('asia'),$infdata); | |||||||||
| 111 | 0 | ▶ | $rinfo->{$otype}->{$oname}->{maintainer_url}=$c if defined $c; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 112 | |||||||||||
| 113 | 0 | my $cs=$rinfo->{$otype}->{$oname}->{contact}; | |||||||||
| 114 | 0 | foreach my $ct ($infdata->getElementsByTagNameNS($mes->ns('asia'),'contact')) | |||||||||
| 115 | { | ||||||||||
| 116 | 0 | $cs->add($po->create_local_object('contact')->srid($ct->textContent()),$ct->getAttribute('type')); | |||||||||
| 117 | } | ||||||||||
| 118 | 0 | return; | |||||||||
| 119 | } | ||||||||||
| 120 | |||||||||||
| 121 | #################################################################################################### | ||||||||||
| 122 | 1 | 1; | |||||||||
| 123 | |||||||||||
| 124 | __END__ | ||||||||||
| 125 | |||||||||||
| 126 | =pod | ||||||||||
| 127 | |||||||||||
| 128 | =head1 NAME | ||||||||||
| 129 | |||||||||||
| 130 | Net::DRI::Protocol::EPP::Extensions::ASIA::Domain - ASIA domain EPP Extension for Net::DRI | ||||||||||
| 131 | |||||||||||
| 132 | =head1 DESCRIPTION | ||||||||||
| 133 | |||||||||||
| 134 | Please see the README file for details. | ||||||||||
| 135 | |||||||||||
| 136 | =head1 SUPPORT | ||||||||||
| 137 | |||||||||||
| 138 | For now, support questions should be sent to: | ||||||||||
| 139 | |||||||||||
| 140 | E<lt>netdri@dotandco.comE<gt> | ||||||||||
| 141 | |||||||||||
| 142 | Please also see the SUPPORT file in the distribution. | ||||||||||
| 143 | |||||||||||
| 144 | =head1 SEE ALSO | ||||||||||
| 145 | |||||||||||
| 146 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||
| 147 | |||||||||||
| 148 | =head1 AUTHOR | ||||||||||
| 149 | |||||||||||
| 150 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||
| 151 | |||||||||||
| 152 | =head1 COPYRIGHT | ||||||||||
| 153 | |||||||||||
| 154 | Copyright (c) 2010,2013,2016 Patrick Mevzek <netdri@dotandco.com>. All rights reserved. | ||||||||||
| 155 | All rights reserved. | ||||||||||
| 156 | |||||||||||
| 157 | This program is free software; you can redistribute it and/or modify | ||||||||||
| 158 | it under the terms of the GNU General Public License as published by | ||||||||||
| 159 | the Free Software Foundation; either version 2 of the License, or | ||||||||||
| 160 | (at your option) any later version. | ||||||||||
| 161 | |||||||||||
| 162 | See the LICENSE file that comes with this distribution for more details. | ||||||||||
| 163 | |||||||||||
| 164 | =cut | ||||||||||