View Javadoc

1   /*
2    * Copyright (c) 2005 The University of Reading
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    * 1. Redistributions of source code must retain the above copyright
9    *    notice, this list of conditions and the following disclaimer.
10   * 2. Redistributions in binary form must reproduce the above copyright
11   *    notice, this list of conditions and the following disclaimer in the
12   *    documentation and/or other materials provided with the distribution.
13   * 3. Neither the name of the University of Reading, nor the names of the
14   *    authors or contributors may be used to endorse or promote products
15   *    derived from this software without specific prior written permission.
16   * 
17   * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18   * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20   * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22   * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27   */
28  
29  package uk.ac.rdg.resc.jstyx.gridservice.client;
30  
31  import org.apache.mina.common.ByteBuffer;
32  
33  import uk.ac.rdg.resc.jstyx.client.CStyxFile;
34  
35  /***
36   * Interface defining methods that will be fired when an SGSClient receives
37   * notification of a change in state of an SGS instance or when new data arrive.
38   *
39   * @author Jon Blower
40   * $Revision: 587 $
41   * $Date: 2006-02-20 08:37:32 +0000 (Mon, 20 Feb 2006) $
42   * $Log$
43   * Revision 1.5  2006/02/20 08:37:32  jonblower
44   * Still working towards handling output data properly in SGSInstanceClient
45   *
46   * Revision 1.4  2005/12/07 17:50:01  jonblower
47   * Changed gotCommandLine() to gotArguments()
48   *
49   * Revision 1.3  2005/12/01 17:17:07  jonblower
50   * Simplifying client interface to SGS instances
51   *
52   * Revision 1.2  2005/12/01 08:21:56  jonblower
53   * Fixed javadoc comments
54   *
55   * Revision 1.1  2005/11/10 19:47:10  jonblower
56   * Renamed SGSInstanceChange* to SGSInstanceClientChange*
57   *
58   * Revision 1.16  2005/10/18 14:08:14  jonblower
59   * Removed inputfiles from namespace
60   *
61   * Revision 1.15  2005/10/14 18:00:42  jonblower
62   * Renamed getInputMethods() to getInputStreams()
63   *
64   * Revision 1.14  2005/08/12 08:08:39  jonblower
65   * Developments to support web interface
66   *
67   * Revision 1.13  2005/08/02 08:04:52  jonblower
68   * Continuing to implement steering
69   *
70   * Revision 1.12  2005/08/01 16:38:05  jonblower
71   * Implemented simple parameter handling
72   *
73   * Revision 1.11  2005/06/14 07:45:16  jonblower
74   * Implemented setting of params and async notification of parameter changes
75   *
76   * Revision 1.10  2005/06/13 16:46:35  jonblower
77   * Implemented setting of parameter values via the GUI
78   *
79   * Revision 1.9  2005/06/10 07:53:12  jonblower
80   * Changed SGS namespace: removed "inurl" and subsumed functionality into "stdin"
81   *
82   * Revision 1.8  2005/05/26 16:52:06  jonblower
83   * Implemented detection and viewing of output streams
84   *
85   * Revision 1.7  2005/05/20 07:45:27  jonblower
86   * Implemented getInputFiles() to find the input files required by the service
87   *
88   * Revision 1.6  2005/05/18 17:13:51  jonblower
89   * Created SGSInstanceGUI
90   *
91   * Revision 1.5  2005/05/13 16:49:34  jonblower
92   * Coded dynamic detection and display of service data, also included streams in config file
93   *
94   * Revision 1.4  2005/05/11 18:25:00  jonblower
95   * Implementing automatic detection of service data elements
96   *
97   * Revision 1.3  2005/03/19 21:47:02  jonblower
98   * Further fixes relating to releasing ByteBuffers
99   *
100  * Revision 1.2  2005/03/18 13:55:59  jonblower
101  * Improved freeing of ByteBuffers, and bug fixes
102  *
103  * Revision 1.1  2005/03/16 22:16:44  jonblower
104  * Added Styx Grid Service classes to core module
105  *
106  * Revision 1.3  2005/03/16 17:59:35  jonblower
107  * Changed following changes to core JStyx library (replacement of java.nio.ByteBuffers with MINA's ByteBuffers)
108  *
109  * Revision 1.2  2005/02/21 18:12:17  jonblower
110  * Following changes to core JStyx library
111  *
112  * Revision 1.1  2005/02/16 19:22:29  jonblower
113  * Commit adding of SGS files to CVS
114  *
115  */
116 public interface SGSInstanceClientChangeListener
117 {
118     
119     /***
120      * Called when the given service data element changes
121      */
122     public void gotServiceDataValue(String sdName, String newData);
123     
124     /***
125      * Called when we have a new value for a parameter
126      * @param name Name of the parameter
127      * @param value The new value of the parameter
128      */
129     public void gotParameterValue(String name, String value);
130     
131     /***
132      * Called when we have a new value for a steerable parameter
133      * @param name Name of the parameter
134      * @param value The new value of the parameter
135      */
136     public void gotSteerableParameterValue(String name, String value);
137     
138     /***
139      * Called when we have a new string of command line arguments (for debug purposes)
140      * @param newArgs The new arguments
141      */
142     public void gotArguments(String newArgs);
143     
144     /***
145      * Called when the input files have been successfully uploaded
146      * @todo add arguments to this
147      */
148     public void inputFilesUploaded();
149     
150     /***
151      * Called when the service is started
152      */
153     public void serviceStarted();
154     
155     /***
156      * Called when the service is stopped before it has finished
157      */
158     public void serviceAborted();
159     
160     /***
161      * Called when all the output data have been downloaded
162      */
163     public void allOutputDataDownloaded();
164     
165     /***
166      * Called when the exit code from the service is received: this signals that
167      * the remote executable has completed.
168      */
169     public void gotExitCode(int exitCode);
170     
171     /***
172      * Called when an error occurs
173      */
174     public void error(String message);
175 }