Class InvocationParametersFactory

java.lang.Object
org.kigalisim.cloud.InvocationParametersFactory

public class InvocationParametersFactory extends Object
Builds InvocationParameters from a raw query string parameter map.

Centralises all raw-map access so that adding new invocation parameters in the future requires changes only to this class and InvocationParameters.

  • Constructor Details

    • InvocationParametersFactory

      public InvocationParametersFactory()
  • Method Details

    • build

      public static InvocationParameters build(com.amazonaws.services.lambda.runtime.events.APIGatewayV2HTTPEvent event)
      Builds an InvocationParameters from an incoming Lambda HTTP event.

      Parameters may be supplied either as GET query string parameters or as a application/x-www-form-urlencoded POST body, allowing callers with larger scripts to avoid URL length limits by sending the script as a POST parameter instead. When a parameter is present in both the query string and the body, the body value takes precedence.

      Parameters:
      event - The incoming API Gateway V2 HTTP event.
      Returns:
      A new InvocationParameters with the extracted values.
    • build

      public static InvocationParameters build(Map<String,String> params)
      Builds an InvocationParameters from the given query string parameter map.

      A script value that is present but blank is treated as absent. A simulation value is split on commas and trimmed to produce a list of scenario names; an absent or blank value produces an empty list. A replicates value is parsed as a positive integer; if absent or blank it defaults to 1, and if non-integer it is stored as 0 (the handler treats any value less than 1 as invalid and returns 400).

      Parameters:
      params - The query string parameter map, or null if none were provided.
      Returns:
      A new InvocationParameters with the extracted values.