line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Siebel::Srvrmgr::ListParser::Output; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Siebel::Srvrmgr::ListParser::Output - base class of srvrmgr output |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
use Siebel::Srvrmgr::ListParser::Output; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $output = Siebel::Srvrmgr::ListParser::Output->new({ data_type => 'sometype', |
14
|
|
|
|
|
|
|
raw_data => \@data, |
15
|
|
|
|
|
|
|
cmd_line => 'list something from somewhere'}); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$output->store($complete_pathname); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
28
|
|
|
28
|
|
22535
|
use Moose; |
|
28
|
|
|
|
|
68
|
|
|
28
|
|
|
|
|
200
|
|
22
|
28
|
|
|
28
|
|
206657
|
use MooseX::Storage; |
|
28
|
|
|
|
|
668669
|
|
|
28
|
|
|
|
|
179
|
|
23
|
28
|
|
|
28
|
|
6878
|
use namespace::autoclean; |
|
28
|
|
|
|
|
68
|
|
|
28
|
|
|
|
|
160
|
|
24
|
28
|
|
|
28
|
|
2048
|
use Carp; |
|
28
|
|
|
|
|
64
|
|
|
28
|
|
|
|
|
1806
|
|
25
|
28
|
|
|
28
|
|
155
|
use Siebel::Srvrmgr::Regexes qw(ROWS_RETURNED); |
|
28
|
|
|
|
|
62
|
|
|
28
|
|
|
|
|
7116
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
with Storage( io => 'StorableFile' ); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=pod |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 DESCRIPTION |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Siebel::Srvrmgr::ListParser::Output is a superclass of output types classes. |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
It contains only basic attributes and methods that enable specific parsing and serializable methods. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
The C<parse> method must be overrided by subclasses or a exception will be raised during object creation. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head2 data_type |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Identifies which kind of data is being given to the class. This is usually used by abstract factory class to identify which subclass of |
44
|
|
|
|
|
|
|
Siebel::Srvrmgr::ListParser::Output must be created. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
This attribute is required during object creation. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
has 'data_type' => |
51
|
|
|
|
|
|
|
( is => 'ro', isa => 'Str', reader => 'get_data_type', required => 1 ); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=pod |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head2 raw_data |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
An array reference with the lines to be processed. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This attribute is required during object creation. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
has 'raw_data' => ( |
64
|
|
|
|
|
|
|
is => 'rw', |
65
|
|
|
|
|
|
|
isa => 'ArrayRef', |
66
|
|
|
|
|
|
|
reader => 'get_raw_data', |
67
|
|
|
|
|
|
|
writer => 'set_raw_data', |
68
|
|
|
|
|
|
|
required => 1 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=pod |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 data_parsed |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
An hash reference with the data parsed from C<raw_data> attribute. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
# :TODO:08-10-2013:arfreitas: should use an array reference to use less memory since each subclass will "know" the meaning of |
81
|
|
|
|
|
|
|
# each field because of the expected header sequence |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
has 'data_parsed' => ( |
84
|
|
|
|
|
|
|
is => 'rw', |
85
|
|
|
|
|
|
|
isa => 'HashRef', |
86
|
|
|
|
|
|
|
reader => 'get_data_parsed', |
87
|
|
|
|
|
|
|
writer => 'set_data_parsed' |
88
|
|
|
|
|
|
|
); |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=pod |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 cmd_line |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
A string of the command that originates from the output (the data of C<raw_data> attribute). |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This attribute is required during object creation. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=cut |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
has 'cmd_line' => |
101
|
|
|
|
|
|
|
( isa => 'Str', is => 'ro', reader => 'get_cmd_line', required => 1 ); |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=pod |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 clear_raw |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
A boolean attribute that defines if the raw data recovered from C<srvrmgr> should be kept or discarded as soon as possibly. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Having a default value of true, it should help reducing memory usage or debugging, if set false. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
has 'clear_raw' => ( |
114
|
|
|
|
|
|
|
is => 'rw', |
115
|
|
|
|
|
|
|
isa => 'Bool', |
116
|
|
|
|
|
|
|
reader => 'clear_raw', |
117
|
|
|
|
|
|
|
writer => 'set_clear_raw', |
118
|
|
|
|
|
|
|
default => 0 |
119
|
|
|
|
|
|
|
); |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=pod |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head1 METHODS |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=head2 clear_raw |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Getter for the C<clear_raw> attribute. |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head2 set_clear_raw |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
Setter for the C<clear_raw> attribute. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=head2 get_cmd_line |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
Returns an string of the attribute C<get_cmd_line>. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head2 get_data_parsed |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Retuns an hash reference of C<data_parsed> attribute. |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head2 set_data_parsed |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
Sets the C<data_parsed> attribute. It is expected an hash reference as parameter of the method. |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head2 get_raw_data |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
Returns an array reference of the attribute C<raw_data>. |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head2 set_raw_data |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Sets the C<raw_data> attribute. An array reference is expected as parameter of the method. |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head2 load |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
Method inherited from L<MooseX::Storage::IO::StorableFile> role. It loads a previously serialized Siebel::Srvrmgr::ListParser:Output object into memory. |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head2 store |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Method inherited from L<MooseX::Storage::IO::StorableFile> role. It stores (serializes) a Siebel::Srvrmgr::ListParser:Output object into a file. A a string of the filename |
160
|
|
|
|
|
|
|
(with complete or not full path) is expected as a parameter. |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=head2 BUILD |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
All subclasses of Siebel::Srvrmgr::ListParser::Object will call the method C<parse> right after object instatiation. |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=cut |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
sub BUILD { |
169
|
|
|
|
|
|
|
|
170
|
168
|
|
|
168
|
1
|
457
|
my $self = shift; |
171
|
|
|
|
|
|
|
|
172
|
168
|
|
|
|
|
979
|
$self->parse(); |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
} |
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=pod |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=head2 parse |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
This method must be overrided by subclasses. |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=cut |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
sub parse { |
185
|
|
|
|
|
|
|
|
186
|
0
|
|
|
0
|
1
|
|
confess |
187
|
|
|
|
|
|
|
'parse method must be overrided by subclasses of Siebel::Srvrmgr::ListParser::Output'; |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
} |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=pod |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=head1 SEE ALSO |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=over |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=item * |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
L<Moose> |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=item * |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
L<MooseX::Storage> |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=item * |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
L<MooseX::Storage::IO::StorableFile> |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=item * |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
L<namespace::autoclean> |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=back |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=head1 AUTHOR |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>. |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
This software is copyright (c) 2012 of Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>. |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
This file is part of Siebel Monitoring Tools. |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
Siebel Monitoring Tools is free software: you can redistribute it and/or modify |
226
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
227
|
|
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or |
228
|
|
|
|
|
|
|
(at your option) any later version. |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
Siebel Monitoring Tools is distributed in the hope that it will be useful, |
231
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
232
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
233
|
|
|
|
|
|
|
GNU General Public License for more details. |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
236
|
|
|
|
|
|
|
along with Siebel Monitoring Tools. If not, see L<http://www.gnu.org/licenses/>. |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
=cut |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
241
|
|
|
|
|
|
|
|