View Javadoc

1   /*
2    * $Id: CommonExecutionConnectorClient.java,v 1.2 2004/07/01 11:07:10 nw Exp $
3    * 
4    * Created on 11-Mar-2004 by Paul Harrison (pah@jb.man.ac.uk)
5    *
6    * Copyright 2004 AstroGrid. All rights reserved.
7    *
8    * This software is published under the terms of the AstroGrid 
9    * Software License version 1.2, a copy of which has been included 
10   * with this distribution in the LICENSE.txt file.  
11   *
12   */ 
13  
14  package org.astrogrid.applications.delegate;
15  
16  import org.astrogrid.applications.beans.v1.ApplicationList;
17  import org.astrogrid.applications.beans.v1.cea.castor.ExecutionSummaryType;
18  import org.astrogrid.applications.beans.v1.cea.castor.MessageType;
19  import org.astrogrid.applications.beans.v1.cea.castor.ResultListType;
20  import org.astrogrid.common.delegate.Delegate;
21  import org.astrogrid.jes.types.v1.cea.axis.JobIdentifierType;
22  import org.astrogrid.workflow.beans.v1.Tool;
23  
24  import java.net.URI;
25  
26  /***
27   * A client side interface for the {@link CommonExecutionConnector}. This interface uses castor objects derived from the schema instead of the axis ones.
28   * 
29   * @author Paul Harrison (pah@jb.man.ac.uk) 11-Mar-2004
30   * @version $Name:  $
31   * @since iteration5
32   */
33  public interface CommonExecutionConnectorClient extends Delegate {
34  /* execution lifecycle methods */
35  
36     /***
37      *Initialize an application asynchronously. The application may be a command line application, a data query or another web service depending on the type of Common Execution Controller that is being contacted.
38      * @param tool This is the specification of the application that will be run.
39      * @param jobstepID An identifier that the caller can use to keep track of this particular execution instance. 
40      * @param jobMonitorURL The endpoint of a JobMonitor service that should be called back when the execution has finished.
41      * @return An identifier that the CommonExecutionConnector service uses to track this instance of the application execution. This is used as an argument to some of the other methods in this interface.
42      *
43      * @throws RemoteException
44      * @throws CeaFault
45      */
46     public String init(Tool tool, JobIdentifierType jobstepID) throws CEADelegateException;
47     
48     /*** register a listener to the progress of an application. the web interface of the listener will be called to notify it of execution events of this application
49      * 
50      * @param executionId the id of the application to listen to
51      * @param listenerEndpoint endpoint of the web service (must implement the {@link org.astrogrid.jes.delegate.v1.JobMonitor} interface
52      * @throws CEADelegateException
53      */
54     public void registerProgressListener(String executionId,URI listenerEndpoint) throws CEADelegateException;
55     
56     /*** register a listener / consumer for the results of this application execution.
57      * 
58      * @param executionId the id of the application to consume results from.
59      * @param listenerEndpoint endpoint of the web service that will consume results (must implement the {@link org.astrogrid.jes.service.v1.cearesults.ResultsLIstener} interface)
60      * @throws CEADelegateException
61      */
62     public void registerResultsListener(String executionId,URI listenerEndpoint) throws CEADelegateException;
63     
64     /*** execute a previously-initialized application
65      * 
66      * @param executionId the id of the application to start
67      * @return true if execution was started successfully
68      * @throws CEADelegateException
69      */
70     public boolean execute(String executionId) throws CEADelegateException;
71     /***
72      * Abort an running application.
73      * @param executionId the identifier for the execution instance that is to be aborted.
74      * @return true if aborted successfully.
75      * @throws RemoteException
76      * @throws CeaFault
77      */
78     public boolean abort(String executionId) throws CEADelegateException;
79  
80     /*** access the results of an application execution
81      *  @param executionId the identifier for the execution instance to query
82      * @returns a list of result objects
83      */
84      public ResultListType getResults(String executionId) throws CEADelegateException;
85   
86   /*** query execution status of an application
87    * 
88    * @param executionId identifier of application to query
89    * @return message, containing various metadata, including status code.
90    * @throws CEADelegateException
91    */
92     public MessageType queryExecutionStatus(String executionId) throws CEADelegateException;
93     
94     /*** retrieve summary information for an applicatin execution
95      *  - this structure contains input parameters, results, plus execution status.
96      * @param executionId the identifier for the instance to query.
97      * @return
98      * @throws CEADelegateException
99      */
100    public ExecutionSummaryType getExecutionSumary(String executionId) throws CEADelegateException;
101    
102    /***
103     * return the registry entry for this common execution controller.
104     * @return
105     * @throws RemoteException
106     */
107    public String returnRegistryEntry() throws CEADelegateException;
108 
109 }