DRI/Protocol/RRI.pm

filter: Statementstmt 100% 9 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 12 / 12 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« DRI/Protocol/OpenSRS/XCP.pm ↑ Summary DRI/Protocol/RRP.pm »
1 ## Domain Registry Interface, RRI Protocol (DENIC-11)
2 ##
3 ## Copyright (c) 2007,2008,2009 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>. All rights reserved.
4 ## (c) 2010,2013,2018 Patrick Mevzek <netdri@dotandco.com>. 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::Protocol::RRI;
17  
18 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 2 ▶use base qw(Net::DRI::Protocol);
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 use Net::DRI::Util;
24 use Net::DRI::Protocol::RRI::Message;
25 use Net::DRI::Data::StatusList;
26 use Net::DRI::Data::Contact::DENIC;
27  
28 =pod
29  
30 =head1 NAME
31  
32 Net::DRI::Protocol::RRI - RRI Protocol (DENIC-11) 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 E<lt>tonnerre.lombard@sygroup.chE<gt>
43  
44 Please also see the SUPPORT file in the distribution.
45  
46 =head1 SEE ALSO
47  
48 E<lt>http://oss.bsdprojects.net/projects/netdri/E<gt>
49  
50 =head1 AUTHOR
51  
52 Tonnerre Lombard, E<lt>tonnerre.lombard@sygroup.chE<gt>
53  
54 =head1 COPYRIGHT
55  
56 Copyright (c) 2007,2008,2009 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>.
57 (c) 2010,2013,2018 Patrick Mevzek <netdri@dotandco.com>.
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 my ($c,$ctx,$rp)=@_;
74 my $self=$c->SUPER::new($ctx);
75 $self->name('RRI');
76 my $version=Net::DRI::Util::check_equal($rp->{version},['2.0'],'2.0');
77 $self->version($version);
78  
79 foreach my $o (qw/ip status/) { $self->capabilities('host_update',$o,['set']); }
80 $self->capabilities('host_update','name',['set']);
81 $self->capabilities('contact_update','info',['set']);
82 foreach my $o (qw/ns status contact/) { $self->capabilities('domain_update',$o,['add','del']); }
83 foreach my $o (qw/registrant auth/) { $self->capabilities('domain_update',$o,['set']); }
84  
85 $self->{ns}={ rri => 'http://registry.denic.de/global/1.0',
86 tr => 'http://registry.denic.de/transaction/1.0',
87 contact => 'http://registry.denic.de/contact/1.0',
88 domain => 'http://registry.denic.de/domain/1.0',
89 dnsentry=> 'http://registry.denic.de/dnsentry/1.0',
90 msg => 'http://registry.denic.de/msg/1.0',
91 xsi => 'http://www.w3.org/2001/XMLSchema-instance',
92 };
93  
94 $self->factories('message',sub { my $m=Net::DRI::Protocol::RRI::Message->new(@_); $m->ns($self->{ns}); $m->version($version); return $m; });
95 $self->factories('status',sub { return Net::DRI::Data::StatusList->new(); });
96 $self->factories('contact',sub { return Net::DRI::Data::Contact::DENIC->new(); });
97 $self->_load($rp);
98 return $self;
99 }
100  
101 sub _load
102 {
103 my ($self,$rp)=@_;
104  
105 my @core=('Session','RegistryMessage','Domain','Contact');
106 my @class=map { 'Net::DRI::Protocol::RRI::'.$_ } @core;
107  
108 return $self->SUPER::_load(@class);
109 }
110  
111 sub transport_default
112 {
113 my ($self)=@_;
114 return (protocol_connection => 'Net::DRI::Protocol::RRI::Connection', protocol_version => '2.0');
115 }
116  
117 ####################################################################################################
118 1;
« DRI/Protocol/OpenSRS/XCP.pm ↑ Summary DRI/Protocol/RRP.pm »