1## Domain Registry Interface, EURid (.EU) policy on reserved names
2##
3## Copyright (c) 2005-2010 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#
16#########################################################################################
17
18package Net::DRI::DRD::EURid;
19
20use strict;
21use warnings;
22
23use base qw/Net::DRI::DRD/;
24
25use Net::DRI::Util;
26use Net::DRI::Exception;
27use DateTime::Duration;
28
29our $VERSION=do { my @r=(q$Revision: 1.14 $=~/\d+/g); sprintf("%d".".%02d" x $#r, @r); };
30
31__PACKAGE__->make_exception_for_unavailable_operations(qw/domain_transfer_query domain_transfer_accept domain_transfer_refuse domain_renew contact_check contact_check_multi contact_transfer contact_transfer_start contact_transfer_stop contact_transfer_query contact_transfer_accept contact_transfer_refuse/);
32
33=pod
34
35=head1 NAME
36
37Net::DRI::DRD::EURid - EURid (.EU) policies for Net::DRI
38
39=head1 DESCRIPTION
40
41Please see the README file for details.
42
43=head1 SUPPORT
44
45For now, support questions should be sent to:
46
47E<lt>netdri@dotandco.comE<gt>
48
49Please also see the SUPPORT file in the distribution.
50
51=head1 SEE ALSO
52
53E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
54
55=head1 AUTHOR
56
57Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
58
59=head1 COPYRIGHT
60
61Copyright (c) 2005-2010 Patrick Mevzek <netdri@dotandco.com>.
62All rights reserved.
63
64This program is free software; you can redistribute it and/or modify
65it under the terms of the GNU General Public License as published by
66the Free Software Foundation; either version 2 of the License, or
67(at your option) any later version.
68
69See the LICENSE file that comes with this distribution for more details.
70
71=cut
72
73#####################################################################################
74
75our %CCA2_EU=map { $_ => 1 } qw/AT BE BG CZ CY DE DK ES EE FI FR GR GB HU IE IT LT LU LV MT NL PL PT RO SE SK SI AX GF GI GP MQ RE/;
76our %LANGA2_EU=map { $_ => 1 } qw/bg cs da de el en es et fi fr ga hu it lt lv mt nl pl pt ro sk sl sv/;
77
78sub new
79{
80 my $class=shift;
81 my $self=$class->SUPER::new(@_);
82 $self->{info}->{host_as_attr}=1;
83 $self->{info}->{contact_i18n}=1; ## LOC only
84 bless($self,$class);
85 return $self;
86}
87
88sub periods  { return map { DateTime::Duration->new(years => $_) } (1); }
89sub name     { return 'EURid'; }
90sub tlds     { return ('eu'); }
91sub object_types { return ('domain','contact','nsgroup'); }
92sub profile_types { return qw/epp das whois das-registrar whois-registrar/; }
93
94sub transport_protocol_default
95{
96 my ($self,$type)=@_;
97
98 return ('Net::DRI::Transport::Socket',{remote_host=>'epp.registry.tryout.eu',remote_port=>33128},'Net::DRI::Protocol::EPP::Extensions::EURid',{}) if $type eq 'epp';
99 return ('Net::DRI::Transport::Socket',{remote_host=>'das.eu'},'Net::DRI::Protocol::DAS',{no_tld=>1})                                              if $type eq 'das';
100 return ('Net::DRI::Transport::Socket',{remote_host=>'whois.eu'},'Net::DRI::Protocol::Whois',{})                                                   if $type eq 'whois';
101 return ('Net::DRI::Transport::Socket',{remote_host=>'das.registry.eu'},'Net::DRI::Protocol::DAS',{no_tld=>1})                                     if $type eq 'das-registrar';
102 return ('Net::DRI::Transport::Socket',{remote_host=>'whois.registry.eu'},'Net::DRI::Protocol::Whois',{})                                          if $type eq 'whois-registrar';
103 return;
104}
105
106######################################################################################
107
108## See terms_and_conditions_v1_0_.pdf, Section 2.2.ii
109sub verify_name_domain
110{
111 my ($self,$ndr,$domain,$op)=@_;
112 return $self->_verify_name_rules($domain,$op,{check_name => 1,
113                                               my_tld => 1,
114                                               min_length => 2,
115                                               no_double_hyphen_except_idn => 1, ## temporary bypass for IDNs
116                                               no_country_code => 1,
117                                              });
118}
119
120sub domain_undelete
121{
122 my ($self,$ndr,$domain,$rd)=@_;
123 $self->enforce_domain_name_constraints($ndr,$domain,'undelete');
124
125 my $rc=$ndr->process('domain','undelete',[$domain,$rd]);
126 return $rc;
127}
128
129sub domain_transfer_quarantine
130{
131 my ($self,$ndr,$domain,$op,$rd)=@_;
132 $self->enforce_domain_name_constraints($ndr,$domain,'transfer_quarantine');
133 Net::DRI::Exception::usererr_invalid_parameters('Transfer from quarantine operation must be start or stop') unless ($op=~m/^(?:start|stop)$/);
134
135 my $rc;
136 if ($op eq 'start')
137 {
138  $rc=$ndr->process('domain','transferq_request',[$domain,$rd]);
139 } elsif ($op eq 'stop')
140 {
141  $rc=$ndr->process('domain','transferq_cancel',[$domain,$rd]);
142 }
143 return $rc;
144}
145
146sub domain_transfer_quarantine_start { my ($self,$ndr,$domain,$rd)=@_; return $self->domain_transfer_quarantine($ndr,$domain,'start',$rd); }
147sub domain_transfer_quarantine_stop  { my ($self,$ndr,$domain,$rd)=@_; return $self->domain_transfer_quarantine($ndr,$domain,'stop',$rd); }
148
149
150sub domain_trade_start
151{
152 my ($self,$ndr,$domain,$rd)=@_;
153 $self->enforce_domain_name_constraints($ndr,$domain,'trade');
154
155 my $rc=$ndr->process('domain','trade_request',[$domain,$rd]);
156 return $rc;
157}
158
159sub domain_trade_stop
160{
161 my ($self,$ndr,$domain,$rd)=@_;
162 $self->enforce_domain_name_constraints($ndr,$domain,'trade');
163
164 my $rc=$ndr->process('domain','trade_cancel',[$domain,$rd]);
165 return $rc;
166}
167
168sub domain_reactivate
169{
170 my ($self,$ndr,$domain,$rd)=@_;
171 $self->enforce_domain_name_constraints($ndr,$domain,'reactivate');
172
173 my $rc=$ndr->process('domain','reactivate',[$domain,$rd]);
174 return $rc;
175}
176
177sub domain_check_contact_for_transfer
178{
179 my ($self,$ndr,$domain,$rd)=@_;
180 $self->enforce_domain_name_constraints($ndr,$domain,'check_contact_for_transfer');
181
182 my $rc=$ndr->process('domain','check_contact_for_transfer',[$domain,$rd]);
183 return $rc;
184}
185
186sub registrar_info
187{
188 my ($self,$ndr)=@_;
189 my $rc=$ndr->process('registrar','info');
190 return $rc;
191}
192
193sub domain_remind
194{
195 my ($self,$ndr,$domain,$rd)=@_;
196 $self->enforce_domain_name_constraints($ndr,$domain,'remind');
197
198 my $rc=$ndr->process('domain','remind',[$domain,$rd]);
199 return $rc;
200}
201
202#################################################################################################################
2031;
204