Class CmsPublishJobInfoBean

java.lang.Object
org.opencms.publish.CmsPublishJobInfoBean

public final class CmsPublishJobInfoBean extends Object
Publish job information bean.

Since:
6.5.5
  • Field Details

  • Constructor Details

    • CmsPublishJobInfoBean

      public CmsPublishJobInfoBean(CmsUUID historyId, CmsUUID projectId, String projectName, CmsUUID userId, String localeName, int flags, int resourceCount, long enqueueTime, long startTime, long finishTime)
      Constructor used to initialize a job info bean from the database.

      Parameters:
      historyId - publish history id
      projectId - the id of the project
      projectName - the name of the project
      userId - the id of the user
      localeName - the string representation of a locale
      flags - flags of the publish job
      resourceCount - number of published resources
      enqueueTime - time when the job was enqueued
      startTime - time when the job was started
      finishTime - time when the job was finished
    • CmsPublishJobInfoBean

      protected CmsPublishJobInfoBean(CmsObject cms, CmsPublishList publishList, I_CmsReport report) throws CmsException
      The Default constructor.

      Parameters:
      cms - the cms context to use for publishing
      publishList - the list of resources to publish
      report - the report to write to
      Throws:
      CmsException - if something goes wrong
  • Method Details

    • getEnqueueTime

      public long getEnqueueTime()
      Returns the time this object has been created.

      Returns:
      the time this object has been created
    • getFinishTime

      public long getFinishTime()
      Returns the time the publish job ends.

      Returns:
      the time the publish job ends
    • getFlags

      public int getFlags()
      Returns the flags of this publish job.

      Returns:
      the flags of this publish job
    • getLocale

      public Locale getLocale()
      Returns the locale for this publish job.

      Returns:
      the locale for this publish job
    • getOriginalPublishList

      Gets the original publish list (not nulled after publish job is executed).
      Returns:
      the original publish list
    • getProjectId

      Returns the project id for this publish job.

      Returns:
      the project id for this publish job
    • getProjectName

      Returns the originally stored project name.

      Returns:
      the originally stored project name
    • getPublishHistoryId

      Returns the publish history id.

      Returns:
      the publish history id
    • getPublishList

      Returns the list of resources to publish.

      Returns:
      the list of resources to publish
    • getPublishReport

      Returns the report for this publish job.

      This is not the original report, it is wrapper that also writes to a temporary file.

      It will be null before starting and after finishing.

      Returns:
      the report for this publish job
      See Also:
    • getReport

      Returns the report for this publish job.

      Returns:
      the report for this publish job
    • getSize

      public int getSize()
      Returns the number of resources in the publish list.

      Returns:
      the number of resources in the publish list
    • getStartTime

      public long getStartTime()
      Returns the time the publish job did actually start.

      Returns:
      the time the publish job did actually start
    • getThreadUUID

      Returns the UUID of the running publish thread.

      Returns:
      the UUID of the running publish thread
    • getUserId

      public CmsUUID getUserId()
      Returns the user for this publish job.

      Returns:
      the user for this publish job
    • removePublishReport

      Removes the assigned publish report.

      Returns:
      the removed report
    • revive

      public void revive(CmsObject adminCms, CmsPublishList publishList) throws CmsException
      Revives this publish job.

      Parameters:
      adminCms - an admin cms object
      publishList - a publish list
      Throws:
      CmsException - if something goes wrong
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • enqueue

      protected void enqueue()
      Signalizes that the publish job has been enqueued.

      Actually sets the enqueue time only if it is not set already (re-enqueue during startup).

    • finish

      protected void finish()
      Signalizes the end of the publish job.

      Actually only sets the finish time and closes the publish report stream.

    • getCmsObject

      protected CmsObject getCmsObject()
      Returns the cms object, will be set to null after publishing.

      Returns:
      the cms object
    • isDirectPublish

      protected boolean isDirectPublish()
      Returns true if this is a "direct publish" operation.

      Returns:
      true if this is a "direct publish" operation
    • isFinished

      protected boolean isFinished()
      Returns if the publish job is already finished.

      Returns:
      true if the publish job is already finished
    • isStarted

      protected boolean isStarted()
      Returns if the publish job is already started.

      Returns:
      true if the publish job is already started
    • start

      protected void start(CmsUUID threadUUID)
      Signalizes the start of the publish job.

      Actually sets the starting time, writes the report header and sets the running thread uuid.

      Parameters:
      threadUUID - the running thread uuid