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