Class ScriptMetadata

java.lang.Object
org.noise_planet.noisemodelling.webserver.script.ScriptMetadata

public class ScriptMetadata extends Object
Represents the description for a script, with expected inputs and outputs
  • Field Details

    • DEFAULT_JOB_EXECUTION_TIMEOUT_SECONDS

      public static final int DEFAULT_JOB_EXECUTION_TIMEOUT_SECONDS
      See Also:
    • id

      public final String id
    • group

      public final String group
    • title

      public final String title
    • description

      public final String description
    • path

      public final URI path
    • scriptDirectory

      public final URI scriptDirectory
    • executionTimeoutSeconds

      public final int executionTimeoutSeconds
    • inputs

      public final Map<String,ScriptInput> inputs
    • outputs

      public final Map<String,ScriptOutput> outputs
  • Constructor Details

    • ScriptMetadata

      public ScriptMetadata(String group, URI file, URI scriptDirectory) throws IOException
      Constructs a `ScriptMetadata` instance by parsing metadata from a specified Groovy script file. The constructor initializes the metadata fields such as `id`, `title`, `description`, `executionTimeoutSeconds`, and populates the `inputs` and `outputs` maps based on the content of the script. The `id` is generated using the provided group and the script file name, while the other fields are extracted from the script's metadata or assigned default values if not specified.
      Parameters:
      group - a string representing the group or category to which the script belongs, used in generating the script's unique identifier
      file - a URI pointing to the Groovy script file from which to extract metadata
      scriptDirectory - a URI representing the directory containing the script, used for mounting a special file system if the script is stored into a jar file
      Throws:
      IOException - if an error occurs while reading or parsing the script file for metadata extraction