001 /* This file is part of the project "Hilbert II" - http://www.qedeq.org
002 *
003 * Copyright 2000-2013, 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.base.io.Parameters;
019 import org.qedeq.kernel.se.common.Plugin;
020
021
022 /**
023 * Information for a service call. Occurs during execution of a {@link ServiceProcess}.
024 *
025 * @author Michael Meyling
026 */
027 public interface PluginCall extends Comparable {
028
029 /**
030 * Get QEDEQ module we work on.
031 *
032 * @return QEDEQ module.
033 */
034 public QedeqBo getQedeq();
035
036 /**
037 * Get plugin we work for.
038 *
039 * @return service
040 */
041 public Plugin getPlugin();
042
043 /**
044 * Get service parameter for plugin.
045 *
046 * @return Service parameter.
047 */
048 public Parameters getParameters();
049
050 /**
051 * Get service parameter. Filters only for parameters that are explicitly for this plugin.
052 *
053 * @return Service parameter.
054 */
055 public String getParameterString();
056
057 /**
058 * Get timestamp for service start.
059 *
060 * @return Service start timestamp.
061 */
062 public long getStart();
063
064 /**
065 * Get timestamp for service stop.
066 *
067 * @return Service stop timestamp.
068 */
069 public long getStop();
070
071 /**
072 * Return parent service call if any.
073 *
074 * @return Parent service call. Might be <code>null</code>.
075 */
076 public PluginCall getParentPluginCall();
077
078 /**
079 * Return service process the call was initiated.
080 *
081 * @return Service process for this call.
082 */
083 public ServiceProcess getServiceProcess();
084
085 /**
086 * Is this plugin still working?
087 *
088 * @return Still running?
089 */
090 public boolean isRunning();
091
092 /**
093 * Is the call finished?
094 *
095 * @return Call finished?
096 */
097 public boolean isFinished();
098
099 /**
100 * Was the call normally finished?
101 *
102 * @return Was the call normally finished?
103 */
104 public boolean hasNormallyFinished();
105
106 /**
107 * Was the call interrupted?
108 *
109 * @return Call finished?
110 */
111 public boolean wasInterrupted();
112
113 /**
114 * Get percentage of currently running plugin execution.
115 *
116 * @return Number between 0 and 100.
117 */
118 public double getExecutionPercentage();
119
120 /**
121 * Get description of currently taken action.
122 *
123 * @return We are doing this currently.
124 */
125 public String getExecutionActionDescription();
126
127 /**
128 * Return code of plugin execution.
129 *
130 * @return Return code.
131 */
132 public int getReturnCode();
133
134 /**
135 * Result of plugin execution.
136 *
137 * @return Result. Might be <code>null</code>.
138 */
139 public Object getExecutionResult();
140
141 /**
142 * Get call id.
143 *
144 * @return Service call identifying number.
145 */
146 public long getId();
147
148 }
|