| 1 | ## Domain Registry Interface, Change Poll Extension Mapping for EPP | ||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2015,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::ChangePoll; | ||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||
| 29 | 0 | state $rops = { 'session' => { change_poll => [ undef, \&parse ] } }; | |||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||
| 31 | 0 | return $rops; | |||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||
| 34 | sub setup | ||||||||||||||||||||||||||
| 35 | { | ||||||||||||||||||||||||||
| 36 | 0 | ▶ | my ($class,$po,$version)=@_; | ||||||||||||||||||||||||
|
Subroutine
setup: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||
| 37 | 0 | state $ns = { 'changepoll' => 'urn:ietf:params:xml:ns:changePoll-1.0' }; | |||||||||||||||||||||||||
| 38 | 0 | $po->ns($ns); | |||||||||||||||||||||||||
| 39 | 0 | return; | |||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||
| 42 | 0 | ▶ | sub implements { return 'https://tools.ietf.org/html/draft-ietf-regext-change-poll-12'; } | ||||||||||||||||||||||||
|
Subroutine
implements: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||
| 44 | #################################################################################################### | ||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||
| 46 | sub parse | ||||||||||||||||||||||||||
| 47 | { | ||||||||||||||||||||||||||
| 48 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||
|
Subroutine
parse: not called CC=14 SCAR=53.5
Pod
undocumented
| |||||||||||||||||||||||||||
| 49 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||
| 50 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||
| 52 | 0 | my $data=$mes->get_extension('changepoll','changeData'); | |||||||||||||||||||||||||
| 53 | 0 | ▶ | return unless defined $data; | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||
| 55 | 0 | ▶ | my %r=('state' => $data->hasAttribute('state') ? $data->getAttribute('state') : 'after'); | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 56 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($data)) | |||||||||||||||||||||||||
| 57 | { | ||||||||||||||||||||||||||
| 58 | 0 | my ($name,$node)=@$el; | |||||||||||||||||||||||||
| 59 | 0 | ▶ | if ($name eq 'operation') | ||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||
| 60 | { | ||||||||||||||||||||||||||
| 61 | 0 | my $value=$node->textContent(); | |||||||||||||||||||||||||
| 62 | 0 | ▶ | $r{$name}=$node->hasAttribute('op') ? [ $value, $node->getAttribute('op') ] : $value; | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 63 | } elsif ($name=~m/^(who|svTRID)$/) | ||||||||||||||||||||||||||
| 64 | { | ||||||||||||||||||||||||||
| 65 | 0 | $r{$name}=$node->textContent(); | |||||||||||||||||||||||||
| 66 | } elsif ($name eq 'date') | ||||||||||||||||||||||||||
| 67 | { | ||||||||||||||||||||||||||
| 68 | 0 | $r{$name}=$po->parse_iso8601($node->textContent()); | |||||||||||||||||||||||||
| 69 | } elsif ($name eq 'caseId') | ||||||||||||||||||||||||||
| 70 | { | ||||||||||||||||||||||||||
| 71 | 0 | my $type=$node->getAttribute('type'); | |||||||||||||||||||||||||
| 72 | 0 | ▶ | $type=$node->getAttribute('name') if $type eq 'custom'; | ||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||
| 73 | 0 | $r{case}={ type => $type, id => $node->textContent() }; | |||||||||||||||||||||||||
| 74 | } elsif ($name eq 'reason') | ||||||||||||||||||||||||||
| 75 | { | ||||||||||||||||||||||||||
| 76 | 0 | ▶ | $r{reason} = $node->hasAttribute('lang') ? { lang => $node->getAttribute('lang') // 'en', msg => $node->textContent() } : $node->textContent(); | ||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$node->getAttribute("lang") // "en"
MC/DC0%0/1
$node->getAttribute("lang") // "en"
$node->getAttribute("lang")
Truth table0%0/2
A
A= $node->getAttribute("lang")
| |||||||||||||||||||||||||||
| 77 | } | ||||||||||||||||||||||||||
| 78 | } | ||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||
| 80 | 0 | my $msgid=$mes->msg_id(); | |||||||||||||||||||||||||
| 81 | 0 | $rinfo->{message}->{$msgid}->{change}=\%r; | |||||||||||||||||||||||||
| 82 | 0 | return; | |||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||
| 85 | #################################################################################################### | ||||||||||||||||||||||||||
| 86 | 1 | 1; | |||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||
| 88 | __END__ | ||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||
| 90 | =pod | ||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||
| 92 | =head1 NAME | ||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||
| 94 | Net::DRI::Protocol::EPP::Extensions::ChangePoll - EPP Change Poll Extension mapping (draft-ietf-regext-change-poll-12) for Net::DRI | ||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||
| 96 | =head1 DESCRIPTION | ||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||
| 98 | Please see the README file for details. | ||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||
| 100 | =head1 SUPPORT | ||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||
| 102 | For now, support questions should be sent to: | ||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||
| 104 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||
| 106 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||
| 108 | =head1 SEE ALSO | ||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||
| 110 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||
| 112 | =head1 AUTHOR | ||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||
| 114 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||
| 116 | =head1 COPYRIGHT | ||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||
| 118 | Copyright (c) 2015,2016,2018,2019 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||
| 119 | All rights reserved. | ||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||
| 121 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||
| 122 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||
| 123 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||
| 124 | (at your option) any later version. | ||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||
| 126 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||
| 128 | =cut | ||||||||||||||||||||||||||