File Coverage

blib/lib/Siebel/Srvrmgr/Daemon/Action/ListParams.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package Siebel::Srvrmgr::Daemon::Action::ListParams;
2              
3             =pod
4              
5             =head1 NAME
6              
7             Siebel::Srvrmgr::Daemon::Action::ListParams - subclass of Siebel::Srvrmgr::Daemon::Action to parse list params output
8              
9             =head1 SYNOPSIS
10              
11             use Siebel::Srvrmgr::Daemon::Action::ListParams;
12              
13             my $action = Siebel::Srvrmgr::Daemon::Action::ListParams->new( parser => Siebel::Srvrmgr::ListParser->new(),
14             params => [$filename]);
15              
16             $action->do(\@output);
17              
18              
19             =cut
20              
21 2     2   4759 use Moose;
  2         5  
  2         17  
22 2     2   14343 use namespace::autoclean;
  2         4  
  2         20  
23              
24             extends 'Siebel::Srvrmgr::Daemon::Action';
25             with 'Siebel::Srvrmgr::Daemon::Action::Serializable';
26              
27             =pod
28              
29             =head1 DESCRIPTION
30              
31             This subclass of L<Siebel::Srvrmgr::Daemon::Action> will try to find a L<Siebel::Srvrmgr::ListParser::Output::ListParams> object in the given array reference
32             given as parameter to the C<do> method and stores the parsed data from this object in a serialized file.
33              
34             =head1 METHODS
35              
36             =head2 do_parsed
37              
38             It will check if the object given as parameter is a L<Siebel::Srvrmgr::ListParser::Output::ListParams> object. If true, it is serialized to the
39             filesystem with C<nstore> and the function returns 1 in this case. If none is found it will return 0.
40              
41             =cut
42              
43             override 'do_parsed' => sub {
44              
45             my $self = shift;
46             my $obj = shift;
47              
48             if ( blessed($obj) eq $self->get_exp_output() ) {
49              
50             $obj->store( $self->get_dump_file() );
51              
52             return 1;
53              
54             }
55             else {
56              
57             return 0;
58              
59             }
60              
61             };
62              
63             override '_build_exp_output' => sub {
64              
65             return 'Siebel::Srvrmgr::ListParser::Output::Tabular::ListParams';
66              
67             };
68              
69             =pod
70              
71             =head1 SEE ALSO
72              
73             =over
74              
75             =item *
76              
77             L<Siebel::Srvrmgr::Daemon::Action>
78              
79             =item *
80              
81             L<Siebel::Srvrmgr::Daemon::Action::Serializable>
82              
83             =back
84              
85             =head1 AUTHOR
86              
87             Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>
88              
89             =head1 COPYRIGHT AND LICENSE
90              
91             This software is copyright (c) 2012 of Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>
92              
93             This file is part of Siebel Monitoring Tools.
94              
95             Siebel Monitoring Tools is free software: you can redistribute it and/or modify
96             it under the terms of the GNU General Public License as published by
97             the Free Software Foundation, either version 3 of the License, or
98             (at your option) any later version.
99              
100             Siebel Monitoring Tools is distributed in the hope that it will be useful,
101             but WITHOUT ANY WARRANTY; without even the implied warranty of
102             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
103             GNU General Public License for more details.
104              
105             You should have received a copy of the GNU General Public License
106             along with Siebel Monitoring Tools. If not, see <http://www.gnu.org/licenses/>.
107              
108             =cut
109              
110             __PACKAGE__->meta->make_immutable;