File Coverage

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