View Javadoc

1   package fr.in2p3.jsaga.sync.job;
2   
3   import org.ogf.saga.error.*;
4   import org.ogf.saga.job.JobDescription;
5   
6   import java.io.InputStream;
7   import java.io.OutputStream;
8   
9   /**
10   * Jobs are created by a {@link SyncJobService}, using a {@link JobDescription}.
11   * The <code>Job</code> interface extends the
12   * {@link org.ogf.saga.task.Task Task} interface, but jobs don't have an
13   * associated Saga object or a result object, so the generic instantiation
14   * parameters are {@link java.lang.Void Void}.
15   */
16  public interface SyncJob {
17  
18      /**
19       * Retrieves the job description that was used to submit this job instance.
20       *
21       * @return the job description
22       */
23      public JobDescription getJobDescriptionSync() throws NotImplementedException,
24              AuthenticationFailedException, AuthorizationFailedException,
25              PermissionDeniedException, DoesNotExistException, TimeoutException,
26              NoSuccessException;
27  
28      /**
29       * Returns the input stream of this job (to which can be written).
30       *
31       * @return the stream.
32       */
33      public OutputStream getStdinSync() throws NotImplementedException,
34              AuthenticationFailedException, AuthorizationFailedException,
35              PermissionDeniedException, BadParameterException,
36              DoesNotExistException, TimeoutException, IncorrectStateException,
37              NoSuccessException;
38  
39      /**
40       * Returns the output stream of this job (which can be read).
41       *
42       * @return the stream.
43       */
44      public InputStream getStdoutSync() throws NotImplementedException,
45              AuthenticationFailedException, AuthorizationFailedException,
46              PermissionDeniedException, BadParameterException,
47              DoesNotExistException, TimeoutException, IncorrectStateException,
48              NoSuccessException;
49  
50      /**
51       * Returns the error stream of this job (which can be read).
52       *
53       * @return the stream.
54       */
55      public InputStream getStderrSync() throws NotImplementedException,
56              AuthenticationFailedException, AuthorizationFailedException,
57              PermissionDeniedException, BadParameterException,
58              DoesNotExistException, TimeoutException, IncorrectStateException,
59              NoSuccessException;
60  
61      /**
62       * Asks the resource manager to perform a suspend operation on a running
63       * job.
64       */
65      public void suspendSync() throws NotImplementedException,
66              AuthenticationFailedException, AuthorizationFailedException,
67              PermissionDeniedException, IncorrectStateException,
68              TimeoutException, NoSuccessException;
69  
70      /**
71       * Asks the resource manager to perform a resume operation on a suspended
72       * job.
73       */
74      public void resumeSync() throws NotImplementedException,
75              AuthenticationFailedException, AuthorizationFailedException,
76              PermissionDeniedException, IncorrectStateException,
77              TimeoutException, NoSuccessException;
78  
79      /**
80       * Asks the resource manager to initiate a checkpoint operation on a running
81       * job.
82       */
83      public void checkpointSync() throws NotImplementedException,
84              AuthenticationFailedException, AuthorizationFailedException,
85              PermissionDeniedException, IncorrectStateException,
86              TimeoutException, NoSuccessException;
87  
88      /**
89       * Asks the resource manager to migrate a job.
90       *
91       * @param jd
92       *            new job parameters to apply when the job is migrated.
93       */
94      public void migrateSync(JobDescription jd) throws NotImplementedException,
95              AuthenticationFailedException, AuthorizationFailedException,
96              PermissionDeniedException, BadParameterException,
97              IncorrectStateException, TimeoutException, NoSuccessException;
98  
99      /**
100      * Asks the resource manager to deliver an arbitrary signal to a dispatched
101      * job.
102      */
103     public void signalSync(int signum) throws NotImplementedException,
104             AuthenticationFailedException, AuthorizationFailedException,
105             PermissionDeniedException, BadParameterException,
106             IncorrectStateException, TimeoutException, NoSuccessException;
107 }