public class Execution
extends Object
Scenario.schedule(java.util.Date)
or Scenario.execute()
.
Example:
Scenario scenario = new Scenario(); // define all Scenario parameters // ... scenario.submit(); Execution exec = scenario.run();
Modifier and Type | Method and Description |
---|---|
List<Result> |
allResults(ResultHandle handle)
Retrieves all result instances that are currently available for the given
handle . |
Query |
createQuery(ResultHandle handle)
Creates a new Query object.
|
void |
delete()
Deletes the execution and all its results at the MINER Core.
|
String |
getDescription()
Gets the description.
|
int |
getID()
Gets the ID that identifies the Execution at the MINER core.
|
Executionlog |
getLog()
Gets the execution log.
|
int |
getQueryLimit(ResultHandle handle)
Gets the query limit for a query of
handle . |
Scenario |
getScenario()
Gets the scenario of this execution.
|
int |
getScenarioId()
Gets the ID of the associated Scenario.
|
Date |
getStart()
Gets the start time.
|
Date |
getStop()
Gets the stop time.
|
boolean |
hasNextResults(ResultHandle handle)
Checks if there are results for
handle that have not yet
been retrieved. |
boolean |
isFinished()
Checks if the execution has completely finished, i.e. at the MINER Core
and all the involved ToolProxies.
|
static Execution |
load(int execId)
Loads an existing execution from the MINER core.
|
List<Result> |
nextResultBlock(ResultHandle handle)
Incrementally retrieves the next chunk of results for
handle
. |
List<Result> |
nextResults(ResultHandle handle)
This is a convenience method that repeatedly invokes
nextResultBlock as long as hasNext returns
true. |
void |
resetQuery(ResultHandle handle)
Resets the query for
handle such that the internal
result-pointer offset is set to 0. |
void |
sendEvent(Event event)
Sends an event to the execution.
|
void |
setQueryLimit(ResultHandle handle,
int limit)
Sets a limit for the maximum number of result instances that are
retrieved per invocation of
nextResults with this query. |
void |
stop()
Stops the execution immediately.
|
void |
stop(int timeout)
Stops the execution immediately.
|
public static Execution load(int execId) throws at.srfg.miner.exception.MinerException
execId
- the execution identifierat.srfg.miner.exception.MinerException
public Scenario getScenario()
public int getID()
public int getScenarioId()
public String getDescription()
public Date getStart()
public Date getStop()
public void stop() throws at.srfg.miner.exception.MinerException
isFinished
returns true.at.srfg.miner.exception.MinerException
- If no connection to the webservice can be achieved or if the
stop implementation at the MINER Core throws an exception.public void stop(int timeout) throws at.srfg.miner.exception.MinerException
isFinished
returns true or the timeout is reached.timeout
- the maximum number of seconds to wait for
isFinished
to become true. A value of 0 means
that no wait is performed.at.srfg.miner.exception.MinerException
- If no connection to the webservice can be achieved or if the
stop implementation at the MINER Core throws an exception.public Executionlog getLog() throws at.srfg.miner.exception.MinerException
at.srfg.miner.exception.MinerException
public boolean isFinished() throws at.srfg.miner.exception.MinerException
at.srfg.miner.exception.MinerException
public void delete() throws at.srfg.miner.exception.MinerException
at.srfg.miner.exception.MinerException
public Query createQuery(ResultHandle handle)
handle
- the result handlepublic void resetQuery(ResultHandle handle)
handle
such that the internal
result-pointer offset is set to 0. Thus, the next invocation of
hasNextResults
and nextResults
will look at the
very first result, not the next result since the last invocation of
nextResults. The limit
parameter of query is not affected.handle
- the result handlepublic void setQueryLimit(ResultHandle handle, int limit)
nextResults
with this query.handle
- the result handlelimit
- the query limitpublic int getQueryLimit(ResultHandle handle)
handle
. Note that this
does not get the limit which my be imposed by the server (and which
overrides any query limit by a client).handle
- the result handlepublic boolean hasNextResults(ResultHandle handle) throws at.srfg.miner.exception.MinerException
handle
that have not yet
been retrieved.at.srfg.miner.exception.MinerException
public List<Result> nextResultBlock(ResultHandle handle) throws at.srfg.miner.exception.MinerException
handle
. Note that there are possibly more results available than returned by
the method. This can happen if the server imposed limit or the limit set
by the user (see setLimit
) is smaller than the number of
results that became available since the last invocation of
nextResults
.limit
. If there aren't any, an empty
list is returned (but never null).at.srfg.miner.exception.MinerException
public List<Result> nextResults(ResultHandle handle) throws at.srfg.miner.exception.MinerException
nextResultBlock
as long as hasNext
returns
true. It thus retrieves all results that became available since the last
result query, even if the number is higher than a local or server imposed
limit
.
WARNING: if there are many new results at the server, this call may lead to a heap space problem!
at.srfg.miner.exception.MinerException
public List<Result> allResults(ResultHandle handle) throws at.srfg.miner.exception.MinerException
handle
. This query has no side-effect (in neither direction)
on any (previous/parallel/subsequent) incremental result retrievals on
handle
(e.g. via nextResultBlock, nextResults, etc.).handle
- the result handleat.srfg.miner.exception.MinerException
public void sendEvent(Event event) throws at.srfg.miner.exception.MinerException
event
- the eventat.srfg.miner.exception.MinerException
Copyright (c) Salzburg Research Forschungsgesellschaft mbH. All rights reserved.