001 /* This file is part of the project "Hilbert II" - http://www.qedeq.org
002 *
003 * Copyright 2000-2014, Michael Meyling <mime@qedeq.org>.
004 *
005 * "Hilbert II" is free software; you can redistribute
006 * it and/or modify it under the terms of the GNU General Public
007 * License as published by the Free Software Foundation; either
008 * version 2 of the License, or (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013 * GNU General Public License for more details.
014 */
015
016 package org.qedeq.kernel.bo.common;
017
018 import org.qedeq.kernel.se.common.Service;
019
020
021 /**
022 * Information for a service call. Occurs during execution of a {@link ServiceJob}.
023 *
024 * @author Michael Meyling
025 */
026 public interface ModuleServiceCall extends Comparable {
027
028 /**
029 * Get QEDEQ module we work on.
030 *
031 * @return QEDEQ module.
032 */
033 public QedeqBo getQedeq();
034
035 /**
036 * Get service we work for.
037 *
038 * @return service
039 */
040 public Service getService();
041
042 /**
043 * Get global config parameter for service call as string.
044 *
045 * @return Service parameter.
046 */
047 public String getConfigParametersString();
048
049 /**
050 * Get call specific parameters for service call as string.
051 *
052 * @return Service parameters.
053 */
054 public String getParametersString();
055
056 /**
057 * Get timestamp for service start.
058 *
059 * @return Service start timestamp.
060 */
061 public long getBeginTime();
062
063 /**
064 * Get timestamp for service stop.
065 *
066 * @return Service stop timestamp.
067 */
068 public long getEndTime();
069
070 /**
071 * Get milliseconds the call was working and not pausing.
072 *
073 * @return Work milliseconds.
074 */
075 public long getDuration();
076
077 /**
078 * Return parent service call if any.
079 *
080 * @return Parent service call. Might be <code>null</code>.
081 */
082 public ModuleServiceCall getParentServiceCall();
083
084 /**
085 * Return service process the call was initiated by.
086 *
087 * @return Service process for this call.
088 */
089 public ServiceJob getServiceProcess();
090
091 /**
092 * Is this service still running? This is also true if the process is paused.
093 *
094 * @return Still running?
095 */
096 public boolean isRunning();
097
098 /**
099 * 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 }
|