public class Scenario
extends Object
Required? | Name | Description | Quantity |
---|---|---|---|
yes | name | The name of the Scenario | 1 |
yes | task | A MINER Task | 1..N |
no | description | The description of the Scenario | 0..1 |
no | keyword | Multiple keywords can be assigned to a Scenario | 0..N |
Constructor and Description |
---|
Scenario(String scenarioName)
Creates a new scenario and sets the scenario name.
|
Modifier and Type | Method and Description |
---|---|
void |
addKeyword(String keyword)
Adds a
keyword to the scenario. |
Task |
addTask()
Creates a new MINER task and adds it to this scenario.
|
Task |
addTask(String name)
Creates a new MINER task with the given
name and adds it to
this scenario. |
Task |
addTask(Task task)
Adds a MINER task to this scenario.
|
void |
delete()
Deletes the scenario, its executions incl. their results at the MINER
Core.
|
Execution |
execute()
Executes the scenario immediately and without a defined stop time.
|
Execution |
execute(int duration)
Executes the scenario immediately for the given duration.
|
Execution |
execute(int duration,
String description)
Executes the scenario immediately for the given duration.
|
Execution |
execute(String description)
Executes the scenario immediately and without a defined stop time.
|
Collection<ResultHandle> |
getAllResultHandles()
Gets all ResultHandles that are defined in this scenario.
|
Date |
getCreated()
Gets the date when the scenario was created at the MINER core.
|
String |
getDescription()
Gets the description of the scenario.
|
int |
getID()
Gets the ID that identifies the Scenario at the MINER core.
|
List<String> |
getKeywords()
Gets the keywords associated with this scenario.
|
Date |
getModified()
Gets the date when the scenario was last modified at the MINER core.
|
String |
getName()
Gets the name of the scenario.
|
ResultHandle |
getResultHandleByName(String resultName)
Searches the scenario for a ResultHandle called
resultName . |
Task |
getTaskByName(String taskName)
Searches for a task called
taskName . |
Collection<Task> |
getTasks()
Gets all the tasks contained in this scenario.
|
boolean |
print()
Prints an XML representation of the scenario to System.out.
|
boolean |
print(java.io.OutputStream os)
Prints an XML representation of the scenario to the given Outputstream
os . |
void |
reuseAsNew()
Enables the reuse of the scenario object for the specification of another
scenario.
|
boolean |
save(java.io.File file)
Saves an XML representation of the scenario to
file . |
Execution |
schedule(Date start)
Schedules the scenario for execution.
|
Execution |
schedule(Date start,
Date stop)
Schedules the scenario for execution.
|
Execution |
schedule(Date start,
Date stop,
String description)
Schedules the scenario for execution.
|
Execution |
schedule(Date start,
String description)
Schedules the scenario for execution.
|
Execution |
schedule(int offset)
Executes the scenario offset [s] in the future and and without a defined
stop time.
|
Execution |
schedule(int offset,
int duration)
Executes the scenario offset [s] in the future and for the given
duration.
|
Execution |
schedule(int offset,
int duration,
String description)
Executes the scenario offset [s] in the future and for the given
duration.
|
Execution |
schedule(int offset,
String description)
Executes the scenario offset [s] in the future and and without a defined
stop time.
|
void |
setDescription(String description)
Sets a description for the scenario.
|
void |
setName(String name)
Sets the name of the scenario.
|
void |
submit()
Submits the scenario to the MINER core.
|
String |
toXMLString()
Converts the scenario to a String containing an XML representation of the
scenario.
|
public Scenario(String scenarioName)
scenarioName
- the scenario namepublic String getDescription()
public void setDescription(String description)
description
- the descriptionpublic String getName()
public void setName(String name)
name
- the namepublic List<String> getKeywords()
public void addKeyword(String keyword)
keyword
to the scenario.keyword
- the keywordpublic Date getCreated()
public Date getModified()
public Task addTask()
public Task addTask(String name)
name
and adds it to
this scenario.name
- the name of the taskpublic Task addTask(Task task)
task
- the MINER Tasktask
public Collection<Task> getTasks()
public int getID()
public void reuseAsNew()
public Collection<ResultHandle> getAllResultHandles()
public void submit() throws at.srfg.miner.exception.MinerException
at.srfg.miner.exception.MinerException
- If no connection to the webservice can be achieved or if the
submit implementation at the MINER Core throws an exception.public Execution schedule(Date start) throws at.srfg.miner.exception.MinerException
start
- The date when the execution should start. The start date must
not be null.at.srfg.miner.exception.MinerException
public Execution schedule(Date start, String description) throws at.srfg.miner.exception.MinerException
start
- The date when the execution should start. The start date must
not be null.description
- A description of the executionat.srfg.miner.exception.MinerException
public Execution schedule(Date start, Date stop) throws at.srfg.miner.exception.MinerException
start
- The date when the execution should start. The start date must
not be null.stop
- The date when the execution should stop. The stop date must be
after the start date and it must be before now.at.srfg.miner.exception.MinerException
public Execution schedule(Date start, Date stop, String description) throws at.srfg.miner.exception.MinerException
start
- The date when the execution should start. The start date must
not be null.stop
- The date when the execution should stop. The stop date must be
after the start date and it must be before now.description
- A description of the executionIllegalArgumentException
- if start/stop times don't make senseat.srfg.miner.exception.MinerException
- if the scenario wasn't successfully submitted in a prior steppublic Execution execute() throws at.srfg.miner.exception.MinerException
at.srfg.miner.exception.MinerException
- if the Scenario was not successfully submitted before.public Execution execute(String description) throws at.srfg.miner.exception.MinerException
description
- The description of the executionat.srfg.miner.exception.MinerException
- if the Scenario was not successfully submitted before.public Execution execute(int duration) throws at.srfg.miner.exception.MinerException
duration
- The duration of the execution in [s].at.srfg.miner.exception.MinerException
public Execution execute(int duration, String description) throws at.srfg.miner.exception.MinerException
duration
- The duration of the execution in [s].description
- The description of the executionat.srfg.miner.exception.MinerException
public Execution schedule(int offset) throws at.srfg.miner.exception.MinerException
offset
- The number of seconds that the execution is scheduled into the
future.at.srfg.miner.exception.MinerException
public Execution schedule(int offset, String description) throws at.srfg.miner.exception.MinerException
offset
- The number of seconds that the execution is scheduled into the
future.description
- The description of the executionat.srfg.miner.exception.MinerException
public Execution schedule(int offset, int duration) throws at.srfg.miner.exception.MinerException
offset
- The number of seconds that the execution is scheduled into the
future.duration
- The duration of the execution in [s].at.srfg.miner.exception.MinerException
public Execution schedule(int offset, int duration, String description) throws at.srfg.miner.exception.MinerException
offset
- The number of seconds that the execution is scheduled into the
future.duration
- The duration of the execution in [s].description
- The description of the executionat.srfg.miner.exception.MinerException
public void delete() throws at.srfg.miner.exception.MinerException
at.srfg.miner.exception.MinerException
public Task getTaskByName(String taskName)
taskName
. Note that the search is
done only over those tasks that are not included by reference!taskName
- the name of the taskpublic ResultHandle getResultHandleByName(String resultName)
resultName
.resultName
- the name of the ResultHandleresultName
exists or null
if no such
ResultHandle existsIllegalStateException
- if the scenario contains more than 1 ResultHandle called
resultName
.public boolean print()
public boolean print(java.io.OutputStream os)
os
. If an exception occurs (e.g. in the transformation
process from the scenario to a String), a logger warning is created and
the return value is false.os
- The destination output stream.public boolean save(java.io.File file)
file
. If an
exception occurs (e.g. in the transformation process from the scenario to
a String or when writing to the file), a logger warning and the return
value is false.file
- the destination filepublic String toXMLString()
Copyright (c) Salzburg Research Forschungsgesellschaft mbH. All rights reserved.