line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::FuncNet::Job; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
3509
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
65
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
49
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
9
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
125
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.2'; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
1072
|
use WebService::FuncNet::JobStatus; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
1164
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
WebService::FuncNet::Job - object representing a job |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 FUNCTIONS |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=head2 new |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
23
|
0
|
|
|
|
|
|
my $self = shift; |
24
|
0
|
|
|
|
|
|
bless $self, $class; |
25
|
0
|
|
|
|
|
|
return $self; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 status |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Probes the status of the job. This is done by implementing the I SOAP method |
31
|
|
|
|
|
|
|
in the background. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $rv = $j->status; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
This subroutine returns a L object, or I if an error occurred. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub status { |
40
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my ( $answer, $trace ) = $self->{ 'clients' }->{ 'MonitorJob' }->( |
43
|
|
|
|
|
|
|
'jobLocator' => { |
44
|
|
|
|
|
|
|
'jobID' => $self->{ 'id' }, |
45
|
|
|
|
|
|
|
'emailAddress' => $self->{ 'emailAddress' } |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
); |
48
|
|
|
|
|
|
|
|
49
|
0
|
0
|
|
|
|
|
if ( $answer ) { |
50
|
0
|
|
|
|
|
|
my $status = |
51
|
|
|
|
|
|
|
WebService::FuncNet::JobStatus->new( $answer->{ 'parameters' }{ 'status' }, $trace ); |
52
|
0
|
|
|
|
|
|
return $status; |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
else { |
55
|
0
|
|
|
|
|
|
return; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head2 cancel |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Cancels the job. This is done by implementing the I SOAP method |
62
|
|
|
|
|
|
|
in the background. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
my $rv = $j->cancel; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This subroutine returns a reference to an array with two elements, the status of the job |
67
|
|
|
|
|
|
|
and the SOAP trace. The status of the job is I if all predictors report it as |
68
|
|
|
|
|
|
|
cancelled. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
This subroutine returns I on error. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub cancel { |
75
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
my ( $answer, $trace ) = $self->{ 'clients' }->{ 'CancelJob' }->( |
78
|
|
|
|
|
|
|
'jobLocator' => { |
79
|
|
|
|
|
|
|
'jobID' => $self->{ 'id' }, |
80
|
|
|
|
|
|
|
'emailAddress' => $self->{ 'emailAddress' } |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
); |
83
|
|
|
|
|
|
|
|
84
|
0
|
0
|
|
|
|
|
if ( $answer ) { |
85
|
0
|
0
|
|
|
|
|
if ( $answer->{ 'parameters' }{ 'status' } eq 'CANCELLED' ) { |
86
|
0
|
|
|
|
|
|
return [ 1, $trace ]; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
else { |
89
|
0
|
|
|
|
|
|
return [ undef, $trace ]; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
else { |
93
|
0
|
|
|
|
|
|
return; |
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head2 results |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Fetches the results from the service. This is done by implementing |
101
|
|
|
|
|
|
|
the I SOAP method in the background. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
my $R = $j->results; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
This subroutine returns a L object. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
This subroutine returns I on error. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=cut |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub results { |
112
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
113
|
|
|
|
|
|
|
|
114
|
0
|
|
|
|
|
|
my ( $answer, $trace ) = |
115
|
|
|
|
|
|
|
$self->{ 'clients' }->{ 'RetrievePairwiseScores' }->( |
116
|
|
|
|
|
|
|
'jobLocator' => { |
117
|
|
|
|
|
|
|
'jobID' => $self->{ 'id' }, |
118
|
|
|
|
|
|
|
'emailAddress' => $self->{ 'emailAddress' } |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
); |
121
|
|
|
|
|
|
|
|
122
|
0
|
0
|
|
|
|
|
if ( $answer ) { |
123
|
0
|
|
|
|
|
|
my $rah_data = $answer->{ 'parameters' }->{ 's' }; |
124
|
0
|
|
|
|
|
|
return WebService::FuncNet::Results->new( $rah_data ); |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
else { |
128
|
0
|
|
|
|
|
|
return; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
1; |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head1 REVISION INFO |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
Revision: $Rev: 64 $ |
138
|
|
|
|
|
|
|
Last editor: $Author: andrew_b_clegg $ |
139
|
|
|
|
|
|
|
Last updated: $Date: 2009-07-06 16:12:20 +0100 (Mon, 06 Jul 2009) $ |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
The latest source code for this project can be checked out from: |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
https://funcnet.svn.sf.net/svnroot/funcnet/trunk |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=cut |