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