Class ExecutionModel

java.lang.Object
com.gentics.contentnode.rest.model.scheduler.ExecutionModel
All Implemented Interfaces:
Serializable

public class ExecutionModel extends Object implements Serializable
Model for a scheduler exection.
See Also:
  • Constructor Details

    • ExecutionModel

      public ExecutionModel()
  • Method Details

    • fromDbResult

      public static ExecutionModel fromDbResult(ResultSet rs) throws SQLException
      Create a model instance from a database result set.

      This method assumes that the cursor is correctly set at the element to convert.

      Parameters:
      rs - The database result
      Returns:
      An execution model created from the database result
      Throws:
      SQLException - When the result set can not be read
    • fromDbResult

      public static ExecutionModel fromDbResult(String idField, ResultSet rs) throws SQLException
      Create a model instance from a database result set.

      This method assumes that the cursor is correctly set at the element to convert.

      The name of the ID field can be specified if the result is from a JOIN statement where id alone is ambiguous.

      Parameters:
      idField - The name of the execution ID field.
      rs - The database result
      Returns:
      An execution model created from the database result
      Throws:
      SQLException - When the result set can not be read
    • fromDbResultWithSchedule

      public static ExecutionModel fromDbResultWithSchedule(ResultSet rs) throws SQLException
      Create a model instance from a database result set with the corresponding schedule.

      This method assumes that the cursor is correctly set at the element to convert.

      Parameters:
      rs - The database result
      Returns:
      An execution model created from the database result with the corresponding schedule.
      Throws:
      SQLException - When the result set can not be read
    • getId

      public Integer getId()
      Execution ID
      Returns:
      The execution ID
    • setId

      public ExecutionModel setId(Integer id)
      Set the execution ID
      Parameters:
      id - The execution ID
      Returns:
      fluent API
    • getScheduleId

      public Integer getScheduleId()
      Schedule ID
      Returns:
      The schedule ID
    • setScheduleId

      public ExecutionModel setScheduleId(Integer scheduleId)
      Set the schedule ID
      Parameters:
      scheduleId - The schedule ID
      Returns:
      fluent API
    • getSchedule

      public ScheduleModel getSchedule()
      The corresponding schedule
      Returns:
      schedule
    • setSchedule

      public ExecutionModel setSchedule(ScheduleModel schedule)
      Set the schedule
      Parameters:
      schedule - The schedule
      Returns:
      fluent API
    • getStartTime

      public Integer getStartTime()
      Start time
      Returns:
      The start time
    • setStartTime

      public ExecutionModel setStartTime(Integer startTime)
      Set the start time
      Parameters:
      startTime - The start time
      Returns:
      fluent API
    • getEndTime

      public Integer getEndTime()
      End time
      Returns:
      The end time
    • setEndTime

      public ExecutionModel setEndTime(Integer endTime)
      Set the end time
      Parameters:
      endTime - The end time
      Returns:
      fluent API
    • getDuration

      public Integer getDuration()
      Duration
      Returns:
      The duration
    • setDuration

      public ExecutionModel setDuration(Integer duration)
      Set the duration
      Parameters:
      duration - The duration
      Returns:
      fluent API
    • getResult

      public Boolean getResult()
      Result
      Returns:
      The result
    • setResult

      public ExecutionModel setResult(Boolean result)
      Set the result
      Parameters:
      result - The result
      Returns:
      fluent API
    • getLog

      public String getLog()
      Command output
      Returns:
      The command output
    • setLog

      public ExecutionModel setLog(String log)
      Set the command output
      Parameters:
      log - The command output
      Returns:
      fluent API
    • isRunning

      public boolean isRunning()
      Check whether the execution is still running
      Returns:
      true if the execution is running
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object