| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Net::EPP::Frame::Response; | 
| 2 | 1 |  |  | 1 |  | 409 | use Net::EPP::ResponseCodes; | 
|  | 1 |  |  |  |  | 1356 |  | 
|  | 1 |  |  |  |  | 145 |  | 
| 3 | 1 |  |  | 1 |  | 7 | use base qw(Net::EPP::Frame); | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 541 |  | 
| 4 |  |  |  |  |  |  |  | 
| 5 |  |  |  |  |  |  | =pod | 
| 6 |  |  |  |  |  |  |  | 
| 7 |  |  |  |  |  |  | =head1 NAME | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | Net::EPP::Frame::Response - an instance of L for server responses | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 12 |  |  |  |  |  |  |  | 
| 13 |  |  |  |  |  |  | This module is a subclass of L that represents EPP server | 
| 14 |  |  |  |  |  |  | responses. | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | Responses are sent back to clients when the server receives a | 
| 17 |  |  |  |  |  |  | CcommandE> frame. | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | =head1 OBJECT HIERARCHY | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  | L | 
| 22 |  |  |  |  |  |  | +----L | 
| 23 |  |  |  |  |  |  | +----L | 
| 24 |  |  |  |  |  |  | +----L | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | =cut | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  | sub new { | 
| 29 | 0 |  |  | 0 | 1 |  | my $package = shift; | 
| 30 | 0 |  |  |  |  |  | my $self = $package->SUPER::new('response'); | 
| 31 | 0 |  |  |  |  |  | return bless($self, $package); | 
| 32 |  |  |  |  |  |  | } | 
| 33 |  |  |  |  |  |  |  | 
| 34 |  |  |  |  |  |  | sub _addExtraElements { | 
| 35 | 0 |  |  | 0 |  |  | my $self = shift; | 
| 36 |  |  |  |  |  |  |  | 
| 37 | 0 |  |  |  |  |  | my $result = $self->createElement('result'); | 
| 38 | 0 |  |  |  |  |  | $result->appendChild($self->createElement('msg')); | 
| 39 | 0 |  |  |  |  |  | $self->response->addChild($result); | 
| 40 |  |  |  |  |  |  |  | 
| 41 | 0 |  |  |  |  |  | $self->result->setAttribute('code' => COMMAND_FAILED); | 
| 42 |  |  |  |  |  |  |  | 
| 43 | 0 |  |  |  |  |  | $self->response->addChild($self->createElement('resData')); | 
| 44 |  |  |  |  |  |  |  | 
| 45 | 0 |  |  |  |  |  | my $trID = $self->createElement('trID'); | 
| 46 | 0 |  |  |  |  |  | $trID->addChild($self->createElement('clTRID')); | 
| 47 | 0 |  |  |  |  |  | $trID->addChild($self->createElement('svTRID')); | 
| 48 | 0 |  |  |  |  |  | $self->response->addChild($trID); | 
| 49 |  |  |  |  |  |  |  | 
| 50 | 0 |  |  |  |  |  | return 1; | 
| 51 |  |  |  |  |  |  | } | 
| 52 |  |  |  |  |  |  |  | 
| 53 |  |  |  |  |  |  | =pod | 
| 54 |  |  |  |  |  |  |  | 
| 55 |  |  |  |  |  |  | =head1 METHODS | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | my $node = $frame->response; | 
| 58 |  |  |  |  |  |  |  | 
| 59 |  |  |  |  |  |  | This method returns the L object corresponding to the | 
| 60 |  |  |  |  |  |  | CcommandE> element. | 
| 61 |  |  |  |  |  |  |  | 
| 62 |  |  |  |  |  |  | my $node = $frame->result; | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | This method returns the L object corresponding to the | 
| 65 |  |  |  |  |  |  | CresultE> element. | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  | my $node = $frame->msg; | 
| 68 |  |  |  |  |  |  |  | 
| 69 |  |  |  |  |  |  | This method returns the L object corresponding to the | 
| 70 |  |  |  |  |  |  | CmsgE> element. | 
| 71 |  |  |  |  |  |  |  | 
| 72 |  |  |  |  |  |  | my $node = $frame->resData; | 
| 73 |  |  |  |  |  |  |  | 
| 74 |  |  |  |  |  |  | This method returns the L object corresponding to the | 
| 75 |  |  |  |  |  |  | CresDataE> element. | 
| 76 |  |  |  |  |  |  |  | 
| 77 |  |  |  |  |  |  | my $node = $frame->trID; | 
| 78 |  |  |  |  |  |  |  | 
| 79 |  |  |  |  |  |  | This method returns the L object corresponding to the | 
| 80 |  |  |  |  |  |  | CtrIDE> element. | 
| 81 |  |  |  |  |  |  |  | 
| 82 |  |  |  |  |  |  | my $node = $frame->clTRID; | 
| 83 |  |  |  |  |  |  |  | 
| 84 |  |  |  |  |  |  | This method returns the L object corresponding to the | 
| 85 |  |  |  |  |  |  | CclTRIDE> element. | 
| 86 |  |  |  |  |  |  |  | 
| 87 |  |  |  |  |  |  | my $node = $frame->svTRID; | 
| 88 |  |  |  |  |  |  |  | 
| 89 |  |  |  |  |  |  | This method returns the L object corresponding to the | 
| 90 |  |  |  |  |  |  | CsvTRIDE> element. | 
| 91 |  |  |  |  |  |  |  | 
| 92 |  |  |  |  |  |  | =cut | 
| 93 |  |  |  |  |  |  |  | 
| 94 | 0 |  |  | 0 | 1 |  | sub response {$_[0]->getNode('response') } | 
| 95 | 0 |  |  | 0 | 0 |  | sub result {$_[0]->getNode('result') } | 
| 96 |  |  |  |  |  |  | sub msg {$_[0]->getNode('msg') } | 
| 97 | 0 |  |  | 0 | 0 |  | sub resData {$_[0]->getNode('resData') } | 
| 98 | 0 |  |  | 0 | 0 |  | sub trID {$_[0]->getNode('trID') } | 
| 99 | 0 |  |  | 0 | 0 |  | sub clTRID {$_[0]->getNode('clTRID') } | 
| 100 | 0 |  |  | 0 | 0 |  | sub svTRID {$_[0]->getNode('svTRID') } | 
| 101 |  |  |  |  |  |  |  | 
| 102 |  |  |  |  |  |  | =pod | 
| 103 |  |  |  |  |  |  |  | 
| 104 |  |  |  |  |  |  | my $msg = $frame->code; | 
| 105 |  |  |  |  |  |  |  | 
| 106 |  |  |  |  |  |  | This method returns the code attribute of the CresultE> | 
| 107 |  |  |  |  |  |  | element. | 
| 108 |  |  |  |  |  |  |  | 
| 109 |  |  |  |  |  |  | =cut | 
| 110 |  |  |  |  |  |  |  | 
| 111 |  |  |  |  |  |  | sub code { | 
| 112 | 0 |  |  | 0 | 0 |  | my $self = shift; | 
| 113 | 0 |  |  |  |  |  | my $result = $self->result; | 
| 114 | 0 | 0 |  |  |  |  | if ($result) { | 
| 115 | 0 |  |  |  |  |  | return $result->getAttribute('code'); | 
| 116 |  |  |  |  |  |  | } | 
| 117 | 0 |  |  |  |  |  | return COMMAND_FAILED; | 
| 118 |  |  |  |  |  |  | } | 
| 119 |  |  |  |  |  |  |  | 
| 120 |  |  |  |  |  |  | =pod | 
| 121 |  |  |  |  |  |  |  | 
| 122 |  |  |  |  |  |  | my $msg = $frame->msg; | 
| 123 |  |  |  |  |  |  |  | 
| 124 |  |  |  |  |  |  | This method returns a string containing the text content of the | 
| 125 |  |  |  |  |  |  | CmsgE> element. | 
| 126 |  |  |  |  |  |  |  | 
| 127 |  |  |  |  |  |  | =cut | 
| 128 |  |  |  |  |  |  |  | 
| 129 |  |  |  |  |  |  | sub msg { | 
| 130 | 0 |  |  | 0 | 0 |  | my $self = shift; | 
| 131 | 0 |  |  |  |  |  | my $msgs = $self->getElementsByLocalName('msg'); | 
| 132 | 0 | 0 |  |  |  |  | return $msgs->shift->textContent if ($msgs->size == 1); | 
| 133 |  |  |  |  |  |  | } | 
| 134 |  |  |  |  |  |  |  | 
| 135 |  |  |  |  |  |  | 1; |