Google Data APIs Client Library (1.41.1)



com.google.gdata.data.batch
Class BatchUtils

java.lang.Object
  extended by com.google.gdata.data.batch.BatchUtils

public class BatchUtils
extends java.lang.Object

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


Constructor Summary
BatchUtils()
           
 
Method Summary
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 java.lang.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, java.lang.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchUtils

public BatchUtils()
Method Detail

declareExtensions

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

declareFeedExtensions

public static void declareFeedExtensions(ExtensionProfile extProfile)
Declares only the feed extensions in an extension profile.

Parameters:
extProfile -

declareEntryExtensions

public static void declareEntryExtensions(ExtensionProfile extProfile)
Declares only the entry extensions in an extension profile.

Parameters:
extProfile -

getBatchId

public static java.lang.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

setBatchId

public static void setBatchId(ExtensionPoint extPoint,
                              java.lang.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

getBatchOperationType

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

setBatchOperationType

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

getBatchInterrupted

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

getBatchStatus

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

isSuccess

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:
java.lang.IllegalArgumentException - if the entry does not contain a BatchStatus object.

isFailure

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:
java.lang.IllegalArgumentException - if the entry does not contain a BatchStatus object.