com.wm.app.tn.delivery
Class DeliveryJob

java.lang.Object
  extended by com.wm.app.tn.util.TNFixedData
      extended by com.wm.app.tn.delivery.GuaranteedJob
          extended by com.wm.app.tn.delivery.DeliveryJob
All Implemented Interfaces:
com.wm.data.IData, java.lang.Cloneable

public class DeliveryJob
extends GuaranteedJob

A DeliveryJob represents one unit of work for the reliable delivery engine. Each document that is delivered via reliable delivery is assigned to a delivery job.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.wm.app.tn.util.TNFixedData
TNFixedData.TreeCursor
 
Field Summary
 
Fields inherited from class com.wm.app.tn.delivery.GuaranteedJob
DELIVERING, DONE, FAILED, HELD, NEW, NO_JOB_ID, PENDING, QUEUED, STATUS_STRINGS, STOPPED
 
Constructor Summary
DeliveryJob()
          Default constructor needed for subclasses of TNFixedData
DeliveryJob(java.lang.String jobId, java.lang.String serverId, DeliveryService service, BizDocEnvelope bizdoc, long ttw, int retryLimit, int retryFactor, java.lang.String username, java.lang.String password)
          Define a new Job
 
Method Summary
 void addActivityEntry(int type, java.lang.String brief, java.lang.String full)
          Adds an activity log entry.
static com.wm.data.IData create()
          create needed for subclasses of TNFixedData
static java.lang.Object[][] DeliveryJobSchema()
           
 java.lang.String getClassification()
          This method should return the job "classification" which is a String representing an abbreviated name for the class.
 com.wm.data.IData getDBIData()
          This method is used by the DB operations when storing jobs.
 void setBizDocEnvelope(BizDocEnvelope bizdoc)
          Sets the bizdoc and sets up the inputs for the DeliveryService.
 void setDBIData(com.wm.data.IData data)
          This method is used by the DB operations when restoring jobs from the database.
 java.lang.String toString()
          Default toString implementation returns class name followed by contents.
 
Methods inherited from class com.wm.app.tn.delivery.GuaranteedJob
attempted, codeForMsg, delivering, done, enqueue, exceedsRetries, fail, getBizDocEnvelope, getDeliveryService, getInputData, getInvokeAsUser, getJobId, getOutputData, getQueueName, getRetries, getRetryFactor, getRetryLimit, getServerId, getService, getStatus, getStatusMsg, getStatusVal, getTimeCreated, getTimeUpdated, getTransportStatus, getTransportStatusMessage, getTransportTime, getTTW, GuaranteedJobSchema, hold, invoke, isActive, isComplete, isDelivering, isDone, isExpired, isFailed, isHeld, isNew, isPending, isProcessing, isQueued, isRetry, isStopped, readyToRun, reset, retriesReached, retryFailed, save, setActive, setAttempted, setDefaultServerId, setInputData, setInvokeAsUser, setJobId, setOutputData, setProcessing, setQueueName, setRetries, setRetryFactor, setRetryLimit, setServerId, setService, setStatus, setTimeCreated, setTimeUpdated, setTransportStatus, setTransportStatusMessage, setTransportTime, setTTW, start, stop
 
Methods inherited from class com.wm.app.tn.util.TNFixedData
clone, dataSize, get, get, getCursor, getHashCursor, getIndexCursor, getKey, getSharedCursor, getTreeCursor, indexOf, merge, set, set
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeliveryJob

public DeliveryJob()
Default constructor needed for subclasses of TNFixedData


DeliveryJob

public DeliveryJob(java.lang.String jobId,
                   java.lang.String serverId,
                   DeliveryService service,
                   BizDocEnvelope bizdoc,
                   long ttw,
                   int retryLimit,
                   int retryFactor,
                   java.lang.String username,
                   java.lang.String password)
Define a new Job

Parameters:
jobId - job id
serverId - server id
service - service to be invoked when running this job
bizdoc - document to deliver
ttw - Time-to-wait (in milliseconds)
retryLimit - max number of retry attempts
retryFactor - back-off factor for retrying jobs
Method Detail

create

public static com.wm.data.IData create()
create needed for subclasses of TNFixedData


DeliveryJobSchema

public static java.lang.Object[][] DeliveryJobSchema()

getClassification

public java.lang.String getClassification()
Description copied from class: GuaranteedJob
This method should return the job "classification" which is a String representing an abbreviated name for the class. It is used in the UI.

Specified by:
getClassification in class GuaranteedJob
Returns:
the classification

addActivityEntry

public void addActivityEntry(int type,
                             java.lang.String brief,
                             java.lang.String full)
Adds an activity log entry.

Specified by:
addActivityEntry in class GuaranteedJob
Parameters:
type - activity log type
brief - brief message to insert
full - full message to insert

setBizDocEnvelope

public void setBizDocEnvelope(BizDocEnvelope bizdoc)
Sets the bizdoc and sets up the inputs for the DeliveryService.

Overrides:
setBizDocEnvelope in class GuaranteedJob
Parameters:
bizdoc - the document associated with this job

getDBIData

public com.wm.data.IData getDBIData()
This method is used by the DB operations when storing jobs. It contains key/values for the javaclass, username, and password.

Specified by:
getDBIData in class GuaranteedJob

setDBIData

public void setDBIData(com.wm.data.IData data)
This method is used by the DB operations when restoring jobs from the database.

Specified by:
setDBIData in class GuaranteedJob
Parameters:
data - data to set

toString

public java.lang.String toString()
Description copied from class: TNFixedData
Default toString implementation returns class name followed by contents.

Overrides:
toString in class GuaranteedJob
Returns:
a String representation of a DeliveryJob