public static interface SweepActionHandler.SweepItem
CmCustomQueueJob
, CmCustomSweepPolicy
, or CmCustomQueueSweep
).
A custom sweep passes an array of SweepItem
objects to a SweepActionHandler
implementation for processing.
You can set a status value on a SweepItem
object, 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.Modifier and Type | Method and Description |
---|---|
IndependentlyPersistableObject |
getTarget()
Gets an instance of a class targeted by a custom sweep.
|
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.
|
void |
setOutcome(SweepItemOutcome outcome,
java.lang.String description)
Informs the sweep service of the status of each sweep item passed to the handler.
|
IndependentlyPersistableObject getTarget()
void setOutcome(SweepItemOutcome outcome, java.lang.String description)
IGNORED
. Sweep items that are left in the IGNORED
state
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 an
IGNORED
state, 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 either FAILED
, FAILED_NO_RETRY
,
or PROCESSED
.
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 to FAILED
or FAILED_NO_RETRY
if the handler encounters an error attempting to process an item.
An item marked as FAILED
is 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 to FAILED_NO_RETRY
if 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 CmSweepResult
objects
for failure outcomes. Generating these objects requires the following combination of settings:
FAILED
or FAILED_NO_RETRY
.outcome
- The SweepItemOutcome
field that indicates the result of processing this object.description
- A message that explains a processing failure of a SweepItem
object.
The message is persisted in the FailureDescription property of the CmSweepResult
object.void setDeferral(int deferralSeconds, byte[] deferralData)
deferralSeconds
- The minimum number of seconds by which to defer processing.deferralData
- Optional data to be stored in the DeferralData property.© Copyright IBM Corporation 2006, 2015. All rights reserved.