line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SRS::EPP::Command::PayloadClass; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$SRS::EPP::Command::PayloadClass::VERSION = '0.22'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
30463
|
use Moose::Role; |
|
1
|
|
|
|
|
983068
|
|
|
1
|
|
|
|
|
8
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub payload_class { |
9
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
10
|
0
|
|
|
|
|
|
my $class = ref $self; |
11
|
0
|
|
|
|
|
|
my $root_element = shift; |
12
|
0
|
|
|
|
|
|
my $xmlns = shift; |
13
|
0
|
|
|
|
|
|
our $payload_classes; |
14
|
0
|
0
|
|
|
|
|
if ( !$payload_classes->{$class} ) { |
15
|
0
|
0
|
|
|
|
|
$payload_classes->{$class} = { |
16
|
|
|
|
|
|
|
map { |
17
|
0
|
|
|
|
|
|
$_->can("xmlns") |
18
|
|
|
|
|
|
|
? ($_->action.":".$_->xmlns => $_) |
19
|
|
|
|
|
|
|
: (); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
$self->plugins, |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#print "payload classes for $class are: ".Dumper($payload_classes->{$class}); |
25
|
|
|
|
|
|
|
} |
26
|
0
|
|
|
|
|
|
$payload_classes->{$class}{ $root_element.":".$xmlns }; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub REBLESS { |
30
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
31
|
0
|
0
|
|
|
|
|
if ( my $epp = $self->message ) { |
32
|
0
|
0
|
|
|
|
|
my $payload = eval { $epp->message->argument->payload } or return; |
|
0
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# print "payload is $payload\n"; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# ASSERT($payload->does("PRANG::Graph")); |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $root_element = $payload->root_element; |
39
|
0
|
|
|
|
|
|
my $xmlns = $payload->xmlns; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# print "looking for plugin that handles $root_element ($xmlns)\n"; |
42
|
|
|
|
|
|
|
|
43
|
0
|
0
|
|
|
|
|
if (my $class = $self->payload_class($root_element, $xmlns)) { |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# print "reblessing $self into $class\n"; |
46
|
0
|
|
|
|
|
|
bless $self, $class; |
47
|
1
|
|
|
1
|
|
6590
|
no strict 'refs'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
116
|
|
48
|
0
|
0
|
|
|
|
|
$self->REBLESS if defined &{"${class}::REBLESS"}; |
|
0
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |