File Coverage

blib/lib/Net/DRI/DRD/AT.pm
Criterion Covered Total %
statement 27 62 43.5
branch 1 8 12.5
condition 0 3 0.0
subroutine 10 21 47.6
pod 4 14 28.5
total 42 108 38.8


line stmt bran cond sub pod time code
1             ## Domain Registry Interface, .AT policy
2             ## Contributed by Michael Braunoeder from NIC.AT
3             ##
4             ## Copyright (c) 2006-2011,2013 Patrick Mevzek . 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::DRD::AT;
17              
18 2     2   1141 use strict;
  2         3  
  2         48  
19 2     2   6 use warnings;
  2         3  
  2         41  
20              
21 2     2   6 use base qw/Net::DRI::DRD/;
  2         3  
  2         577  
22              
23 2     2   10 use DateTime::Duration;
  2         3  
  2         36  
24 2     2   808 use Net::DRI::Data::Contact::AT;
  2         5  
  2         14  
25 2     2   60 use Net::DRI::Util;
  2         3  
  2         921  
26              
27             __PACKAGE__->make_exception_for_unavailable_operations(qw/domain_transfer_accept domain_transfer_refuse domain_renew contact_transfer_stop contact_transfer_query contact_transfer_accept contact_transfer_refuse contact_check/);
28              
29             =pod
30              
31             =head1 NAME
32              
33             Net::DRI::DRD::AT - .AT policies for Net::DRI
34              
35             =head1 DESCRIPTION
36              
37             Please see the README file for details.
38              
39             =head1 SUPPORT
40              
41             For now, support questions should be sent to:
42              
43             Enetdri@dotandco.comE
44              
45             Please also see the SUPPORT file in the distribution.
46              
47             =head1 SEE ALSO
48              
49             Ehttp://www.dotandco.com/services/software/Net-DRI/E
50              
51             =head1 AUTHOR
52              
53             Patrick Mevzek, Enetdri@dotandco.comE
54              
55             =head1 COPYRIGHT
56              
57             Copyright (c) 2006-2011,2013 Patrick Mevzek .
58             All rights reserved.
59              
60             This program is free software; you can redistribute it and/or modify
61             it under the terms of the GNU General Public License as published by
62             the Free Software Foundation; either version 2 of the License, or
63             (at your option) any later version.
64              
65             See the LICENSE file that comes with this distribution for more details.
66              
67             =cut
68              
69             ####################################################################################################
70              
71             sub new
72             {
73 1     1 0 1 my $class=shift;
74 1         13 my $self=$class->SUPER::new(@_);
75 1         5 $self->{info}->{host_as_attr}=2; ## this means we want IPs in all cases (even for nameservers in domain name)
76 1         2 $self->{info}->{contact_i18n}=2; ## INT only
77 1         2 return $self;
78             }
79              
80 0     0 1 0 sub periods { return map { DateTime::Duration->new(years => $_) } (1); }
  0         0  
81 1     1 1 1 sub name { return 'NICAT'; }
82 1     1 1 2 sub tlds { return ('at'); }
83 0     0 1 0 sub object_types { return ('domain','contact'); }
84 0     0 0 0 sub profile_types { return qw/epp whois/; }
85              
86             sub transport_protocol_default
87             {
88 1     1 0 1 my ($self,$type)=@_;
89              
90 1 50       3 return ('Net::DRI::Transport::Socket',{},'Net::DRI::Protocol::EPP::Extensions::AT',{}) if $type eq 'epp';
91 0 0         return ('Net::DRI::Transport::Socket',{remote_host=>'whois.nic.at'},'Net::DRI::Protocol::Whois',{}) if $type eq 'whois';
92 0           return;
93             }
94              
95             sub set_factories
96             {
97 0     0 0   my ($self,$po)=@_;
98 0     0     $po->factories('contact',sub { return Net::DRI::Data::Contact::AT->new(@_); });
  0            
99 0           return;
100             }
101              
102             ####################################################################################################
103              
104             sub verify_name_domain
105             {
106 0     0 0   my ($self,$ndr,$domain,$op)=@_;
107 0           return $self->_verify_name_rules($domain,$op,{check_name_no_dots => 1, ## is this correct?
108             my_tld_not_strict => 1, ## is this correct?
109             });
110             }
111              
112             sub domain_withdraw
113             {
114 0     0 0   my ($self,$ndr,$domain,$rd)=@_;
115 0           $self->enforce_domain_name_constraints($ndr,$domain,'withdraw');
116 0           $rd=Net::DRI::Util::create_params('domain_withdraw',$rd);
117 0           $rd->{transactionname}='withdraw';
118              
119 0           my $rc=$ndr->process('domain','nocommand',[$domain,$rd]);
120 0           return $rc;
121             }
122              
123             sub domain_transfer_execute
124             {
125 0     0 0   my ($self,$ndr,$domain,$rd)=@_;
126 0           $self->enforce_domain_name_constraints($ndr,$domain,'transfer_execute');
127 0           $rd=Net::DRI::Util::create_params('domain_transfer_execute',$rd);
128 0           $rd->{transactionname}='transfer_execute';
129              
130 0           my $rc=$ndr->process('domain','nocommand',[$domain,$rd]);
131 0           return $rc;
132             }
133              
134             sub message_retrieve
135             {
136 0     0 0   my ($self,$ndr,$id)=@_;
137 0           my $rc=$ndr->process('message','atretrieve',[$id]);
138 0           return $rc;
139             }
140              
141             sub message_delete
142             {
143 0     0 0   my ($self,$ndr,$id)=@_;
144 0           my $rc=$ndr->process('message','atdelete',[$id]);
145 0           return $rc;
146             }
147              
148             sub message_count
149             {
150 0     0 0   my ($self,$ndr)=@_;
151 0           my $rc=$ndr->process('message','atretrieve');
152 0 0         return unless $rc->is_success();
153 0           my $count=$ndr->get_info('count','message','info');
154 0 0 0       return (defined($count) && $count)? $count : 0;
155             }
156              
157             ####################################################################################################
158             1;