Class BaseModelRunCommand

java.lang.Object
nz.org.riskscape.engine.cli.ApplicationCommand
nz.org.riskscape.engine.cli.model.BaseModelRunCommand
All Implemented Interfaces:
AutoCloseable, nz.org.riskscape.engine.cli.ChildCommand, nz.org.riskscape.engine.cli.EngineCommand, nz.org.riskscape.engine.cli.PipelineRenderer, nz.org.riskscape.engine.cli.TerminalCommand
Direct Known Subclasses:
BatchCommand, RunCommand

public abstract class BaseModelRunCommand extends nz.org.riskscape.engine.cli.ApplicationCommand implements nz.org.riskscape.engine.cli.PipelineRenderer
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
     
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Map<String,List<String>>
     
    protected LocalDateTime
     
    protected nz.org.riskscape.engine.pipeline.RealizedPipeline
    realize(nz.org.riskscape.engine.model.Model model, nz.org.riskscape.engine.pipeline.ExecutionContext executionContext)
     
    protected nz.org.riskscape.engine.pipeline.RealizedPipeline
    realize(nz.org.riskscape.engine.model.Model model, nz.org.riskscape.engine.pipeline.ExecutionContext executionContext, boolean allowFailures)
     
    protected nz.org.riskscape.engine.model.Model
    updateParameters(nz.org.riskscape.engine.model.Model model, Map<String,List<String>> cliParameters)
     
    protected void
    warnIfCannotOverrideFormat(nz.org.riskscape.engine.pipeline.RealizedPipeline pipeline, nz.org.riskscape.problem.ProblemSink problemSink)
    Prints a warning to the terminal if the given pipeline looks to have an explicit format set for various steps that disagree with the --format option the user has specified.

    Methods inherited from class nz.org.riskscape.engine.cli.ApplicationCommand

    asPropertyWithProblems, bindOutput, combineKeyValuesForDisplay, displayWithProblems, doCommand, formatFailedObjectErrorsForTable, formatProblemsForTableText, getDetailedHelp, getEngine, getMessages, getObject, getProject, getTerminal, paramString, parseJsonArguments, parseJsonArguments, resourceFrom, run, setEngine, setMessages, setProject, setTerminal

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface nz.org.riskscape.engine.cli.EngineCommand

    close

    Methods inherited from interface nz.org.riskscape.engine.cli.PipelineRenderer

    boundPipelineParameterToString, graph, printPipeline, printPipeline, printType

    Methods inherited from interface nz.org.riskscape.engine.cli.TerminalCommand

    print, printerr, stderr, stdin, stdout
  • Field Details

  • Constructor Details

    • BaseModelRunCommand

      public BaseModelRunCommand()
  • Method Details

    • warnIfCannotOverrideFormat

      protected void warnIfCannotOverrideFormat(nz.org.riskscape.engine.pipeline.RealizedPipeline pipeline, nz.org.riskscape.problem.ProblemSink problemSink)

      Prints a warning to the terminal if the given pipeline looks to have an explicit format set for various steps that disagree with the --format option the user has specified. The pipeline shouldn't have been 'capped' with default save sinks, otherwise it's going to cause spurious warning.

      NB I considered moving this logic in to the CliPipelineRunner, so that other model running commands can use this feature, but the batch command has specific logic in there to avoid spamming the user with warnings.

    • getCliParameterMap

      protected Map<String,List<String>> getCliParameterMap()
    • updateParameters

      protected nz.org.riskscape.engine.model.Model updateParameters(nz.org.riskscape.engine.model.Model model, Map<String,List<String>> cliParameters)
    • realize

      protected nz.org.riskscape.engine.pipeline.RealizedPipeline realize(nz.org.riskscape.engine.model.Model model, nz.org.riskscape.engine.pipeline.ExecutionContext executionContext)
    • realize

      protected nz.org.riskscape.engine.pipeline.RealizedPipeline realize(nz.org.riskscape.engine.model.Model model, nz.org.riskscape.engine.pipeline.ExecutionContext executionContext, boolean allowFailures)
    • getCurrentTime

      protected LocalDateTime getCurrentTime()