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