1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.applications.manager;
12
13 import org.astrogrid.applications.CeaException;
14 import org.astrogrid.applications.beans.v1.cea.castor.ExecutionSummaryType;
15 import org.astrogrid.applications.beans.v1.cea.castor.MessageType;
16 import org.astrogrid.applications.beans.v1.cea.castor.ResultListType;
17
18 import java.io.File;
19 import java.io.FileNotFoundException;
20 import java.net.URI;
21
22 /*** Defines a component used to query status of applications, access results, etc.
23 * @author Noel Winstanley nw@jb.man.ac.uk 16-Jun-2004
24 *
25 */
26 public interface QueryService {
27
28 /*** register a remote progress listener with an application
29 *
30 * @param executionId the server-assigned id of a current application (which may either be running, or waiting to run)
31 * @param endpoint endpoint of a webservice implementing the {@link org.astrogrid.jes.delegate.v1.jobmonitor.JobMonitor} interface. This webservice will be
32 * notified whenever the application changes state.
33 * @throws CeaException
34 * @return true if registered successfully.
35 */
36 public boolean registerProgressListener(String executionId,URI endpoint) throws CeaException;
37 /*** register a remote result listener with an application
38 *
39 * @param executionId the server-assigned id of a current application (which may either be running, or waiting to run)
40 * @param endpoint endpoint of a webservice implementing the {@link CeaResultListener} interface. This webservice will be
41 * notified when the exection results for the application become available.
42 * @return true if registered successfully
43 * @throws CeaException
44 */
45 public boolean registerResultsListener(String executionId,URI endpoint) throws CeaException;
46
47
48 /*** query the status of a running application
49 * @param executionId the (cea-assigned) id of the application to query.
50 * @return a message containing information about the status of the application.
51 * @throws CeaException if owt goes wrong.*/
52 public MessageType queryExecutionStatus(String executionId) throws CeaException;
53
54 /*** get results from an application - list will be empty / semi-blank if the application hasn't finished producing results yet
55 * @param executionId the (cea-assigned) id of the application to query.
56 * @return a list of resuls.
57 * @throws CeaException*/
58 public ResultListType getResults(String executionId) throws CeaException;
59
60 /*** get summary of an application execution
61 * @param executionId the (cea-assigned) id of the application to query.
62 * @return an executioin summary for this application.
63 * @throws CeaException*/
64
65 public ExecutionSummaryType getSummary(String executionId) throws CeaException;
66 /***
67 * Return a log file. This really only applies to the commandline case.
68 * @TODO think of more general way of expressing this - or refactor into sub interface.
69 * @param execututionId
70 * @param type
71 * @return
72 * @throws FileNotFoundException
73 */
74 public File getLogFile(String executionId, ApplicationEnvironmentRetriver.StdIOType type) throws CeaException, FileNotFoundException;
75 }
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107