File Coverage

blib/lib/Net/DRI/DRD/AFNIC.pm
Criterion Covered Total %
statement 25 37 67.5
branch 1 6 16.6
condition n/a
subroutine 9 14 64.2
pod 4 9 44.4
total 39 66 59.0


line stmt bran cond sub pod time code
1             ## Domain Registry Interface, AFNIC Registry Driver for .FR/.RE/.TF/.YT/.WF/.PM
2             ##
3             ## Copyright (c) 2005-2006,2008-2014,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::DRD::AFNIC;
16              
17 2     2   1326 use strict;
  2         2  
  2         53  
18 2     2   8 use warnings;
  2         2  
  2         46  
19              
20 2     2   6 use base qw/Net::DRI::DRD/;
  2         3  
  2         677  
21              
22 2     2   12 use DateTime::Duration;
  2         2  
  2         32  
23 2     2   7 use Net::DRI::Util;
  2         3  
  2         574  
24              
25             __PACKAGE__->make_exception_for_unavailable_operations(qw/host_update host_current_status host_check host_exist host_delete host_create host_info contact_delete contact_check/);
26              
27             =pod
28              
29             =head1 NAME
30              
31             Net::DRI::DRD::AFNIC - AFNIC (.FR/.RE/.TF/.WF/.PM/.YT) Registry Driver for Net::DRI
32              
33             =head1 DESCRIPTION
34              
35             Please see the README file for details.
36              
37             =head1 SUPPORT
38              
39             For now, support questions should be sent to:
40              
41             Enetdri@dotandco.comE
42              
43             Please also see the SUPPORT file in the distribution.
44              
45             =head1 SEE ALSO
46              
47             Ehttp://www.dotandco.com/services/software/Net-DRI/E
48              
49             =head1 AUTHOR
50              
51             Patrick Mevzek, Enetdri@dotandco.comE
52              
53             =head1 COPYRIGHT
54              
55             Copyright (c) 2005-2006,2008-2014,2016 Patrick Mevzek .
56             All rights reserved.
57              
58             This program is free software; you can redistribute it and/or modify
59             it under the terms of the GNU General Public License as published by
60             the Free Software Foundation; either version 2 of the License, or
61             (at your option) any later version.
62              
63             See the LICENSE file that comes with this distribution for more details.
64              
65             =cut
66              
67             ####################################################################################################
68              
69             sub new
70             {
71 1     1 0 2 my $class=shift;
72 1         5 my $self=$class->SUPER::new(@_);
73 1         5 $self->{info}->{host_as_attr}=1;
74 1         1 $self->{info}->{contact_i18n}=1; ## LOC only
75 1         1 $self->{info}->{check_limit}=7;
76 1         2 return $self;
77             }
78              
79 0     0 1 0 sub periods { return map { DateTime::Duration->new(years => $_) } (1); }
  0         0  
80 1     1 1 2 sub name { return 'AFNIC'; }
81 1     1 1 3 sub tlds { return (qw/fr re tf wf pm yt asso.fr com.fr tm.fr gouv.fr/); } ## see http://www.afnic.fr/doc/autres-nic/dom-tom
82 0     0 1 0 sub object_types { return ('domain','contact'); }
83 0     0 0 0 sub profile_types { return qw/epp dchk/; }
84              
85             sub transport_protocol_default
86             {
87 1     1 0 2 my ($self,$type)=@_;
88              
89 1 50       6 return ('Net::DRI::Transport::Socket',{remote_host => 'epp.sandbox.nic.fr'},'Net::DRI::Protocol::EPP::Extensions::AFNIC',{}) if $type eq 'epp';
90 0 0         return ('Net::DRI::Transport::Socket',{find_remote_server => ['fr.','DCHK1:iris.lwz']},'Net::DRI::Protocol::IRIS',{version=>'1.0',authority=>'fr',request_deflate=>1}) if $type eq 'dchk';
91 0           return;
92             }
93              
94             ####################################################################################################
95              
96             sub domain_operation_needs_is_mine
97             {
98 0     0 0   my ($self,$ndr,$domain,$op)=@_;
99 0 0         return $self->SUPER::domain_operation_needs_is_mine($ndr,$domain,$op) if ($ndr->protocol()->name() eq 'EPP');
100 0           return;
101             }
102              
103             sub domain_recover_start
104             {
105 0     0 0   my ($self,$ndr,$domain,$rd)=@_;
106 0           $self->enforce_domain_name_constraints($ndr,$domain,'recover');
107 0           return $ndr->process('domain','recover_request',[$domain,$rd]);
108             }
109              
110             ####################################################################################################
111             1;