Class PipelineJobBatchValueObject

java.lang.Object
ubic.gemma.model.pipeline.PipelineJobBatchValueObject
All Implemented Interfaces:
Serializable

public class PipelineJobBatchValueObject extends Object implements Serializable
Value object projection of PipelineJobBatch for the REST surface.

Why this exists

The admin pipeline endpoints returned the entity. Two lazy associations made that a problem: PipelineJobBatch.getJobs(), and PipelineJob.getExperiment() beneath it. Nothing initialized either before the response left the resource method, and no @JsonIgnore stopped Jackson walking them.

In the published specification the second one was the expensive half. Following experiment pulled the ExpressionExperiment entity in, and from there BioAssay, BioMaterial, FactorValue, Statement, the expression vectors and the rest of the graph: 44 entity schemas and 466 properties that reached the document through this one field and nowhere else.

A batch carries its jobs because the endpoint that serves one is documented as returning the rolled-up state. Each job carries its experiment as an id; see PipelineJobValueObject.

Author:
phase3
See Also:
  • Constructor Details

    • PipelineJobBatchValueObject

      public PipelineJobBatchValueObject()
  • Method Details

    • from

      public static PipelineJobBatchValueObject from(PipelineJobBatch batch)
      Project a batch without its jobs.

      For a caller that only needs the batch's own fields. getJobs() is left empty rather than null, so a client does not have to distinguish "not fetched" from "no jobs" — a batch always has at least one.

    • withJobs

      public static PipelineJobBatchValueObject withJobs(PipelineJobBatch batch)
      Project a batch together with its jobs.

      🛑 Reads PipelineJobBatch.getJobs(), so it has to run inside the transaction that loaded the batch. Calling it from a resource method is the bug this class was written to fix.

    • getId

      public Long getId()
    • getName

      @Nullable public String getName()
    • getDescription

      @Nullable public String getDescription()
    • getPipeline

      public String getPipeline()
    • getSubmittedById

      @Nullable public Long getSubmittedById()
    • getSubmittedAt

      public Date getSubmittedAt()
    • getParamsJson

      @Nullable public String getParamsJson()
    • getState

      public PipelineJobBatch.BatchState getState()
    • getKillRequestedAt

      @Nullable public Date getKillRequestedAt()
    • getClosedAt

      @Nullable public Date getClosedAt()
    • getJobs

      public List<PipelineJobValueObject> getJobs()
    • setId

      public void setId(Long id)
    • setName

      public void setName(@Nullable String name)
    • setDescription

      public void setDescription(@Nullable String description)
    • setPipeline

      public void setPipeline(String pipeline)
    • setSubmittedById

      public void setSubmittedById(@Nullable Long submittedById)
    • setSubmittedAt

      public void setSubmittedAt(Date submittedAt)
    • setParamsJson

      public void setParamsJson(@Nullable String paramsJson)
    • setState

      public void setState(PipelineJobBatch.BatchState state)
    • setKillRequestedAt

      public void setKillRequestedAt(@Nullable Date killRequestedAt)
    • setClosedAt

      public void setClosedAt(@Nullable Date closedAt)
    • setJobs

      public void setJobs(List<PipelineJobValueObject> jobs)
    • equals

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

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object