Class InvocationParameters

java.lang.Object
org.kigalisim.cloud.InvocationParameters

public class InvocationParameters extends Object
Holds the parameters for a cloud simulation invocation.

Wraps the script, simulation, and replicates query parameters extracted from an incoming HTTP request.

  • script uses Optional to distinguish an absent script from a blank one.
  • simulations holds a List of comma-separated scenario names. An empty list indicates a validate-only request.
  • replicates holds the number of times each scenario should be run. It defaults to 1 and is validated by the handler, not the factory.
  • Constructor Details

    • InvocationParameters

      public InvocationParameters(Optional<String> script, List<String> simulations, int replicates)
      Constructs a new InvocationParameters.
      Parameters:
      script - An Optional containing the QubecTalk script, or empty if not provided.
      simulations - A List of simulation names parsed from the simulation query parameter. Empty if the parameter was absent or blank.
      replicates - The number of replicates to run per simulation. 1 when the replicates query parameter was absent or blank. 0 when the value was present but not a valid positive integer.
  • Method Details

    • getScript

      public Optional<String> getScript()
      Returns the QubecTalk script parameter.
      Returns:
      An Optional containing the script, or empty if not provided.
    • getSimulations

      public List<String> getSimulations()
      Returns the list of simulation names to run.

      Returns an empty list when no simulation query 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 replicates query 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.