View Javadoc

1   /* This file is part of the project "Hilbert II" - http://www.qedeq.org" target="alexandria_uri">http://www.qedeq.org
2    *
3    * Copyright 2000-2014,  Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13   * GNU General Public License for more details.
14   */
15  
16  package org.qedeq.kernel.bo.module;
17  
18  import org.qedeq.base.io.Parameters;
19  import org.qedeq.kernel.bo.common.ModuleServiceCall;
20  import org.qedeq.kernel.bo.common.ModuleServiceResult;
21  import org.qedeq.kernel.se.common.ServiceCompleteness;
22  
23  
24  /**
25   * Information for a service call. Occurs during execution of a
26   * {@link org.qedeq.kernel.se.common.ServiceJob}.
27   *
28   * @author  Michael Meyling
29   */
30  public interface InternalModuleServiceCall extends ModuleServiceCall {
31  
32      /**
33       * Get global config parameters for service call.
34       *
35       * @return  Service parameter.
36       */
37      public Parameters getConfigParameters();
38  
39      /**
40       * Get call specific parameters for service call.
41       *
42       * @return  Service parameter.
43       */
44      public Parameters getParameters();
45  
46      /**
47       * Set percentage of currently running plugin execution.
48       *
49       * @param   percentage  Number between 0 and 100.
50       */
51      public void setExecutionPercentage(double percentage);
52  
53      /**
54       * Set someone who answers completeness questions.
55       *
56       * @param   completeness    An answer for completeness questions. Might be <code>null</code>.
57       */
58      public void setServiceCompleteness(ServiceCompleteness completeness);
59  
60      /**
61       * Set description of currently taken action.
62       *
63       * @param   action  We are doing this currently.
64       */
65      public void setAction(String action);
66  
67      /**
68       * Return service process the call was initiated.
69       *
70       * @return  Service process for this call.
71       */
72      public InternalServiceJob getInternalServiceProcess();
73  
74      /**
75       * Signal an execution pause.
76       */
77      public void pause();
78  
79      /**
80       * Signal execution resume.
81       */
82      public void resume();
83  
84      /**
85       * Set generic success result for call and stop.
86       * Can only be done if call is still running.
87       */
88      public void finishOk();
89  
90      /**
91       * Set generic failure result for call and stop.
92       * Can only be done if call is still running.
93       *
94       * @param   errorMessage    Reason for finishing with error.
95       */
96      public void finishError(final String errorMessage);
97  
98      /**
99       * Set result state for call and stop.
100      * Can only be done if call is still running.
101      *
102      * @param   result  Service result.
103      */
104     public void finish(ModuleServiceResult result);
105 
106     /**
107      * Set result state for call and stop.
108      * Can only be done if call is still running.
109      *
110      * @param   result  Must include reason for halting.
111      */
112     public void halt(ModuleServiceResult result);
113 
114     /**
115      * Set generic failure result for call and stop.
116      * Can only be done if call is still running.
117      *
118      * @param   errorMessage    Reason for halting.
119      */
120     public void halt(final String errorMessage);
121 
122     /**
123      * Set failure state for call and stop.
124      * Can only be done if call is still running.
125      */
126     public void interrupt();
127 
128 }