« DRI/Protocol/EPP/Extensions/DNSBE/Domain.pm
↑ Summary
DRI/Protocol/EPP/Extensions/VeriSign/ZoneManagement.pm »
| 1 | ## Domain Registry Interface, RRI Message | ||||||||||||||||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2007-2009,2013 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 4 | ## (c) 2018 Patrick Mevzek <netdri@dotandco.com>. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 5 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 6 | ## This file is part of Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 7 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 8 | ## Net::DRI is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 9 | ## it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 10 | ## the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 11 | ## (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 12 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 13 | ## See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 14 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||
| 16 | package Net::DRI::Protocol::RRI::Message; | ||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use XML::LibXML (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use Net::DRI::Protocol::ResultStatus; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | use Net::DRI::Exception; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | ▶ | use Net::DRI::Util; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||
| 27 | 1 | ▶ | use base qw(Class::Accessor::Chained::Fast Net::DRI::Protocol::Message); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 1 | __PACKAGE__->mk_accessors(qw(version command command_body cltrid svtrid result | |||||||||||||||||||||||||||||||||||||||||
| 29 | errcode errmsg node_resdata result_extra_info)); | ||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||
| 31 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||
| 35 | Net::DRI::Protocol::RRI::Message - RRI Message for Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | Please see the README file for details. | ||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||
| 43 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||
| 45 | E<lt>tonnerre.lombard@sygroup.chE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||
| 49 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||
| 51 | E<lt>http://oss.bsdprojects.net/projects/netdri/E<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | Tonnerre Lombard, E<lt>tonnerre.lombard@sygroup.chE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | Copyright (c) 2007-2009,2013 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>. | ||||||||||||||||||||||||||||||||||||||||||
| 60 | All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||
| 62 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 63 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 64 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 65 | (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||
| 67 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||
| 69 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||
| 73 | sub new | ||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | my $trid = shift; | |||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | my $self = { | |||||||||||||||||||||||||||||||||||||||||
| 79 | result => 'uninitialized', | ||||||||||||||||||||||||||||||||||||||||||
| 80 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | bless($self,$class); | |||||||||||||||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | $self->cltrid($trid) if (defined($trid) && $trid); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $trid and $trid
MC/DC0%0/2
defined $trid and $trid
defined $trid
$trid
Truth table0%0/3
A and B
A= defined $tridB= $trid
| |||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | sub ns | ||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
ns: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | my ($self,$what)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | ▶ | return $self->{ns} unless defined($what); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | if (ref($what) eq 'HASH') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 94 | { | ||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | $self->{ns}=$what; | |||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | return $what; | |||||||||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | return unless exists($self->{ns}->{$what}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | return $self->{ns}->{$what}; | |||||||||||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | sub is_success { return (shift->result() =~ m/^success/)? 1 : 0; } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_success: not called CC=2 SCAR=17.9
Pod
undocumented
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | sub result_status | ||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
result_status: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | my $self=shift; | |||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | ▶ | my $rs = Net::DRI::Protocol::ResultStatus->new('rri', | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 108 | ($self->is_success() ? 1000 : $self->errcode()), undef, | ||||||||||||||||||||||||||||||||||||||||||
| 109 | $self->is_success(), $self->errmsg(), 'en', | ||||||||||||||||||||||||||||||||||||||||||
| 110 | $self->result_extra_info()); | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | $rs->_set_trid([ $self->cltrid(), $self->svtrid() ]); | |||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | return $rs; | |||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | sub as_string | ||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
as_string: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | my ($self)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | my $rns=$self->ns(); | |||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | my $ens=sprintf('xmlns="%s"', $rns->{rri}); | |||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | my $cmdi = $self->command(); | |||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | my @d; | |||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | push @d,'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'; | |||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | my ($type, $cmd, $ns, $attr); | |||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | ($type, $cmd, $ns, $attr) = @{$cmdi} if (ref($cmdi) eq 'ARRAY'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | $attr = '' unless (defined($attr)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | $attr = ' ' . join(' ', map { $_ . '="' . $attr->{$_} . '"' } | |||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | sort { $a cmp $b } keys (%{$attr})) if (ref($attr) eq 'HASH'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | if (defined($ns)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 131 | { | ||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | if (ref($ns) eq 'HASH') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | { | ||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | $ens .= ' ' . join(' ', map { 'xmlns:' . $_ . '="' . $ns->{$_} . '"' } | |||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | sort { $a cmp $b } keys(%{$ns})); | |||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | $cmd = $type . ':' . $cmd; | |||||||||||||||||||||||||||||||||||||||||
| 137 | } | ||||||||||||||||||||||||||||||||||||||||||
| 138 | else | ||||||||||||||||||||||||||||||||||||||||||
| 139 | { | ||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | $ens .= ' xmlns:' . $type . '="' . $ns . '"'; | |||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | $cmd = $type . ':' . $cmd; | |||||||||||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||||||||||||
| 144 | else | ||||||||||||||||||||||||||||||||||||||||||
| 145 | { | ||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | $cmd = $type; | |||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | $type = undef; | |||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | push @d,'<registry-request '.$ens.'>'; | |||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | my $body=$self->command_body(); | |||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | if (defined($body) && $body) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $body and $body
MC/DC0%0/2
defined $body and $body
defined $body
$body
Truth table0%0/3
A and B
A= defined $bodyB= $body
| |||||||||||||||||||||||||||||||||||||||||||
| 154 | { | ||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | push @d,'<'.$cmd.$attr.'>'; | |||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | push @d,Net::DRI::Util::xml_write($body); | |||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | push @d,'</'.$cmd.'>'; | |||||||||||||||||||||||||||||||||||||||||
| 158 | } else | ||||||||||||||||||||||||||||||||||||||||||
| 159 | { | ||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | push @d,'<'.$cmd.$attr.'/>'; | |||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||||||||||||||||
| 163 | ## OPTIONAL clTRID | ||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | my $cltrid=$self->cltrid(); | |||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | push @d,'<ctid>'.$cltrid.'</ctid>' | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
defined $cltrid and $cltrid and Net::DRI::Util::xml_is_token($cltrid, 3, 64)
defined $cltrid and $cltrid
MC/DC0%0/3
defined $cltrid and $cltrid and Net::DRI::Util::xml_is_token($cltrid, 3, 64)
defined $cltrid
$cltrid
Net::DRI::Util::xml_is_token($cltrid, 3, 64)
Truth table0%0/4
A and B and C
A= defined $cltridB= $cltridC= Net::DRI::Util::xml_is_token($cltrid, 3, 64)
| |||||||||||||||||||||||||||||||||||||||||||
| 166 | if (defined($cltrid) && $cltrid && | ||||||||||||||||||||||||||||||||||||||||||
| 167 | Net::DRI::Util::xml_is_token($cltrid,3,64)); | ||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | push @d,'</registry-request>'; | |||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | return join('',@d); | |||||||||||||||||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | ▶ | sub topns { return shift->ns->{rri}; } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
topns: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||
| 175 | sub get_content | ||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get_content: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | my ($self,$nodename,$ns,$ext)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | return unless (defined($nodename) && $nodename); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $nodename and $nodename
MC/DC0%0/2
defined $nodename and $nodename
defined $nodename
$nodename
Truth table0%0/3
A and B
A= defined $nodenameB= $nodename
| |||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | my @tmp; | |||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | my $n1=$self->node_resdata(); | |||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | ▶ | @tmp=$n1->getElementsByTagNameNS($ns // $self->topns(),$nodename) if (defined($n1)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ns // $self->topns
MC/DC0%0/2
$ns // $self->topns
$ns
$self->topns
Truth table0%0/3
A // B
A= $nsB= $self->topns
| |||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | return unless @tmp; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | ▶ | return wantarray()? @tmp : $tmp[0]; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 187 | } | ||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||
| 189 | sub parse | ||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse: not called CC=12 SCAR=50.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | my ($self,$dc,$rinfo)=@_; | |||||||||||||||||||||||||||||||||||||||||
| 192 | 0 | my $trNS = $self->ns('tr'); | |||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | my $parser=XML::LibXML->new(); | |||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | my $xstr = $dc->as_string(); | |||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | $xstr =~ s/^\s*//; | |||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | my $doc=$parser->parse_string($xstr); | |||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | my $root=$doc->getDocumentElement(); | |||||||||||||||||||||||||||||||||||||||||
| 198 | 0 | ▶ | Net::DRI::Exception->die(0, 'protocol/RRI', 1, | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 199 | 'Unsuccessfull parse, root element is not registry-response') | ||||||||||||||||||||||||||||||||||||||||||
| 200 | unless ($root->getName() eq 'registry-response'); | ||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | my @trtags = $root->getElementsByTagNameNS($trNS, 'transaction'); | |||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | ▶ | Net::DRI::Exception->die(0, 'protocol/RRI', 1, | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 204 | 'Unsuccessfull parse, no transaction block') unless (@trtags); | ||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | my $res = $trtags[0]; | |||||||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||||||||
| 207 | ## result block(s) | ||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | my @results = $res->getElementsByTagNameNS($trNS,'result'); ## success indicator | |||||||||||||||||||||||||||||||||||||||||
| 209 | 0 | foreach (@results) | |||||||||||||||||||||||||||||||||||||||||
| 210 | { | ||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | $self->result($_->firstChild()->getData()); | |||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | ▶ | if ($res->getElementsByTagNameNS($trNS,'message')) ## OPTIONAL | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 215 | { | ||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | my @msgs = $res->getElementsByTagNameNS($trNS,'message'); | |||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | my $msg = $msgs[0]; | |||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | my @extra = (); | |||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | if (defined($msg)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 221 | { | ||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | my @texts = $msg->getElementsByTagNameNS($trNS, 'text'); | |||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | my $msgtype = $msg->getAttribute('level'); | |||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | my $text = $texts[0]; | |||||||||||||||||||||||||||||||||||||||||
| 225 | |||||||||||||||||||||||||||||||||||||||||||
| 226 | 0 | ▶ | if ($msgtype eq 'error') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 227 | { | ||||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | $self->errcode($msg->getAttribute('code')); | |||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | $self->errmsg($text->getFirstChild()->getData()) if (defined($text)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | } | ||||||||||||||||||||||||||||||||||||||||||
| 231 | else | ||||||||||||||||||||||||||||||||||||||||||
| 232 | { | ||||||||||||||||||||||||||||||||||||||||||
| 233 | 0 | ▶ | push @extra, { from => 'rri', type => 'text', code => $msg->getAttribute('code'), message => (defined $text ? $text->textContent() : '') }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||
| 235 | } | ||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | $self->result_extra_info(\@extra); | |||||||||||||||||||||||||||||||||||||||||
| 237 | } | ||||||||||||||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | if ($res->getElementsByTagNameNS($trNS,'data')) ## OPTIONAL | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 240 | { | ||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | $self->node_resdata(($res->getElementsByTagNameNS($trNS,'data'))[0]); | |||||||||||||||||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||
| 244 | ## trID | ||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | ▶ | if ($res->getElementsByTagNameNS($trNS, 'stid')) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 246 | { | ||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | my @svtrid = $res->getElementsByTagNameNS($trNS, 'stid'); | |||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | $self->svtrid($svtrid[0]->firstChild()->getData()); | |||||||||||||||||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | ▶ | if ($res->getElementsByTagNameNS($trNS, 'ctid')) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 251 | { | ||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | my @cltrid = $res->getElementsByTagNameNS($trNS, 'ctid'); | |||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | $self->cltrid($cltrid[0]->firstChild()->getData()); | |||||||||||||||||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||||||
| 259 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 260 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||