com.arsdigita.cms.publishToFile
Class QueueEntry

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.cms.publishToFile.QueueEntry

public class QueueEntry
extends com.arsdigita.domain.DomainObject

One entry in the PFS queue. The methods isPublishTask(), isUnpublishTask(), isRepublishTask(), and isMoveTask() can be used to further determine what exact task should be performed for this entry. Exactly one of these methods will return true.

Version:
1.0
Author:
David Lutterkort

Field Summary
static String BASE_DATA_OBJECT_TYPE
          The name of the PDL object type for queue entries.
static String DESTINATION
           
static String FAIL_COUNT
           
static String HOST
           
static String ID
           
static String IN_PROCESS
           
static String IN_PROCESS_NO
           
static String IN_PROCESS_YES
           
static String ITEM_ID
           
static String ITEM_TYPE
           
static String PARENT_ID
           
static String SORT_ORDER
           
static String TASK
           
static String TASK_MOVE
           
static String TASK_PUBLISH
           
static String TASK_REPUBLISH
           
static String TASK_UNPUBLISH
           
static String TIME_LAST_FAILED
           
static String TIME_QUEUED
           
 
Fields inherited from class com.arsdigita.domain.DomainObject
versionId
 
Constructor Summary
protected QueueEntry()
           
  QueueEntry(com.arsdigita.persistence.DataObject dataObject)
          Constructor.
protected QueueEntry(String objectType)
           
 
Method Summary
static QueueEntry create(ContentItem item, BigDecimal parentId, String task, com.arsdigita.web.Host host, String destination)
          Creates object and initializes with data.
protected  String getBaseDataObjectType()
          Return the PDL object type for queue entries.
 String getDestination()
          Get the destination of the task.
 Long getFailCount()
          Return the number oftimes this entry has been processed unsuccessfully.
 com.arsdigita.web.Host getHost()
           
 BigDecimal getID()
           
 ContentItem getItem()
          Return a readonly copy the item affected by this queue entry or null if the item does no longer exist.
 BigDecimal getItemId()
          Return the ID of the item that is affected by this task.
 String getItemType()
           
 ContentItem getParent()
          Return a readonly copy of the parent of the item affected by this queue entry or null if the item does no longer exist.
 BigDecimal getParentId()
          Return the ID of the parent of this item.
 String getTask()
           
 Date getTimeLastFailed()
          Return the time this entry was last processed unsuccessfully.
 Date getTimeQueued()
          Return when this entry was added to the queue.
 void initialize()
           
 boolean isMoveTask()
          Return true if this entry represents a move task.
 boolean isPublishTask()
          Return true if this entry represents a publish task.
 boolean isRepublishTask()
          Return true if this entry represents a republish task.
 boolean isUnpublishTask()
          Return true if this entry represents an unpublish task.
 String toString()
           
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, beforeSave, clear, delete, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
The name of the PDL object type for queue entries.

See Also:
Constant Field Values

ID

public static final String ID
See Also:
Constant Field Values

ITEM_ID

public static final String ITEM_ID
See Also:
Constant Field Values

PARENT_ID

public static final String PARENT_ID
See Also:
Constant Field Values

ITEM_TYPE

public static final String ITEM_TYPE
See Also:
Constant Field Values

TASK

public static final String TASK
See Also:
Constant Field Values

HOST

public static final String HOST
See Also:
Constant Field Values

DESTINATION

public static final String DESTINATION
See Also:
Constant Field Values

TIME_QUEUED

public static final String TIME_QUEUED
See Also:
Constant Field Values

TIME_LAST_FAILED

public static final String TIME_LAST_FAILED
See Also:
Constant Field Values

FAIL_COUNT

public static final String FAIL_COUNT
See Also:
Constant Field Values

SORT_ORDER

public static final String SORT_ORDER
See Also:
Constant Field Values

IN_PROCESS

public static final String IN_PROCESS
See Also:
Constant Field Values

TASK_PUBLISH

public static final String TASK_PUBLISH
See Also:
Constant Field Values

TASK_UNPUBLISH

public static final String TASK_UNPUBLISH
See Also:
Constant Field Values

TASK_MOVE

public static final String TASK_MOVE
See Also:
Constant Field Values

TASK_REPUBLISH

public static final String TASK_REPUBLISH
See Also:
Constant Field Values

IN_PROCESS_YES

public static final String IN_PROCESS_YES
See Also:
Constant Field Values

IN_PROCESS_NO

public static final String IN_PROCESS_NO
See Also:
Constant Field Values
Constructor Detail

QueueEntry

public QueueEntry(com.arsdigita.persistence.DataObject dataObject)
Constructor. Creates a new DomainObject instance to encapsulate a given data object.

Parameters:
dataObject - The data object to encapsulate in the new domain object.

QueueEntry

protected QueueEntry()

QueueEntry

protected QueueEntry(String objectType)
Method Detail

getBaseDataObjectType

protected String getBaseDataObjectType()
Return the PDL object type for queue entries.

Returns:
the PDL object type for queue entries.

initialize

public void initialize()

create

public static QueueEntry create(ContentItem item,
                                BigDecimal parentId,
                                String task,
                                com.arsdigita.web.Host host,
                                String destination)
Creates object and initializes with data.

Parameters:
parentId - a BigDecimal value
task - task Should be QueueEntry.TASK_PUBLISH or QueueEntry.TASK_UNPUBLISH.
destination - location in file system (within document root). Used only if task is publish).

getID

public BigDecimal getID()

getItemId

public BigDecimal getItemId()
Return the ID of the item that is affected by this task.

Returns:
the ID of the item that is affected by this task.
See Also:
getItem()

getItemType

public String getItemType()

getItem

public ContentItem getItem()
Return a readonly copy the item affected by this queue entry or null if the item does no longer exist.

Returns:
the item affected by this entry or null

getParentId

public BigDecimal getParentId()
Return the ID of the parent of this item.

Returns:
the ID of the parent of this item.
See Also:
getParent()

getParent

public ContentItem getParent()
Return a readonly copy of the parent of the item affected by this queue entry or null if the item does no longer exist.

Returns:
the parent of the item affected by this entry or null

getDestination

public String getDestination()
Get the destination of the task.

Returns:
a String value

getTask

public String getTask()

getHost

public com.arsdigita.web.Host getHost()

isPublishTask

public boolean isPublishTask()
Return true if this entry represents a publish task.

Returns:
true if this entry represents a publish task.

isUnpublishTask

public boolean isUnpublishTask()
Return true if this entry represents an unpublish task.

Returns:
true if this entry represents an unpublish task.

isRepublishTask

public boolean isRepublishTask()
Return true if this entry represents a republish task.

Returns:
true if this entry represents a republish task.

isMoveTask

public boolean isMoveTask()
Return true if this entry represents a move task.

Returns:
true if this entry represents a move task.

getTimeQueued

public Date getTimeQueued()
Return when this entry was added to the queue.


getTimeLastFailed

public Date getTimeLastFailed()
Return the time this entry was last processed unsuccessfully.


getFailCount

public Long getFailCount()
Return the number oftimes this entry has been processed unsuccessfully.

Returns:
the number oftimes this entry has been processed unsuccessfully.

toString

public String toString()


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2352 UTC