File Coverage

blib/lib/Siebel/Srvrmgr/ListParser/Output/ListTasks/Task.pm
Criterion Covered Total %
statement 17 17 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 24 24 100.0


line stmt bran cond sub pod time code
1             package Siebel::Srvrmgr::ListParser::Output::ListTasks::Task;
2              
3 5     5   5095 use Moose 2.0401;
  5         132  
  5         45  
4 5     5   43262 use MooseX::FollowPBP 0.05;
  5         7880  
  5         43  
5 5     5   28798 use namespace::autoclean 0.13;
  5         116  
  5         40  
6 5     5   1201 use DateTime 1.12;
  5         501476  
  5         165  
7 5     5   787 use Siebel::Srvrmgr::Types;
  5         16  
  5         1229  
8              
9             with 'Siebel::Srvrmgr::ListParser::Output::ToString';
10             with 'Siebel::Srvrmgr::ListParser::Output::Duration';
11             our $VERSION = '0.29'; # VERSION
12              
13             =pod
14              
15             =head1 NAME
16              
17             Siebel::Srvrmgr::ListParser::Output::ListTasks::Task - class to represent a Siebel task
18              
19             =head1 SYNOPSIS
20              
21             my $task = $class->new(
22             {
23             server_name => 'siebfoobar',
24             comp_alias => 'SRProc',
25             id => 5242888,
26             pid => 20503,
27             status => 'Running'
28             }
29             )
30              
31             =head1 DESCRIPTION
32              
33             An object that represents each task from a C<list tasks> command output from srvrmgr program.
34              
35             This class uses the roles L<Siebel::Srvrmgr::ListParser::Output::ToString> and L<Siebel::Srvrmgr::ListParser::Output::Duration>.
36              
37             =head1 ATTRIBUTES
38              
39             The list of attributes, with their respective inner parenthesis:
40              
41             =over
42              
43             =item *
44              
45             server_name: Server name (string)
46              
47             =item *
48              
49             comp_alias: Component alias (string)
50              
51             =item *
52              
53             id: Internal task id (integer)
54              
55             =item *
56              
57             pid: Task process id (integer)
58              
59             =item *
60              
61             run_state: Task run state (string)
62              
63             =item *
64              
65             run_mode: Task run mode (string)
66              
67             =item *
68              
69             status: Task-reported status (string)
70              
71             =item *
72              
73             group_alias: Component group alias (string)
74              
75             =item *
76              
77             parent_id: Parent task id (integer)
78              
79             =item *
80              
81             incarn_no: Incarnation Number (integer)
82              
83             =item *
84              
85             label: Task Label (string)
86              
87             =item *
88              
89             type: Task Type (string)
90              
91             =item *
92              
93             ping_time: Last ping time for task (string)
94              
95             =back
96              
97             The attributes that are required are:
98              
99             =over
100              
101             =item *
102              
103             server_name
104              
105             =item *
106              
107             comp_alias
108              
109             =item *
110              
111             id
112              
113             =item *
114              
115             pid
116              
117             =item *
118              
119             status
120              
121             =back
122              
123             Depending on the type of output recovered from the C<srvrmgr>, not all attributes will be available except the required.
124              
125             =cut
126              
127             has 'server_name' => ( is => 'ro', isa => 'NotNullStr', required => 1 );
128             has 'comp_alias' => ( is => 'ro', isa => 'NotNullStr', required => 1 );
129             has 'id' => ( is => 'ro', isa => 'Int', required => 1 );
130             has 'pid' => ( is => 'ro', isa => 'Int', required => 1 );
131             has 'run_state' => ( is => 'ro', isa => 'NotNullStr', required => 1 );
132             has 'run_mode' => ( is => 'ro', isa => 'Str', 'required' => 0 );
133             has 'status' => ( is => 'ro', isa => 'Str', 'required' => 0 );
134             has 'group_alias' => ( is => 'ro', isa => 'Str', 'required' => 0 );
135             has 'parent_id' => ( is => 'ro', isa => 'Int', 'required' => 0 );
136             has 'incarn_no' => ( is => 'ro', isa => 'Int', 'required' => 0 );
137             has 'label' => ( is => 'ro', isa => 'Str', 'required' => 0 );
138             has 'type' => ( is => 'ro', isa => 'Str', 'required' => 0 );
139             has 'ping_time' => ( is => 'ro', isa => 'Str', 'required' => 0 );
140              
141             =pod
142              
143             =head1 METHODS
144              
145             All attributes have a getter named C<get_E<lt>attribute nameE<gt>>.
146              
147             Since all attributes are read-only there is no corresponding setter.
148              
149             See also the documentation of the use roles for more information.
150              
151             =head2 BUILD
152              
153             This method includes validations in the values provided during object creation.
154              
155             =cut
156              
157             sub BUILD {
158              
159 42     42 1 122 my $self = shift;
160 42         266 $self->fix_endtime;
161              
162             }
163              
164             =head1 SEE ALSO
165              
166             =over
167              
168             =item *
169              
170             L<Siebel::Srvrmgr::ListParser::Output::ToString>
171              
172             =item *
173              
174             L<Siebel::Srvrmgr::ListParser::Output::Duration>
175              
176             =item *
177              
178             L<Siebel::Srvrmgr::ListParser::Output::Tabular::ListTasks>
179              
180             =item *
181              
182             L<Moose>
183              
184             =item *
185              
186             L<MooseX::FollowPBP>
187              
188             =back
189              
190             =head1 AUTHOR
191              
192             Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>.
193              
194             =head1 COPYRIGHT AND LICENSE
195              
196             This software is copyright (c) 2013 of Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>.
197              
198             This file is part of Siebel Monitoring Tools.
199              
200             Siebel Monitoring Tools is free software: you can redistribute it and/or modify
201             it under the terms of the GNU General Public License as published by
202             the Free Software Foundation, either version 3 of the License, or
203             (at your option) any later version.
204              
205             Siebel Monitoring Tools is distributed in the hope that it will be useful,
206             but WITHOUT ANY WARRANTY; without even the implied warranty of
207             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
208             GNU General Public License for more details.
209              
210             You should have received a copy of the GNU General Public License
211             along with Siebel Monitoring Tools. If not, see L<http://www.gnu.org/licenses/>.
212              
213             =cut
214              
215             __PACKAGE__->meta->make_immutable;