Package org.opencms.publish
Class CmsPublishQueue
java.lang.Object
org.opencms.publish.CmsPublishQueue
This queue contains all not jet started publish jobs.
- Since:
- 6.5.5
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
CmsPublishQueue
(CmsPublishEngine publishEngine) Default constructor, for an empty queue. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
abortPublishJob
(CmsPublishJobInfoBean publishJob) Aborts the given publish job.protected void
add
(CmsPublishJobInfoBean publishJob) Pushes a new publish job with the given information in publish queue.protected List<CmsPublishJobEnqueued>
asList()
Returns an unmodifiable list representation of this queue.protected boolean
contains
(CmsPublishJobInfoBean publishJob) Checks if the given job is already in the queue, this does only check for the identical job.static org.apache.commons.collections.Buffer
getQueue()
Creates the buffer used as publish queue.protected void
initialize
(CmsObject adminCms, boolean revive) Initializes the internal FIFO queue with publish jobs from the database.protected boolean
isEmpty()
Checks if the queue is empty.protected CmsPublishJobInfoBean
next()
Returns the next publish job to be published, removing it from the queue, ornull
if the queue is empty.protected void
remove
(CmsPublishJobInfoBean publishJob) Removes the given job from the list.protected void
update
(CmsPublishJobInfoBean publishJob) Updates the given job in the list.
-
Field Details
-
m_publishEngine
The publish engine.
-
-
Constructor Details
-
CmsPublishQueue
Default constructor, for an empty queue.- Parameters:
publishEngine
- the publish engine instance
-
-
Method Details
-
getQueue
Creates the buffer used as publish queue.- Returns:
- the queue buffer
-
abortPublishJob
Aborts the given publish job.- Parameters:
publishJob
- the publish job to abort- Returns:
true
if the publish job was found
-
add
Pushes a new publish job with the given information in publish queue.If possible, the publish job starts immediately.
- Parameters:
publishJob
- the publish job to enqueue- Throws:
CmsException
- if something goes wrong
-
asList
Returns an unmodifiable list representation of this queue.- Returns:
- a list of
CmsPublishJobEnqueued
objects
-
contains
Checks if the given job is already in the queue, this does only check for the identical job.- Parameters:
publishJob
- the publish job to check for- Returns:
- true if the given job is already in the queue
-
initialize
Initializes the internal FIFO queue with publish jobs from the database.- Parameters:
adminCms
- an admin cms objectrevive
-true
if the publish queue should be revived from the database
-
isEmpty
Checks if the queue is empty.- Returns:
true
if the queue is empty
-
next
Returns the next publish job to be published, removing it from the queue, ornull
if the queue is empty.- Returns:
- the next publish job to be published
-
remove
Removes the given job from the list.- Parameters:
publishJob
- the publish job to remove- Throws:
CmsException
- if something goes wrong
-
update
Updates the given job in the list.- Parameters:
publishJob
- the publish job to
-