public class BatchUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getBatchId(IEntry entry)
Gets the value of the tag
<batch:id>. |
static BatchOperationType |
getBatchOperationType(IEntry entry)
Gets the batch operation type from the tag
<batch:operation>
in a IEntry. |
static BatchOperationType |
getBatchOperationType(IFeed feed)
Gets the batch operation type from the tag
<batch:operation>
in a BaseFeed. |
static IBatchInterrupted |
getInterrupted(IEntry entry)
Gets the value of the tag
<batch:interrupted>. |
static IBatchStatus |
getStatus(IEntry entry)
Gets the value of the tag
<batch:status>. |
static boolean |
isFailure(IEntry entry)
Checks whether a batch entry is an error report.
|
static boolean |
isSuccess(IEntry entry)
Checks whether a batch entry is a success report.
|
static void |
setBatchId(IEntry entry,
java.lang.String id)
Sets the value of the tag
<batch:id>. |
static void |
setBatchOperationType(IEntry entry,
BatchOperationType op)
Sets the batch operation to execute in a
IEntry. |
static void |
setBatchOperationType(IFeed feed,
BatchOperationType op)
Sets the batch operation to execute in a
BaseFeed. |
static void |
throwIfInterrupted(IFeed ifeed)
Throws a
BatchInterrupted exception if any entry within the feed
has a batch interrupted child element. |
public static java.lang.String getBatchId(IEntry entry)
<batch:id>.entry - the entry to get the id frompublic static void setBatchId(IEntry entry, java.lang.String id)
<batch:id>.entry - entry to get the id fromid - the batch id or null to remove itpublic static BatchOperationType getBatchOperationType(IEntry entry)
<batch:operation>
in a IEntry.entry - the entry to get the operation type frompublic static BatchOperationType getBatchOperationType(IFeed feed)
<batch:operation>
in a BaseFeed.feed - public static void setBatchOperationType(IEntry entry, BatchOperationType op)
IEntry.entry - the entry to set the operation type onop - batch operation type or null to remove itpublic static void setBatchOperationType(IFeed feed, BatchOperationType op)
BaseFeed.feed - op - batch operation type or null to remove it.public static IBatchInterrupted getInterrupted(IEntry entry)
<batch:interrupted>.entry - public static IBatchStatus getStatus(IEntry entry)
<batch:status>.entry - public static boolean isSuccess(IEntry entry)
BatchStatus object.entry - java.lang.IllegalArgumentException - if the entry does not contain
a BatchStatus object.public static boolean isFailure(IEntry entry)
BatchStatus object.
You'll want to call getStatus(IEntry)
to get the error description and message when this
method returns true.entry - java.lang.IllegalArgumentException - if the entry does not contain
a BatchStatus object.public static void throwIfInterrupted(IFeed ifeed) throws BatchInterruptedException
BatchInterrupted exception if any entry within the feed
has a batch interrupted child element.ifeed - batch response feed to checkBatchInterruptedException - if batch interrupted entry is found.