View Javadoc

1   /*$Id: QueryService.java,v 1.5 2005/07/05 08:27:00 clq2 Exp $
2    * Created on 16-Jun-2004
3    *
4    * Copyright (C) AstroGrid. All rights reserved.
5    *
6    * This software is published under the terms of the AstroGrid 
7    * Software License version 1.2, a copy of which has been included 
8    * with this distribution in the LICENSE.txt file.  
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      // direct query methods
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  $Log: QueryService.java,v $
80  Revision 1.5  2005/07/05 08:27:00  clq2
81  paul's 559b and 559c for wo/apps and jes
82  
83  Revision 1.4.152.1  2005/06/09 08:47:32  pah
84  result of merging branch cea_pah_559b into HEAD
85  
86  Revision 1.4.138.1  2005/06/03 16:01:48  pah
87  first try at getting commandline execution log bz#1058
88  
89  Revision 1.4  2004/07/26 12:07:38  nw
90  renamed indirect package to protocol,
91  renamed classes and methods within protocol package
92  javadocs
93  
94  Revision 1.3  2004/07/09 14:48:24  nw
95  updated to match change in type of register*Listener methods in cec wsdl
96  
97  Revision 1.2  2004/07/01 11:16:22  nw
98  merged in branch
99  nww-itn06-componentization
100 
101 Revision 1.1.2.2  2004/07/01 01:42:46  nw
102 final version, before merge
103 
104 Revision 1.1.2.1  2004/06/17 09:21:23  nw
105 finished all major functionality additions to core
106  
107 */