Class JobSearchResult

  • All Implemented Interfaces:
    java.io.Serializable

    public class JobSearchResult
    extends BaseSearchResult
    This class represents the subset of data returned from a Job when a search for Jobs is conducted.
    Since:
    3.0.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      JobSearchResult​(@NotBlank java.lang.String id, @NotBlank java.lang.String name, @NotBlank java.lang.String user, @NotBlank java.lang.String status, java.time.Instant started, java.time.Instant finished, java.lang.String clusterName, java.lang.String commandName)
      Constructor.
      JobSearchResult​(@NotBlank java.lang.String id, @NotBlank java.lang.String name, @NotBlank java.lang.String user, @NotNull JobStatus status, java.time.Instant started, java.time.Instant finished, java.lang.String clusterName, java.lang.String commandName)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.lang.String> getClusterName()
      Get the name of the cluster running the job if there currently is one.
      java.util.Optional<java.lang.String> getCommandName()
      Get the name of the command running this job if there currently is one.
      java.util.Optional<java.time.Instant> getFinished()
      Get the time the job finished.
      java.util.Optional<java.time.Instant> getStarted()
      Get the time the job started.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • JobSearchResult

        public JobSearchResult​(@NotBlank
                               @NotBlank java.lang.String id,
                               @NotBlank
                               @NotBlank java.lang.String name,
                               @NotBlank
                               @NotBlank java.lang.String user,
                               @NotNull
                               @NotNull JobStatus status,
                               @Nullable
                               java.time.Instant started,
                               @Nullable
                               java.time.Instant finished,
                               @Nullable
                               java.lang.String clusterName,
                               @Nullable
                               java.lang.String commandName)
        Constructor.
        Parameters:
        id - The id of the job
        name - The name of the job
        user - The user of the job
        status - The current status of the job
        started - The start time of the job
        finished - The finish time of the job
        clusterName - The name of the cluster this job is or was run on
        commandName - The name fo the command this job is or was run with
      • JobSearchResult

        public JobSearchResult​(@NotBlank
                               @NotBlank java.lang.String id,
                               @NotBlank
                               @NotBlank java.lang.String name,
                               @NotBlank
                               @NotBlank java.lang.String user,
                               @NotBlank
                               @NotBlank java.lang.String status,
                               @Nullable
                               java.time.Instant started,
                               @Nullable
                               java.time.Instant finished,
                               @Nullable
                               java.lang.String clusterName,
                               @Nullable
                               java.lang.String commandName)
                        throws java.lang.IllegalArgumentException
        Constructor.
        Parameters:
        id - The id of the job
        name - The name of the job
        user - The user of the job
        status - The current status of the job
        started - The start time of the job
        finished - The finish time of the job
        clusterName - The name of the cluster this job is or was run on
        commandName - The name fo the command this job is or was run with
        Throws:
        java.lang.IllegalArgumentException - If the status string can't be parsed into a JobStatus
    • Method Detail

      • getStarted

        public java.util.Optional<java.time.Instant> getStarted()
        Get the time the job started.
        Returns:
        The started time or null if not set
      • getFinished

        public java.util.Optional<java.time.Instant> getFinished()
        Get the time the job finished.
        Returns:
        The finished time or null if not set
      • getClusterName

        public java.util.Optional<java.lang.String> getClusterName()
        Get the name of the cluster running the job if there currently is one.
        Returns:
        The name of the cluster where the job is running
      • getCommandName

        public java.util.Optional<java.lang.String> getCommandName()
        Get the name of the command running this job if there currently is one.
        Returns:
        The name of the command