Interface Session

All Known Implementing Classes:
LocalSession, RemoteSession

public interface Session
Author:
Nick Collier
  • Method Details

    • getHost

      String getHost()
      Gets the name or ip address of the remote host.
      Returns:
      the name or ip address of the remote host.
    • getUser

      String getUser()
      Gets the user account used to log into the remote host.
      Returns:
      the user account used to log into the remote host.
    • getId

      String getId()
      Gets the id (user@host) of this Remote.
      Returns:
      the id (user@host) of this Remote.
    • getInstances

      int getInstances()
      Gets the number of model instances to run on this Remote.
      Returns:
      the number of model instances to run on this Remote.
    • getInput

      String getInput()
      Gets the file that contains parameter input for this Session.
      Returns:
      the parameter input for this remote.
    • setInput

      void setInput(String input)
      Sets the file that contains the parameter input for this Session.
      Parameters:
      input -
    • setRunStatus

      void setRunStatus(int instance, RunningStatus status)
      Sets the run status for the specified instance on this Remote.
      Parameters:
      instance - the instance id
      status - the status
    • getStatus

      RunningStatus getStatus(int instance)
      Gets the status of the specified instance.
      Parameters:
      instance -
      Returns:
      the status of the specified instance.
    • createDonePoller

      Callable<Void> createDonePoller(long frequency)
      Create a callable that returns with the model run by this Session is finished.
      Returns:
      a callable that returns with the model run by this Session is finished.
    • copyCompletionStatus

      void copyCompletionStatus(String outDirectory) throws StatusException
      Copies the completion status from the host and directory where the model was run to the specified directory.
      Parameters:
      outDirectory -
      Throws:
      StatusException
    • findOutput

      List<MatchedFiles> findOutput(List<OutputPattern> patterns) throws StatusException
      Finds the model output of that is the result of running this Session and returns that those files. In the case of remote output the output may be copied to local temporary location. The patterns used to identify output are specified in the filePatterns parameters.
      Parameters:
      patterns - the patterns to look for
      Returns:
      the location of the output in a list of MatchedFiles. Each MatchedFiles object holds one or more files for a specific match.
      Throws:
      StatusException
    • retrieveRunCompletionStatus

      void retrieveRunCompletionStatus() throws StatusException
      Retrieves the run completion status (e.g. FAILURE) and sets it for this Session.
      Throws:
      StatusException
    • runModel

      void runModel() throws SessionException
      Runs the model for this Session.
      Throws:
      SessionException
    • initModelArchive

      void initModelArchive(Configuration config, String directory) throws ModelArchiveConfiguratorException, SessionException
      Initializes the model for running. This configures the model archive for this Session and peforms any other archive related work.
      Parameters:
      directory - the directory to copy the model archive into
      Throws:
      ModelArchiveConfiguratorException
      SessionException