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: Response.pm,v 1.9 2011/07/04 09:48:51 gavin Exp $ |
6
|
|
|
|
|
|
|
package Net::EPP::Frame::Response; |
7
|
1
|
|
|
1
|
|
348
|
use Net::EPP::ResponseCodes; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
111
|
|
8
|
1
|
|
|
1
|
|
5
|
use base qw(Net::EPP::Frame); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
308
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=pod |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Net::EPP::Frame::Response - an instance of L for server responses |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
This module is a subclass of L that represents EPP server |
19
|
|
|
|
|
|
|
responses. |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Responses are sent back to clients when the server receives a |
22
|
|
|
|
|
|
|
CcommandE> frame. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 OBJECT HIERARCHY |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
L |
27
|
|
|
|
|
|
|
+----L |
28
|
|
|
|
|
|
|
+----L |
29
|
|
|
|
|
|
|
+----L |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=cut |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub new { |
34
|
0
|
|
|
0
|
0
|
|
my $package = shift; |
35
|
0
|
|
|
|
|
|
my $self = $package->SUPER::new('response'); |
36
|
0
|
|
|
|
|
|
return bless($self, $package); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub _addExtraElements { |
40
|
0
|
|
|
0
|
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my $result = $self->createElement('result'); |
43
|
0
|
|
|
|
|
|
$result->appendChild($self->createElement('msg')); |
44
|
0
|
|
|
|
|
|
$self->response->addChild($result); |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
$self->result->setAttribute('code' => COMMAND_FAILED); |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
$self->response->addChild($self->createElement('resData')); |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
my $trID = $self->createElement('trID'); |
51
|
0
|
|
|
|
|
|
$trID->addChild($self->createElement('clTRID')); |
52
|
0
|
|
|
|
|
|
$trID->addChild($self->createElement('svTRID')); |
53
|
0
|
|
|
|
|
|
$self->response->addChild($trID); |
54
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
return 1; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=pod |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 METHODS |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
my $node = $frame->response; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This method returns the L object corresponding to the |
65
|
|
|
|
|
|
|
CcommandE> element. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
my $node = $frame->result; |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This method returns the L object corresponding to the |
70
|
|
|
|
|
|
|
CresultE> element. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
my $node = $frame->msg; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
This method returns the L object corresponding to the |
75
|
|
|
|
|
|
|
CmsgE> element. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
my $node = $frame->resData; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This method returns the L object corresponding to the |
80
|
|
|
|
|
|
|
CresDataE> element. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
my $node = $frame->trID; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This method returns the L object corresponding to the |
85
|
|
|
|
|
|
|
CtrIDE> element. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
my $node = $frame->clTRID; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
This method returns the L object corresponding to the |
90
|
|
|
|
|
|
|
CclTRIDE> element. |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
my $node = $frame->svTRID; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This method returns the L object corresponding to the |
95
|
|
|
|
|
|
|
CsvTRIDE> element. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
0
|
1
|
|
sub response {$_[0]->getNode('response') } |
100
|
0
|
|
|
0
|
0
|
|
sub result {$_[0]->getNode('result') } |
101
|
0
|
|
|
0
|
0
|
|
sub resData {$_[0]->getNode('resData') } |
102
|
0
|
|
|
0
|
0
|
|
sub trID {$_[0]->getNode('trID') } |
103
|
0
|
|
|
0
|
0
|
|
sub clTRID {$_[0]->getNode('clTRID') } |
104
|
0
|
|
|
0
|
0
|
|
sub svTRID {$_[0]->getNode('svTRID') } |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=pod |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
my $msg = $frame->code; |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This method returns the code attribute of the CresultE> |
111
|
|
|
|
|
|
|
element. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub code { |
116
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
117
|
0
|
|
|
|
|
|
my $result = $self->result; |
118
|
0
|
0
|
|
|
|
|
if ($result) { |
119
|
0
|
|
|
|
|
|
return $result->getAttribute('code'); |
120
|
|
|
|
|
|
|
} |
121
|
0
|
|
|
|
|
|
return COMMAND_FAILED; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=pod |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
my $msg = $frame->msg; |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
This method returns a string containing the text content of the |
129
|
|
|
|
|
|
|
CmsgE> element. |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=cut |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub msg { |
134
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
135
|
0
|
|
|
|
|
|
my $msgs = $self->getElementsByLocalName('msg'); |
136
|
0
|
0
|
|
|
|
|
return $msgs->shift->textContent if ($msgs->size == 1); |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=pod |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head1 AUTHOR |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
CentralNic Ltd (http://www.centralnic.com/). |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head1 COPYRIGHT |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
This module is (c) 2016 CentralNic Ltd. This module is free software; you can |
148
|
|
|
|
|
|
|
redistribute it and/or modify it under the same terms as Perl itself. |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 SEE ALSO |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=over |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=item * L |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=back |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=cut |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
1; |