com.google.gdata.model.batch
Class BatchInterrupted

java.lang.Object
  extended by com.google.gdata.model.Element
      extended by com.google.gdata.model.batch.BatchInterrupted
All Implemented Interfaces:
IBatchInterrupted

public class BatchInterrupted
extends Element
implements IBatchInterrupted

Signals that feed processing was interrupted.


Field Summary
static AttributeKey<ContentType> CONTENT_TYPE
          The MIME type of the content of this element.
static AttributeKey<java.lang.Integer> ERROR_COUNT
          The number of entries for which processing failed.
static ElementKey<java.lang.String,BatchInterrupted> KEY
          The key for this element.
static AttributeKey<java.lang.String> REASON
          The reason.
static AttributeKey<java.lang.Integer> SKIPPED_COUNT
          The number of entries parsed but not processed.
static AttributeKey<java.lang.Integer> SUCCESS_COUNT
          The number of entries processed successfully.
static AttributeKey<java.lang.Integer> TOTAL_COUNT
          The number of entries that were parsed.
 
Constructor Summary
BatchInterrupted()
          Default mutable constructor.
BatchInterrupted(java.lang.String reason, int totalCount, int successCount, int errorCount)
          Creates and initializes a BatchInterrupted object.
BatchInterrupted(java.lang.Throwable cause, int totalCount, int successCount, int errorCount)
          Creates and initializes a BatchInterrupted object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getContent()
          Returns the error message explaining what went wrong while processing the request.
 ContentType getContentType()
          Returns the MIME type of the content of this element.
 int getErrorCount()
          Returns the number of entries for which processing failed.
 java.lang.String getReason()
          Returns the reason.
 int getSkippedCount()
          Returns the number of entries parsed but not processed.
 int getSuccessCount()
          Returns the number of entries processed successfully.
 int getTotalCount()
          Returns the number of entries that were parsed.
 boolean hasContent()
          Returns whether it has the error message explaining what went wrong while processing the request.
 boolean hasContentType()
          Returns whether it has the MIME type of the content of this element.
 boolean hasErrorCount()
          Returns true if the error count exists.
 int hashCode()
           
 boolean hasReason()
          Returns whether it has the reason.
 boolean hasSkippedCount()
          Returns whether it has the number of entries parsed but not processed.
 boolean hasSuccessCount()
          Returns whether it has the number of entries processed successfully.
 boolean hasTotalCount()
          Returns whether it has the number of entries that were parsed.
static void registerMetadata(MetadataRegistry registry)
          Registers the metadata for this element.
 BatchInterrupted setContent(java.lang.String content)
          Sets the error message explaining what went wrong while processing the request.
 BatchInterrupted setContentType(ContentType contentType)
          Sets the MIME type of the content of this element.
 BatchInterrupted setErrorCount(java.lang.Integer errorCount)
          Sets the number of entries for which processing failed.
 BatchInterrupted setReason(java.lang.String reason)
          Sets the reason.
 BatchInterrupted setSkippedCount(java.lang.Integer skippedCount)
          Sets the number of entries parsed but not processed.
 BatchInterrupted setSuccessCount(java.lang.Integer successCount)
          Sets the number of entries processed successfully.
 BatchInterrupted setTotalCount(java.lang.Integer totalCount)
          Sets the number of entries that were parsed.
 java.lang.String toString()
           
 
Methods inherited from class com.google.gdata.model.Element
adapt, adapt, addElement, addElement, addElement, clear, createElement, createElement, eq, getAttributeCount, getAttributeIterator, getAttributeIterator, getAttributeValue, getAttributeValue, getDefaultKey, getElement, getElement, getElementCount, getElementId, getElementIterator, getElementIterator, getElementKey, getElements, getElements, getElementSet, getElementSet, getElementValue, getElementValue, getTextValue, getTextValue, hasAttribute, hasAttribute, hasElement, hasElement, hasTextValue, isLocked, lock, narrow, removeAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, removeElement, removeElement, removeElement, removeElement, replaceElement, resolve, resolve, sameClassAs, setAttributeValue, setAttributeValue, setElement, setElement, setElement, setTextValue, validate, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY

public static final ElementKey<java.lang.String,BatchInterrupted> KEY
The key for this element.


CONTENT_TYPE

public static final AttributeKey<ContentType> CONTENT_TYPE
The MIME type of the content of this element.


ERROR_COUNT

public static final AttributeKey<java.lang.Integer> ERROR_COUNT
The number of entries for which processing failed.


REASON

public static final AttributeKey<java.lang.String> REASON
The reason.


SKIPPED_COUNT

public static final AttributeKey<java.lang.Integer> SKIPPED_COUNT
The number of entries parsed but not processed.


SUCCESS_COUNT

public static final AttributeKey<java.lang.Integer> SUCCESS_COUNT
The number of entries processed successfully.


TOTAL_COUNT

