public class

BatchUtils

extends Object
java.lang.Object
   ↳ com.google.gdata.model.batch.BatchUtils

Class Overview

New data model version of batch utils. These utilities can operate on both the old and the new data model, so should be used during the transition.

Summary

Public Methods
static String getBatchId(IEntry entry)
Gets the value of the tag <batch:id>.
static BatchOperationType getBatchOperationType(IFeed feed)
Gets the batch operation type from the tag <batch:operation> in a BaseFeed.
static BatchOperationType getBatchOperationType(IEntry entry)
Gets the batch operation type from the tag <batch:operation> in a IEntry.
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, 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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static String getBatchId (IEntry entry)

Gets the value of the tag <batch:id>.

Parameters
entry The entry to get the id from
Returns
  • the batch id or null if it is not set

public static BatchOperationType getBatchOperationType (IFeed feed)

Gets the batch operation type from the tag <batch:operation> in a BaseFeed.

Parameters
feed
Returns
  • the operation to execute or null if it's not set

public static BatchOperationType getBatchOperationType (IEntry entry)

Gets the batch operation type from the tag <batch:operation> in a IEntry.

Parameters
entry The entry to get the operation type from
Returns
  • the operation to execute or null if it's not set

public static IBatchInterrupted getInterrupted (IEntry entry)

Gets the value of the tag <batch:interrupted>.

Parameters
entry
Returns
  • the object corresponding to the tag or null

public static IBatchStatus getStatus (IEntry entry)

Gets the value of the tag <batch:status>.

Parameters
entry
Returns
  • the object corresponding to the tag or null

public static boolean isFailure (IEntry entry)

Checks whether a batch entry is an error report. This method is a shortcut for checking the code of the entry's BatchStatus object. You'll want to call getStatus(IEntry) to get the error description and message when this method returns true.

Parameters
entry
Returns
  • true if the entry is an error report.
Throws
IllegalArgumentException if the entry does not contain a BatchStatus object.

public static boolean isSuccess (IEntry entry)

Checks whether a batch entry is a success report. This method is a shortcut for checking the code of the entry's BatchStatus object.

Parameters
entry
Returns
  • true if the entry is a success report.
Throws
IllegalArgumentException if the entry does not contain a BatchStatus object.

public static void setBatchId (IEntry entry, String id)

Sets the value of the tag <batch:id>.

Parameters
entry Entry to get the id from
id The batch id or null to remove it

public static void setBatchOperationType (IEntry entry, BatchOperationType op)

Sets the batch operation to execute in a IEntry.

Parameters
entry The entry to set the operation type on
op Batch operation type or null to remove it

public static void setBatchOperationType (IFeed feed, BatchOperationType op)

Sets the batch operation to execute in a BaseFeed.

Parameters
feed
op Batch operation type or null to remove it.

public static void throwIfInterrupted (IFeed ifeed)

Throws a BatchInterrupted exception if any entry within the feed has a batch interrupted child element.

Parameters
ifeed Batch response feed to check
Throws
BatchInterruptedException if batch interrupted entry is found.