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.common;
17
18 import org.qedeq.kernel.se.common.Service;
19
20
21 /**
22 * Information for a service call. Occurs during execution of a {@link ServiceJob}.
23 *
24 * @author Michael Meyling
25 */
26 public interface ModuleServiceCall extends Comparable {
27
28 /**
29 * Get QEDEQ module we work on.
30 *
31 * @return QEDEQ module.
32 */
33 public QedeqBo getQedeq();
34
35 /**
36 * Get service we work for.
37 *
38 * @return service
39 */
40 public Service getService();
41
42 /**
43 * Get global config parameter for service call as string.
44 *
45 * @return Service parameter.
46 */
47 public String getConfigParametersString();
48
49 /**
50 * Get call specific parameters for service call as string.
51 *
52 * @return Service parameters.
53 */
54 public String getParametersString();
55
56 /**
57 * Get timestamp for service start.
58 *
59 * @return Service start timestamp.
60 */
61 public long getBeginTime();
62
63 /**
64 * Get timestamp for service stop.
65 *
66 * @return Service stop timestamp.
67 */
68 public long getEndTime();
69
70 /**
71 * Get milliseconds the call was working and not pausing.
72 *
73 * @return Work milliseconds.
74 */
75 public long getDuration();
76
77 /**
78 * Return parent service call if any.
79 *
80 * @return Parent service call. Might be <code>null</code>.
81 */
82 public ModuleServiceCall getParentServiceCall();
83
84 /**
85 * Return service process the call was initiated by.
86 *
87 * @return Service process for this call.
88 */
89 public ServiceJob getServiceProcess();
90
91 /**
92 * Is this service still running? This is also true if the process is paused.
93 *
94 * @return Still running?
95 */
96 public boolean isRunning();
97
98 /**
99 * Is the execution currently paused because we are waiting for another process.
100 *
101 * @return Are we waiting?
102 */
103 public boolean isPaused();
104
105 /**
106 * Get percentage of currently running plugin execution.
107 *
108 * @return Number between 0 and 100.
109 */
110 public double getExecutionPercentage();
111
112 /**
113 * Get description of currently taken action.
114 *
115 * @return We are doing this currently.
116 */
117 public String getAction();
118
119 /**
120 * Where are we now.
121 *
122 * @return Location description.
123 */
124 public String getLocation();
125
126 /**
127 * Result of service execution.
128 *
129 * @return Result. Might be <code>null</code>.
130 */
131 public ModuleServiceResult getServiceResult();
132
133 /**
134 * Get call id.
135 *
136 * @return Service call identifying number.
137 */
138 public long getId();
139
140 }