Package org.opencms.publish
Class CmsPublishJobInfoBean
- java.lang.Object
-
- org.opencms.publish.CmsPublishJobInfoBean
-
public final class CmsPublishJobInfoBean extends java.lang.Object
Publish job information bean.- Since:
- 6.5.5
-
-
Field Summary
Fields Modifier and Type Field Description static int
C_PUBLISH_FLAG
The flag used to indicate a direct publish job.
-
Constructor Summary
Constructors Modifier Constructor Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 tonull
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.CmsPublishList
getOriginalPublishList()
Gets the original publish list (not nulled after publish job is executed).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()
Returnstrue
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()
-
-
-
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 idprojectId
- the id of the projectprojectName
- the name of the projectuserId
- the id of the userlocaleName
- the string representation of a localeflags
- flags of the publish jobresourceCount
- number of published resourcesenqueueTime
- time when the job was enqueuedstartTime
- time when the job was startedfinishTime
- 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 publishingpublishList
- the list of resources to publishreport
- 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
-
getOriginalPublishList
public CmsPublishList getOriginalPublishList()
Gets the original publish list (not nulled after publish job is executed).- Returns:
- the original publish list
-
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 objectpublishList
- a publish list- Throws:
CmsException
- if something goes wrong
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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 tonull
after publishing.- Returns:
- the cms object
-
isDirectPublish
protected boolean isDirectPublish()
Returnstrue
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
-
-