line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Gnats::Command::DBDESC; |
2
|
40
|
|
|
40
|
|
186
|
use parent 'Net::Gnats::Command'; |
|
40
|
|
|
|
|
68
|
|
|
40
|
|
|
|
|
246
|
|
3
|
40
|
|
|
40
|
|
2096
|
use strictures; |
|
40
|
|
|
|
|
72
|
|
|
40
|
|
|
|
|
206
|
|
4
|
|
|
|
|
|
|
BEGIN { |
5
|
40
|
|
|
40
|
|
8986
|
$Net::Gnats::Command::DBDESC::VERSION = '0.22'; |
6
|
|
|
|
|
|
|
} |
7
|
40
|
|
|
40
|
|
208
|
use vars qw($VERSION); |
|
40
|
|
|
|
|
64
|
|
|
40
|
|
|
|
|
1828
|
|
8
|
|
|
|
|
|
|
|
9
|
40
|
|
|
40
|
|
200
|
use Net::Gnats::Constants qw(CODE_INFORMATION CODE_INVALID_DATABASE CODE_CMD_ERROR); |
|
40
|
|
|
|
|
63
|
|
|
40
|
|
|
|
|
8586
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Net::Gnats::Command::DEDESC |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Returns a human-readable description of the specified database. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 PROTOCOL |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
DBDESC [database] |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 RESPONSES |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Responses include: |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
6xx (internal error) An internal error was encountered while trying |
28
|
|
|
|
|
|
|
to read the list of available databases, usually due to lack of |
29
|
|
|
|
|
|
|
permissions or other filesystem-related problems, or the list of |
30
|
|
|
|
|
|
|
databases is empty. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
350 (CODE_INFORMATION) The normal response; the supplied text is the |
33
|
|
|
|
|
|
|
database description. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
417 (CODE_INVALID_DATABASE) The specified database name does not |
36
|
|
|
|
|
|
|
have an entry. |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
440 (CODE_CMD_ERROR) Required parameter not passed. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my $c = 'DBDESC'; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub new { |
45
|
3
|
|
|
3
|
1
|
8
|
my ( $class, %options ) = @_; |
46
|
|
|
|
|
|
|
|
47
|
3
|
|
|
|
|
5
|
my $self = bless \%options, $class; |
48
|
3
|
|
100
|
|
|
16
|
$self->{name} = $self->{name} || ''; |
49
|
3
|
|
|
|
|
7
|
return $self; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub to_string { |
53
|
0
|
|
|
0
|
0
|
0
|
my ($self) = @_; |
54
|
0
|
|
|
|
|
0
|
return $c . ' ' . $self->{name}; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub is_ok { |
58
|
3
|
|
|
3
|
0
|
4
|
my $self = shift; |
59
|
3
|
100
|
|
|
|
14
|
return 1 if $self->response->code == CODE_INFORMATION; |
60
|
2
|
|
|
|
|
11
|
return 0; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |