Class JobSearchResult
- java.lang.Object
-
- com.netflix.genie.common.dto.search.BaseSearchResult
-
- com.netflix.genie.common.dto.search.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 com.netflix.genie.common.dto.search.BaseSearchResult
toString
-
-
-
-
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 jobname
- The name of the jobuser
- The user of the jobstatus
- The current status of the jobstarted
- The start time of the jobfinished
- The finish time of the jobclusterName
- The name of the cluster this job is or was run oncommandName
- 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 jobname
- The name of the jobuser
- The user of the jobstatus
- The current status of the jobstarted
- The start time of the jobfinished
- The finish time of the jobclusterName
- The name of the cluster this job is or was run oncommandName
- 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 aJobStatus
-
-
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
-
-