1## Domain Registry Interface, .CAT policies 2## 3## Copyright (c) 2006,2008,2009 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::CAT; 19 20use strict; 21use warnings; 22 23use base qw/Net::DRI::DRD/; 24 25use DateTime::Duration; 26use Net::DRI::Data::Contact::CAT; 27 28our $VERSION=do { my @r=(q$Revision: 1.6 $=~/\d+/g); sprintf("%d".".%02d" x $#r, @r); }; 29 30=pod 31 32=head1 NAME 33 34Net::DRI::DRD::CAT - .CAT policies for Net::DRI 35 36=head1 DESCRIPTION 37 38Please see the README file for details. 39 40=head1 SUPPORT 41 42For now, support questions should be sent to: 43 44E<lt>netdri@dotandco.comE<gt> 45 46Please also see the SUPPORT file in the distribution. 47 48=head1 SEE ALSO 49 50E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> 51 52=head1 AUTHOR 53 54Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> 55 56=head1 COPYRIGHT 57 58Copyright (c) 2006,2008,2009 Patrick Mevzek <netdri@dotandco.com>. 59All rights reserved. 60 61This program is free software; you can redistribute it and/or modify 62it under the terms of the GNU General Public License as published by 63the Free Software Foundation; either version 2 of the License, or 64(at your option) any later version. 65 66See the LICENSE file that comes with this distribution for more details. 67 68=cut 69 70#################################################################################################### 71 72sub new 73{ 74 my $class=shift; 75 my $self=$class->SUPER::new(@_); 76 $self->{info}->{host_as_attr}=0; 77 bless($self,$class); 78 return $self; 79} 80 81## The registry allows renewal as long as final date is less than 11 years in the future (10 years & 5 months would thus be ok) 82## We are currently more restrictive than that, see DRD::verify_duration_renew() 83sub periods { return map { DateTime::Duration->new(years => $_) } (1..10); } 84sub name { return 'CAT'; } 85sub tlds { return ('cat'); } 86sub object_types { return ('domain','contact','ns'); } 87sub profile_types { return qw/epp whois/; } 88 89sub transport_protocol_default 90{ 91 my ($self,$type)=@_; 92 93 return ('Net::DRI::Transport::Socket',{remote_host=>'epp.ote.puntcat.corenic.net'},'Net::DRI::Protocol::EPP::Extensions::CAT',{}) if $type eq 'epp'; 94 return ('Net::DRI::Transport::Socket',{remote_host=>'whois.cat'},'Net::DRI::Protocol::Whois',{}) if $type eq 'whois'; 95 return; 96} 97 98sub set_factories 99{ 100 my ($self,$po)=@_; 101 $po->factories('contact',sub { return Net::DRI::Data::Contact::CAT->new(@_); }); 102} 103 104#################################################################################################### 1051; 106