Interface SweepActionHandler.SweepItem
-
- Enclosing interface:
- SweepActionHandler
public static interface SweepActionHandler.SweepItemA subinterface for getting an instance of a class targeted by a custom sweep (CmCustomQueueJob,CmCustomSweepPolicy, orCmCustomQueueSweep). A custom sweep passes an array ofSweepItemobjects to aSweepActionHandlerimplementation for processing. You can set a status value on aSweepItemobject, indicating the processing outcome for an instance. For a queue sweep, you can also defer processing of a queue entry for a specified period of time.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description IndependentlyPersistableObjectgetTarget()Gets an instance of a class targeted by a custom sweep.voidsetDeferral(int deferralSeconds, byte[] deferralData)Intended for objects returned by a queue sweep, this method specifies that processing of a queue entry should be deferred for at least a minimum period of time before re-processing, and optionally specifies binary data to be stored in the DeferralData property of the queue entry for use when that re-processing occurs.voidsetOutcome(SweepItemOutcome outcome, java.lang.String description)Informs the sweep service of the status of each sweep item passed to the handler.
-
-
-
Method Detail
-
getTarget
IndependentlyPersistableObject getTarget()
Gets an instance of a class targeted by a custom sweep.
-
setOutcome
void setOutcome(SweepItemOutcome outcome, java.lang.String description)
Informs the sweep service of the status of each sweep item passed to the handler. Every sweep item in the array that is passed to a sweep handler is initialized toIGNORED. Sweep items that are left in theIGNOREDstate are not added to the examined, processed, and failed counters that are maintained by the sweep service. In general, custom sweep handler implementations should call this method on each item in the array and set it to a processed or failed state.For queue sweeps, it's especially important to not leave a sweep item with an outcome of
IGNORED. When the sweep service encounters a queue sweep item in anIGNOREDstate, it leaves the item in the queue table and does not increment the number of retries. This causes the item to be retried indefinitely until the handler explicitly sets the outcome parameter to eitherFAILED,FAILED_NO_RETRY, orPROCESSED.For a queue sweep item successfully processed, set the outcome to
PROCESSED, and the sweep service will remove the item from the queue table. Set the outcome toFAILEDorFAILED_NO_RETRYif the handler encounters an error attempting to process an item. An item marked asFAILEDis retried until successful, or until the number of retries is equal to the value that is set on the QueueSweep.MaximumFailures property. Set the outcome toFAILED_NO_RETRYif you know that the failure is not ephemeral and will never succeed after a retry.For sweep jobs and sweep policies, the server can persist
CmSweepResultobjects for failure outcomes. Generating these objects requires the following combination of settings:- the outcome parameter of this method is set to
FAILEDorFAILED_NO_RETRY. - the SweepMode property on the sweep job or sweep policy is set to SWEEP_MODE_NORMAL. A sweep job must also have its RecordFailures property set to TRUE.
- Parameters:
outcome- TheSweepItemOutcomefield that indicates the result of processing this object.description- A message that explains a processing failure of aSweepItemobject. The message is persisted in the FailureDescription property of theCmSweepResultobject.
- the outcome parameter of this method is set to
-
setDeferral
void setDeferral(int deferralSeconds, byte[] deferralData)Intended for objects returned by a queue sweep, this method specifies that processing of a queue entry should be deferred for at least a minimum period of time before re-processing, and optionally specifies binary data to be stored in the DeferralData property of the queue entry for use when that re-processing occurs. The method allows time for an asynchronous operation performed on a queue entry to complete. The method will not affect the queue sweep processed object counter.- Parameters:
deferralSeconds- The minimum number of seconds by which to defer processing.deferralData- Optional data to be stored in the DeferralData property.
-
-