line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright (c) 2016 CentralNic Ltd. All rights reserved. This program is |
2
|
|
|
|
|
|
|
# free software; you can redistribute it and/or modify it under the same |
3
|
|
|
|
|
|
|
# terms as Perl itself. |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# $Id: Domain.pm,v 1.1 2011/12/03 11:44:52 gavin Exp $ |
6
|
|
|
|
|
|
|
package Net::EPP::Frame::Command::Renew::Domain; |
7
|
1
|
|
|
1
|
|
3
|
use base qw(Net::EPP::Frame::Command::Renew); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
55
|
|
8
|
1
|
|
|
1
|
|
3
|
use Net::EPP::Frame::ObjectSpec; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
12
|
|
9
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
235
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=pod |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Net::EPP::Frame::Command::Renew::Domain - an instance of L |
17
|
|
|
|
|
|
|
for domain objects. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 SYNOPSIS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
use Net::EPP::Frame::Command::Renew::Domain; |
22
|
|
|
|
|
|
|
use strict; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $info = Net::EPP::Frame::Command::Renew::Domain->new; |
25
|
|
|
|
|
|
|
$info->setDomain('example.tld'); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
print $info->toString(1); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
This results in an XML document like this: |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
34
|
|
|
|
|
|
|
xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 |
35
|
|
|
|
|
|
|
epp-1.0.xsd"> |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0" |
40
|
|
|
|
|
|
|
xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 |
41
|
|
|
|
|
|
|
domain-1.0.xsd"> |
42
|
|
|
|
|
|
|
example.tldE/domain:name> |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
0cf1b8f7e14547d26f03b7641660c641d9e79f45 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 OBJECT HIERARCHY |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
L |
52
|
|
|
|
|
|
|
+----L |
53
|
|
|
|
|
|
|
+----L |
54
|
|
|
|
|
|
|
+----L |
55
|
|
|
|
|
|
|
+----L |
56
|
|
|
|
|
|
|
+----L |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub new { |
61
|
0
|
|
|
0
|
0
|
|
my $package = shift; |
62
|
0
|
|
|
|
|
|
my $self = bless($package->SUPER::new('renew'), $package); |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
my $domain = $self->addObject(Net::EPP::Frame::ObjectSpec->spec('domain')); |
65
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
return $self; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=pod |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 METHODS |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
$frame->setDomain('example.tld'); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This method specifies the domain name for the renew. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=cut |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub setDomain { |
80
|
0
|
|
|
0
|
0
|
|
my ($self, $domain) = @_; |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
|
|
|
my $name = $self->createElement('domain:name'); |
83
|
0
|
|
|
|
|
|
$name->appendText($domain); |
84
|
|
|
|
|
|
|
|
85
|
0
|
|
|
|
|
|
$self->getNode('renew')->getChildNodes->shift->appendChild($name); |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
|
|
|
return 1; |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=pod |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
$frame->period($years); |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This sets the optional renewal period. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
sub setPeriod { |
100
|
0
|
|
|
0
|
0
|
|
my ($self, $years) = @_; |
101
|
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
my $period = $self->createElement('domain:period'); |
103
|
0
|
|
|
|
|
|
$period->setAttribute('unit', 'y'); |
104
|
0
|
|
|
|
|
|
$period->appendText($years); |
105
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
$self->getNode('renew')->getChildNodes->shift->appendChild($period); |
107
|
|
|
|
|
|
|
|
108
|
0
|
|
|
|
|
|
return 1; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=pod |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
$frame->setCurExpDate($date) |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This sets the current expiry date for the domain. |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
=cut |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub setCurExpDate { |
120
|
0
|
|
|
0
|
0
|
|
my ($self, $date) = @_; |
121
|
|
|
|
|
|
|
|
122
|
0
|
|
|
|
|
|
my $cur = $self->createElement('domain:curExpDate'); |
123
|
0
|
|
|
|
|
|
$cur->appendText($date); |
124
|
0
|
|
|
|
|
|
$self->getNode('renew')->getChildNodes->shift->appendChild($cur); |
125
|
|
|
|
|
|
|
|
126
|
0
|
|
|
|
|
|
return 1; |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=pod |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=head1 AUTHOR |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
CentralNic Ltd (http://www.centralnic.com/). |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head1 COPYRIGHT |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
This module is (c) 2016 CentralNic Ltd. This module is free software; you can |
139
|
|
|
|
|
|
|
redistribute it and/or modify it under the same terms as Perl itself. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head1 SEE ALSO |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=over |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=item * L |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=back |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=cut |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
1; |