4284 |
21 Dec 16 |
nicklas |
1 |
package net.sf.basedb.opengrid.service; |
4284 |
21 Dec 16 |
nicklas |
2 |
|
4284 |
21 Dec 16 |
nicklas |
3 |
import net.sf.basedb.opengrid.JobIdentifier; |
4284 |
21 Dec 16 |
nicklas |
4 |
import net.sf.basedb.opengrid.JobStatus; |
4284 |
21 Dec 16 |
nicklas |
5 |
import net.sf.basedb.opengrid.OpenGridSession; |
4284 |
21 Dec 16 |
nicklas |
6 |
|
4284 |
21 Dec 16 |
nicklas |
7 |
/** |
4309 |
17 Jan 17 |
nicklas |
Defines an interface for hooking non-grid jobs into the async feature |
4284 |
21 Dec 16 |
nicklas |
of status updates made by {@link OpenGridService}. Implementors may register |
4284 |
21 Dec 16 |
nicklas |
with the {@link OpenGridService#asyncJobStatusUpdate(JobIdentifier, JobStatusUpdater)} |
4284 |
21 Dec 16 |
nicklas |
and they will get called during the next job status update. |
4284 |
21 Dec 16 |
nicklas |
12 |
|
4309 |
17 Jan 17 |
nicklas |
If the {@link JobIdentifier} specifies an existing cluster, the implementor will be |
4309 |
17 Jan 17 |
nicklas |
provided with an open SSH session to that cluster. Otherwise the session parameter is |
4309 |
17 Jan 17 |
nicklas |
null. |
4309 |
17 Jan 17 |
nicklas |
16 |
|
4309 |
17 Jan 17 |
nicklas |
All other information that the updater is needing must be taken care of externally. |
4309 |
17 Jan 17 |
nicklas |
If the job identifier also identifies a BASE job and a status update is returned that |
4309 |
17 Jan 17 |
nicklas |
service will make sure that the job is updates and that the {@link JobCompletionHandler} |
4284 |
21 Dec 16 |
nicklas |
extension is invoked. |
4284 |
21 Dec 16 |
nicklas |
21 |
|
4284 |
21 Dec 16 |
nicklas |
@author nicklas |
4284 |
21 Dec 16 |
nicklas |
@since 1.0 |
4284 |
21 Dec 16 |
nicklas |
24 |
*/ |
4284 |
21 Dec 16 |
nicklas |
25 |
public interface JobStatusUpdater |
4284 |
21 Dec 16 |
nicklas |
26 |
{ |
4284 |
21 Dec 16 |
nicklas |
27 |
/** |
4284 |
21 Dec 16 |
nicklas |
A request for status information about the identified job. |
4309 |
17 Jan 17 |
nicklas |
29 |
|
4309 |
17 Jan 17 |
nicklas |
@param session A connected session to an Open Grid Cluster (or null if the jobId doesn't specify a cluster) |
4309 |
17 Jan 17 |
nicklas |
@param jobId An identifier for the job |
4284 |
21 Dec 16 |
nicklas |
32 |
*/ |
4284 |
21 Dec 16 |
nicklas |
33 |
public JobStatus getJobStatus(OpenGridSession session, JobIdentifier jobId); |
4284 |
21 Dec 16 |
nicklas |
34 |
|
4284 |
21 Dec 16 |
nicklas |
35 |
} |