Package org.kigalisim.cloud
Class InvocationParameters
java.lang.Object
org.kigalisim.cloud.InvocationParameters
Holds the parameters for a cloud simulation invocation.
Wraps the script, simulation, and replicates query parameters
extracted from an incoming HTTP request.
scriptusesOptionalto distinguish an absent script from a blank one.simulationsholds aListof comma-separated scenario names. An empty list indicates a validate-only request.replicatesholds the number of times each scenario should be run. It defaults to 1 and is validated by the handler, not the factory.
-
Constructor Summary
ConstructorsConstructorDescriptionInvocationParameters(Optional<String> script, List<String> simulations, int replicates) Constructs a new InvocationParameters. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of replicates to run per simulation.Returns the QubecTalk script parameter.Returns the list of simulation names to run.
-
Constructor Details
-
InvocationParameters
Constructs a new InvocationParameters.- Parameters:
script- AnOptionalcontaining the QubecTalk script, or empty if not provided.simulations- AListof simulation names parsed from thesimulationquery parameter. Empty if the parameter was absent or blank.replicates- The number of replicates to run per simulation. 1 when thereplicatesquery parameter was absent or blank. 0 when the value was present but not a valid positive integer.
-
-
Method Details
-
getScript
Returns the QubecTalk script parameter.- Returns:
- An
Optionalcontaining the script, or empty if not provided.
-
getSimulations
Returns the list of simulation names to run.Returns an empty list when no
simulationquery parameter was provided, indicating that the request is validate-only.- Returns:
- The list of simulation names.
-
getReplicates
public int getReplicates()Returns the number of replicates to run per simulation.Defaults to 1 when the
replicatesquery parameter was absent or blank. A value less than 1 indicates an invalid request; the caller is responsible for returning an appropriate error response.- Returns:
- The number of replicates, or 1 by default if not given.
-