public class

BatchUtils

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

Class Overview

Utility methods for setting up and using batch feeds and entries.

Summary

Public Constructors
BatchUtils()
Public Methods
static void declareEntryExtensions(ExtensionProfile extProfile)
Declares only the entry extensions in an extension profile.
static void declareExtensions(ExtensionProfile extProfile)
Declares batch feed and entry extensions as well as the batch namespace in an extension profile.
static void declareFeedExtensions(ExtensionProfile extProfile)
Declares only the feed extensions in an extension profile.
static String getBatchId(BaseEntry<?> entry)
Gets the value of the tag <batch:id>.
static BatchInterrupted getBatchInterrupted(ExtensionPoint extPoint)
Gets the value of the tag <batch:interrupted>.
static BatchOperationType getBatchOperationType(ExtensionPoint extPoint)
Gets the batch operation type from the tag <batch:operation> in a ExtensionPoint.
static BatchStatus getBatchStatus(ExtensionPoint extPoint)
Gets the value of the tag <batch:status>.
static boolean isFailure(ExtensionPoint extPoint)
Checks whether a batch entry is an error report.
static boolean isSuccess(ExtensionPoint extPoint)
Checks whether a batch entry is a success report.
static void setBatchId(ExtensionPoint extPoint, String id)
Sets the value of the tag <batch:id>.
static void setBatchOperationType(ExtensionPoint extPoint, BatchOperationType op)
Sets the batch operation to execute in a BaseEntry.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public BatchUtils ()

Public Methods

public static void declareEntryExtensions (ExtensionProfile extProfile)

Declares only the entry extensions in an extension profile.

Parameters
extProfile

public static void declareExtensions (ExtensionProfile extProfile)

Declares batch feed and entry extensions as well as the batch namespace in an extension profile.

Parameters
extProfile ExtensionProfile

public static void declareFeedExtensions (ExtensionProfile extProfile)

Declares only the feed extensions in an extension profile.

Parameters
extProfile

public static String getBatchId (BaseEntry<?> entry)

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

Parameters
entry
Returns
  • the batch id or null if it is not set

public static BatchInterrupted getBatchInterrupted (ExtensionPoint extPoint)

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

Parameters
extPoint The extension point to get the interrupted tag from
Returns
  • the object corresponding to the tag or null

public static BatchOperationType getBatchOperationType (ExtensionPoint extPoint)

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

Parameters
extPoint Extension point to get the operation type from
Returns
  • the operation to execute or null if it's not set

public static BatchStatus getBatchStatus (ExtensionPoint extPoint)

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

Parameters
extPoint The extension point to get the status from
Returns
  • the object corresponding to the tag or null

public static boolean isFailure (ExtensionPoint extPoint)

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 getBatchStatus(ExtensionPoint) to get the error description and message when this method returns true.

Parameters
extPoint The extension point to check the status of.
Returns
  • true if the entry is an error report.
Throws
IllegalArgumentException if the entry does not contain a BatchStatus object.

public static boolean isSuccess (ExtensionPoint extPoint)

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
extPoint The extension point to check the status on.
Returns
  • true if the entry is a success report.
Throws
IllegalArgumentException if the entry does not contain a BatchStatus object.

public static void setBatchId (ExtensionPoint extPoint, String id)

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

Parameters
extPoint Extension point to put the id on
id The batch id or null to remove it

public static void setBatchOperationType (ExtensionPoint extPoint, BatchOperationType op)

Sets the batch operation to execute in a BaseEntry.

Parameters
extPoint Extension point to set the operation type on
op Batch operation type or null to remove it