org.opencms.publish
Class CmsPublishJobInfoBean

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

public final class CmsPublishJobInfoBean
extends java.lang.Object

Publish job information bean.

Since:
6.5.5
Version:
$Revision: 1.10 $
Author:
Michael Moossen

Field Summary
static int C_PUBLISH_FLAG
          The flag used to indicate a direct publish job.
 
Constructor Summary
protected CmsPublishJobInfoBean(CmsObject cms, CmsPublishList publishList, I_CmsReport report)
          The Default constructor.
  CmsPublishJobInfoBean(CmsUUID historyId, CmsUUID projectId, java.lang.String projectName, CmsUUID userId, java.lang.String localeName, int flags, int resourceCount, long enqueueTime, long startTime, long finishTime)
          Constructor used to initialize a job info bean from the database.
 
Method Summary
protected  void enqueue()
          Signalizes that the publish job has been enqueued.
protected  void finish()
          Signalizes the end of the publish job.
protected  CmsObject getCmsObject()
          Returns the cms object, will be set to null after publishing.
 long getEnqueueTime()
          Returns the time this object has been created.
 long getFinishTime()
          Returns the time the publish job ends.
 int getFlags()
          Returns the flags of this publish job.
 java.util.Locale getLocale()
          Returns the locale for this publish job.
 CmsUUID getProjectId()
          Returns the project id for this publish job.
 java.lang.String getProjectName()
          Returns the originally stored project name.
 CmsUUID getPublishHistoryId()
          Returns the publish history id.
 CmsPublishList getPublishList()
          Returns the list of resources to publish.
 I_CmsReport getPublishReport()
          Returns the report for this publish job.
 I_CmsReport getReport()
          Returns the report for this publish job.
 int getSize()
          Returns the number of resources in the publish list.
 long getStartTime()
          Returns the time the publish job did actually start.
 CmsUUID getThreadUUID()
          Returns the UUID of the running publish thread.
 CmsUUID getUserId()
          Returns the user for this publish job.
protected  boolean isDirectPublish()
          Returns true if this is a "direct publish" operation.
protected  boolean isFinished()
          Returns if the publish job is already finished.
protected  boolean isStarted()
          Returns if the publish job is already started.
 I_CmsReport removePublishReport()
          Removes the assigned publish report.
 void revive(CmsObject adminCms, CmsPublishList publishList)
          Revives this publish job.
protected  void start(CmsUUID threadUUID)
          Signalizes the start of the publish job.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

C_PUBLISH_FLAG

public static final int C_PUBLISH_FLAG
The flag used to indicate a direct publish job.

See Also:
Constant Field Values
Constructor Detail

CmsPublishJobInfoBean

public CmsPublishJobInfoBean(CmsUUID historyId,
                             CmsUUID projectId,
                             java.lang.String projectName,
                             CmsUUID userId,
                             java.lang.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 Detail

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 java.util.Locale getLocale()
Returns the locale for this publish job.

Returns:
the locale for this publish job

getProjectId

public CmsUUID getProjectId()
Returns the project id for this publish job.

Returns:
the project id for this publish job

getProjectName

public java.lang.String getProjectName()
Returns the originally stored project name.

Returns:
the originally stored project name

getPublishHistoryId

public CmsUUID getPublishHistoryId()
Returns the publish history id.

Returns:
the publish history id

getPublishList

public CmsPublishList getPublishList()
Returns the list of resources to publish.

Returns:
the list of resources to publish

getPublishReport

public I_CmsReport 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:
CmsPublishJobEnqueued.getReport()

getReport

public I_CmsReport 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

public CmsUUID 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

public I_CmsReport 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 java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

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