File Coverage

blib/lib/Net/DRI/Protocol/EPP/Extensions/ARNES/Domain.pm
Criterion Covered Total %
statement 9 27 33.3
branch 0 10 0.0
condition 0 6 0.0
subroutine 3 5 60.0
pod 0 2 0.0
total 12 50 24.0


line stmt bran cond sub pod time code
1             ## Domain Registry Interface, .SI Domain EPP extension commands
2             ##
3             ## Copyright (c) 2007,2008,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::ARNES::Domain;
16              
17 1     1   886 use strict;
  1         3  
  1         22  
18 1     1   3 use warnings;
  1         2  
  1         18  
19 1     1   4 use feature 'state';
  1         1  
  1         231  
20              
21             =pod
22              
23             =head1 NAME
24              
25             Net::DRI::Protocol::EPP::Extensions::ARNES::Domain - .SI EPP Domain extension commands for Net::DRI
26              
27             =head1 DESCRIPTION
28              
29             Please see the README file for details.
30              
31             =head1 SUPPORT
32              
33             For now, support questions should be sent to:
34              
35             Enetdri@dotandco.comE
36              
37             Please also see the SUPPORT file in the distribution.
38              
39             =head1 SEE ALSO
40              
41             Ehttp://www.dotandco.com/services/software/Net-DRI/E
42              
43             =head1 AUTHOR
44              
45             Patrick Mevzek, Enetdri@dotandco.comE
46              
47             =head1 COPYRIGHT
48              
49             Copyright (c) 2007,2008,2016 Patrick Mevzek .
50             All rights reserved.
51              
52             This program is free software; you can redistribute it and/or modify
53             it under the terms of the GNU General Public License as published by
54             the Free Software Foundation; either version 2 of the License, or
55             (at your option) any later version.
56              
57             See the LICENSE file that comes with this distribution for more details.
58              
59             =cut
60              
61             ####################################################################################################
62              
63             sub register_commands
64             {
65 0     0 0   my ($class,$version)=@_;
66 0           state $rcmds = { 'domain' => { 'info' => [ undef, \&info_parse ] } };
67 0           return $rcmds;
68             }
69              
70             ####################################################################################################
71              
72             sub info_parse
73             {
74 0     0 0   my ($po,$otype,$oaction,$oname,$rinfo)=@_;
75 0           my $mes=$po->message();
76 0 0         return unless $mes->is_success();
77              
78 0           my $infdata=$mes->get_extension('dnssi','ext');
79 0 0         return unless $infdata;
80              
81 0           $infdata=$infdata->getChildrenByTagName('dnssi:infData');
82 0 0 0       return unless ($infdata && $infdata->size()==1);
83 0           $infdata=$infdata->shift()->getChildrenByTagName('dnssi:domain');
84 0 0 0       return unless ($infdata && $infdata->size()==1);
85 0           $infdata=$infdata->pop();
86              
87 0           my $cs=$rinfo->{domain}->{$oname}->{status};
88 0           foreach my $s (qw/pendingLegislativeReturn pendingLegislativeReturnQuarantine pendingQuarantine serverTransferRegistrantProhibited/)
89             {
90 0 0         if ( $infdata =~ /\"$s\"/ ) {
91 0           $cs->add($s);
92             }
93             }
94              
95 0           return;
96             }
97              
98             ####################################################################################################
99             1;