File Coverage

blib/lib/Net/DRI/DRD/COZA.pm
Criterion Covered Total %
statement 28 39 71.7
branch 1 4 25.0
condition n/a
subroutine 10 14 71.4
pod 4 8 50.0
total 43 65 66.1


line stmt bran cond sub pod time code
1             ## Domain Registry Interface, CO.ZA policy on reserved names
2             ##
3             ## Copyright (c) 2011,2012 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::COZA;
16              
17 2     2   1116 use strict;
  2         4  
  2         49  
18 2     2   6 use warnings;
  2         2  
  2         42  
19              
20 2     2   6 use base qw/Net::DRI::DRD/;
  2         2  
  2         561  
21              
22 2     2   12 use Net::DRI::Util;
  2         3  
  2         31  
23 2     2   7 use Net::DRI::Exception;
  2         3  
  2         33  
24 2     2   7 use DateTime::Duration;
  2         2  
  2         510  
25              
26             __PACKAGE__->make_exception_for_unavailable_operations(qw/contact_check contact_transfer contact_transfer_start contact_transfer_stop contact_transfer_query contact_transfer_accept contact_transfer_refuse/);
27              
28             =pod
29              
30             =head1 NAME
31              
32             Net::DRI::DRD::COZA - CO.ZA policies for Net::DRI
33              
34             =head1 DESCRIPTION
35              
36             Please see the README file for details.
37              
38             =head1 SUPPORT
39              
40             For now, support questions should be sent to:
41              
42             Enetdri@dotandco.comE
43              
44             Please also see the SUPPORT file in the distribution.
45              
46             =head1 SEE ALSO
47              
48             Ehttp://www.dotandco.com/services/software/Net-DRI/E
49              
50             =head1 AUTHOR
51              
52             Patrick Mevzek, Enetdri@dotandco.comE
53              
54             =head1 COPYRIGHT
55              
56             Copyright (c) 2011,2012 Patrick Mevzek .
57             All rights reserved.
58              
59             This program is free software; you can redistribute it and/or modify
60             it under the terms of the GNU General Public License as published by
61             the Free Software Foundation; either version 2 of the License, or
62             (at your option) any later version.
63              
64             See the LICENSE file that comes with this distribution for more details.
65              
66             =cut
67              
68             #####################################################################################
69              
70             sub new
71             {
72 1     1 0 2 my $class=shift;
73 1         5 my $self=$class->SUPER::new(@_);
74 1         4 $self->{info}->{host_as_attr}=1;
75 1         1 $self->{info}->{contact_i18n}=1; ## LOC only ## Documentation does not say exactly what is allowed
76 1         2 bless($self,$class);
77 1         2 return $self;
78             }
79              
80 0     0 1 0 sub periods { return map { DateTime::Duration->new(years => $_) } (1); } ## unknown precisely
  0         0  
81 1     1 1 2 sub name { return 'COZA'; }
82 1     1 1 2 sub tlds { return ('co.za'); }
83 0     0 1 0 sub object_types { return (qw/domain contact/); }
84 0     0 0 0 sub profile_types { return qw/epp/; }
85              
86             sub transport_protocol_default
87             {
88 1     1 0 1 my ($self,$type)=@_;
89              
90 1 50       4 return ('Net::DRI::Transport::Socket',{},'Net::DRI::Protocol::EPP::Extensions::COZA',{}) if $type eq 'epp';
91 0           return;
92             }
93              
94             ######################################################################################
95              
96             sub registrar_balance
97             {
98 0     0 0   my ($self,$ndr)=@_;
99 0           my $clid=$self->info('client_id');
100 0           my $rc=$ndr->try_restore_from_cache('registrar',$clid,'balance');
101 0 0         if (! defined $rc) { $rc=$ndr->process('contact','info',[$ndr->local_object('contact')->srid($clid),{balance=>1}]); }
  0            
102 0           return $rc;
103             }
104              
105             #################################################################################################################
106             1;