File Coverage

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