line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package SRS::EPP::Command::Check::Domain; |
3
|
|
|
|
|
|
|
{ |
4
|
|
|
|
|
|
|
$SRS::EPP::Command::Check::Domain::VERSION = '0.22'; |
5
|
|
|
|
|
|
|
} |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
3422
|
use Moose; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
8
|
|
|
|
|
|
|
extends 'SRS::EPP::Command::Check'; |
9
|
1
|
|
|
1
|
|
7199
|
use SRS::EPP::Session; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use XML::EPP::Domain; |
11
|
|
|
|
|
|
|
use MooseX::Params::Validate; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# for plugin system to connect |
14
|
|
|
|
|
|
|
sub xmlns { |
15
|
|
|
|
|
|
|
XML::EPP::Domain::Node::xmlns(); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub multiple_responses { 1 } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub process { |
21
|
|
|
|
|
|
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my ( $session ) = pos_validated_list( |
24
|
|
|
|
|
|
|
\@_, |
25
|
|
|
|
|
|
|
{ isa => 'SRS::EPP::Session' }, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $epp = $self->message; |
29
|
|
|
|
|
|
|
my $payload = $epp->message->argument->payload; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my @domains = $payload->names; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
$self->log_info( |
34
|
|
|
|
|
|
|
"$self checking domains: @domains", |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
return map { |
38
|
|
|
|
|
|
|
XML::SRS::Whois->new( |
39
|
|
|
|
|
|
|
domain => $_, |
40
|
|
|
|
|
|
|
full => 0, |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
} @domains; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub notify { |
46
|
|
|
|
|
|
|
my $self = shift; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my ( $rs ) = pos_validated_list( |
49
|
|
|
|
|
|
|
\@_, |
50
|
|
|
|
|
|
|
{ isa => 'ArrayRef[SRS::EPP::SRSResponse]' }, |
51
|
|
|
|
|
|
|
); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
my $epp = $self->message; |
54
|
|
|
|
|
|
|
my $payload = $epp->message->argument->payload; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my @response_items; |
57
|
|
|
|
|
|
|
my @errors; |
58
|
|
|
|
|
|
|
my (@available, @unavailable); |
59
|
|
|
|
|
|
|
for my $response (@$rs) { |
60
|
|
|
|
|
|
|
my $domain = $response->message->response; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
my $available = $domain->is_available; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
my $name_status = XML::EPP::Domain::Check::Name->new( |
65
|
|
|
|
|
|
|
name => $domain->name, |
66
|
|
|
|
|
|
|
available => $available, |
67
|
|
|
|
|
|
|
); |
68
|
|
|
|
|
|
|
if ($available) { |
69
|
|
|
|
|
|
|
push @available, $domain->name; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
else { |
72
|
|
|
|
|
|
|
push @unavailable, $domain->name; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
my $result = XML::EPP::Domain::Check::Status->new( |
75
|
|
|
|
|
|
|
name_status => $name_status, |
76
|
|
|
|
|
|
|
); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
push @response_items, $result; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
if (@available) { |
82
|
|
|
|
|
|
|
$self->log_info( |
83
|
|
|
|
|
|
|
"$self: available: @available", |
84
|
|
|
|
|
|
|
); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
if (@unavailable) { |
87
|
|
|
|
|
|
|
$self->log_info( |
88
|
|
|
|
|
|
|
"$self: unavailable: @unavailable", |
89
|
|
|
|
|
|
|
); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
my $r = XML::EPP::Domain::Check::Response->new( |
93
|
|
|
|
|
|
|
items => \@response_items, |
94
|
|
|
|
|
|
|
); |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
return $self->make_response( |
97
|
|
|
|
|
|
|
code => 1000, |
98
|
|
|
|
|
|
|
payload => $r, |
99
|
|
|
|
|
|
|
); |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
1; |