Class ResultContainer

java.lang.Object
com.inet.taskplanner.server.api.job.JobResultContainer
com.inet.taskplanner.server.api.job.ResultContainer

public class ResultContainer extends JobResultContainer
Class representing the results of a job.

Contains the list of results from the execution and a flag whether the condition for the job was fulfilled or not.

Since:
taskplanner 3.0
  • Constructor Details

    • ResultContainer

      public ResultContainer(@Nonnull List<Result> results)
      Creates a new ResultContainer instance.
      Parameters:
      results - the results from the job execution, can be empty
      Since:
      taskplanner 3.0
    • ResultContainer

      public ResultContainer(@Nonnull List<Result> results, @Nonnull Map<String,String> metaProperties)
      Creates a new ResultContainer instance.
      Parameters:
      results - the results from the job execution, can be empty
      metaProperties - additional meta properties to be used for placeholder replacement
      Since:
      taskplanner 3.0
  • Method Details

    • getFlavors

      public List<ResultFlavor> getFlavors()
      Returns the flavors supported by this container
      Specified by:
      getFlavors in class JobResultContainer
      Returns:
      the flavors supported by this container
    • getResults

      public List<Result> getResults(ResultFlavor flavor)
      Returns all results for a certain flavor
      Specified by:
      getResults in class JobResultContainer
      Parameters:
      flavor - the flavor for which to get results; should be one of the flavors returned by JobResultContainer.getFlavors()
      Returns:
      a list of all results that support the requested flavor; can be empty but is never null
    • getMetaProperties

      public Map<String,String> getMetaProperties()
      Returns the additional metadata properties for the job execution. These properties can be used to replace placeholders in textual output formats such as email or messengers.
      Specified by:
      getMetaProperties in class JobResultContainer
      Returns:
      the meta properties map, not null
    • cleanup

      public void cleanup()
      When result handling is finished, this method is called to release resources held by the results, such as closing streams or deleting temporary files as appropriate.

      This is also called if no appropriate ResultAction handled this result.

      Specified by:
      cleanup in class JobResultContainer