Package org.opencms.publish
Class CmsPublishQueue
- java.lang.Object
-
- org.opencms.publish.CmsPublishQueue
-
public class CmsPublishQueue extends java.lang.Object
This queue contains all not jet started publish jobs.- Since:
- 6.5.5
-
-
Field Summary
Fields Modifier and Type Field Description protected CmsPublishEngine
m_publishEngine
The publish engine.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CmsPublishQueue(CmsPublishEngine publishEngine)
Default constructor, for an empty queue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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 java.util.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 Detail
-
m_publishEngine
protected final CmsPublishEngine m_publishEngine
The publish engine.
-
-
Constructor Detail
-
CmsPublishQueue
protected CmsPublishQueue(CmsPublishEngine publishEngine)
Default constructor, for an empty queue.- Parameters:
publishEngine
- the publish engine instance
-
-
Method Detail
-
getQueue
public static org.apache.commons.collections.Buffer getQueue()
Creates the buffer used as publish queue.- Returns:
- the queue buffer
-
abortPublishJob
protected boolean abortPublishJob(CmsPublishJobInfoBean publishJob)
Aborts the given publish job.- Parameters:
publishJob
- the publish job to abort- Returns:
true
if the publish job was found
-
add
protected void add(CmsPublishJobInfoBean publishJob) throws CmsException
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
protected java.util.List<CmsPublishJobEnqueued> asList()
Returns an unmodifiable list representation of this queue.- Returns:
- a list of
CmsPublishJobEnqueued
objects
-
contains
protected boolean contains(CmsPublishJobInfoBean publishJob)
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
protected void initialize(CmsObject adminCms, boolean revive)
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
protected boolean isEmpty()
Checks if the queue is empty.- Returns:
true
if the queue is empty
-
next
protected CmsPublishJobInfoBean 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
protected void remove(CmsPublishJobInfoBean publishJob) throws CmsException
Removes the given job from the list.- Parameters:
publishJob
- the publish job to remove- Throws:
CmsException
- if something goes wrong
-
update
protected void update(CmsPublishJobInfoBean publishJob)
Updates the given job in the list.- Parameters:
publishJob
- the publish job to
-
-