public class

BatchStatus

extends ExtensionPoint
implements Extension IBatchStatus
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.batch.BatchStatus

Class Overview

Entry extension for the element <batch:status>, which contains status information returned by the server about how an entry was processed in a batch operation.

Summary

Fields
private int code
private String content
private ContentType contentType
private String reason
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
BatchStatus()
Creates an empty BatchStatus.
BatchStatus(ServiceException e)
Creates a BatchStatus and initializes it based on an exception.
Public Methods
static BatchStatus createCreatedStatus()
Creates a Success status object.
static BatchStatus createSuccessStatus()
Creates a 200 Success status object.
void generate(XmlWriter w, ExtensionProfile extProfile)
Generate an Atom XML representation of the current object.
int getCode()
Returns the HTTP response code for this status.
String getContent()
Gets error message.
ContentType getContentType()
Gets mime type for the content of this error.
static ExtensionDescription getDefaultDescription()
Returns the suggested extension description.
XmlParser.ElementHandler getHandler(ExtensionProfile extProfile, String namespace, String localName, Attributes attrs)
Parses XML in the Atom format and uses it to set field values.
String getReason()
Returns a short message describing this status.
void setCode(int code)
Sets HTTP response code.
void setContent(String content)
Sets error message.
void setContentType(ContentType contentType)
Sets mime type for the content of this error.
void setReason(String reason)
Sets a short message describing this status.
[Expand]
Inherited Methods
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension
From interface com.google.gdata.data.batch.IBatchStatus

Fields

private int code

private String content

private ContentType contentType

private String reason

Public Constructors

public BatchStatus ()

Creates an empty BatchStatus.

public BatchStatus (ServiceException e)

Creates a BatchStatus and initializes it based on an exception.

Parameters
e

Public Methods

public static BatchStatus createCreatedStatus ()

Creates a Success status object.

public static BatchStatus createSuccessStatus ()

Creates a 200 Success status object.

public void generate (XmlWriter w, ExtensionProfile extProfile)

Generate an Atom XML representation of the current object.

Parameters
w XML writer
extProfile Extension profile
Throws
IOException

public int getCode ()

Returns the HTTP response code for this status.

Returns
  • the status code.

public String getContent ()

Gets error message.

Returns
  • the content of the element.

public ContentType getContentType ()

Gets mime type for the content of this error.

Returns
  • the content type of the element.

public static ExtensionDescription getDefaultDescription ()

Returns the suggested extension description.

public XmlParser.ElementHandler getHandler (ExtensionProfile extProfile, String namespace, String localName, Attributes attrs)

Parses XML in the Atom format and uses it to set field values.

Parameters
extProfile Extension profile
namespace Extension namespace
localName Tag name, without the namespace prefix
attrs XML attributes
Returns
  • a child handler for batch:atom
Throws
ParseException if the current element is not a valid batch:atom element

public String getReason ()

Returns a short message describing this status.

Returns
  • the reason for the status.

public void setCode (int code)

Sets HTTP response code.

Parameters
code

public void setContent (String content)

Sets error message. Its type must correspond to the content type.

Parameters
content

public void setContentType (ContentType contentType)

Sets mime type for the content of this error.

Parameters
contentType

public void setReason (String reason)

Sets a short message describing this status.

Parameters
reason