public static final AttributeKey<java.lang.Integer> TOTAL_COUNT
The number of entries that were parsed.

Constructor Detail

BatchInterrupted

public BatchInterrupted()
Default mutable constructor.


BatchInterrupted

public BatchInterrupted(java.lang.String reason,
                        int totalCount,
                        int successCount,
                        int errorCount)
Creates and initializes a BatchInterrupted object.

Parameters:
reason - exception that caused batch processing to stop
totalCount - number of entries parsed so far, note that it is to be expected that totalCount >= successCount + errorCount
successCount - number of entries processed successfully so far
errorCount - number of entries rejected so far
Throws:
java.lang.IllegalArgumentException - if the total count is less than successCount - errorCount

BatchInterrupted

public BatchInterrupted(java.lang.Throwable cause,
                        int totalCount,
                        int successCount,
                        int errorCount)
Creates and initializes a BatchInterrupted object.

Parameters:
cause - exception that caused batch processing to stop
totalCount - number of entries parsed so far, note that it is to be expected that totalCount >= successCount + errorCount
successCount - number of entries processed successfully so far
errorCount - number of entries rejected so far
Method Detail

registerMetadata

public static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.


getContent

public java.lang.String getContent()
Returns the error message explaining what went wrong while processing the request.

Specified by:
getContent in interface IBatchInterrupted
Returns:
error message explaining what went wrong while processing the request

setContent

public BatchInterrupted setContent(java.lang.String content)
Sets the error message explaining what went wrong while processing the request.

Parameters:
content - error message explaining what went wrong while processing the request or null to reset

hasContent

public boolean hasContent()
Returns whether it has the error message explaining what went wrong while processing the request.

Returns:
whether it has the error message explaining what went wrong while processing the request

getContentType

public ContentType getContentType()
Returns the MIME type of the content of this element.

Specified by:
getContentType in interface IBatchInterrupted
Returns:
MIME type of the content of this element

setContentType

public BatchInterrupted setContentType(ContentType contentType)
Sets the MIME type of the content of this element.

Parameters:
contentType - MIME type of the content of this element or null to reset

hasContentType

public boolean hasContentType()
Returns whether it has the MIME type of the content of this element.

Returns:
whether it has the MIME type of the content of this element

getErrorCount

public int getErrorCount()
Returns the number of entries for which processing failed.

Specified by:
getErrorCount in interface IBatchInterrupted
Returns:
number of entries for which processing failed

setErrorCount

public BatchInterrupted setErrorCount(java.lang.Integer errorCount)
Sets the number of entries for which processing failed.

Parameters:
errorCount - number of entries for which processing failed or null to reset

hasErrorCount

public boolean hasErrorCount()
Returns true if the error count exists.


getReason

public java.lang.String getReason()
Returns the reason.

Specified by:
getReason in interface IBatchInterrupted
Returns:
reason

setReason

public BatchInterrupted setReason(java.lang.String reason)
Sets the reason.

Parameters:
reason - reason or null to reset

hasReason

public boolean hasReason()
Returns whether it has the reason.

Returns:
whether it has the reason

getSkippedCount

public int getSkippedCount()
Returns the number of entries parsed but not processed.

Specified by:
getSkippedCount in interface IBatchInterrupted
Returns:
number of entries parsed but not processed

setSkippedCount

public BatchInterrupted setSkippedCount(java.lang.Integer skippedCount)
Sets the number of entries parsed but not processed.

Parameters:
skippedCount - number of entries parsed but not processed or null to reset

hasSkippedCount

public boolean hasSkippedCount()
Returns whether it has the number of entries parsed but not processed.

Returns:
whether it has the number of entries parsed but not processed

getSuccessCount

public int getSuccessCount()
Returns the number of entries processed successfully.

Specified by:
getSuccessCount in interface IBatchInterrupted
Returns:
number of entries processed successfully

setSuccessCount

public BatchInterrupted setSuccessCount(java.lang.Integer successCount)
Sets the number of entries processed successfully.

Parameters:
successCount - number of entries processed successfully or null to reset

hasSuccessCount

public boolean hasSuccessCount()
Returns whether it has the number of entries processed successfully.

Returns:
whether it has the number of entries processed successfully

getTotalCount

public int getTotalCount()
Returns the number of entries that were parsed.

Specified by:
getTotalCount in interface IBatchInterrupted
Returns:
number of entries that were parsed

setTotalCount

public BatchInterrupted setTotalCount(java.lang.Integer totalCount)
Sets the number of entries that were parsed.

Parameters:
totalCount - number of entries that were parsed or null to reset

hasTotalCount

public boolean hasTotalCount()
Returns whether it has the number of entries that were parsed.

Returns:
whether it has the number of entries that were parsed

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Element

hashCode

public int hashCode()
Overrides:
hashCode in class Element

toString

public java.lang.String toString()
Overrides:
toString in class Element