Class AbstractODataBatchResponseItem
java.lang.Object
org.apache.olingo.client.core.communication.request.batch.AbstractODataBatchResponseItem
- All Implemented Interfaces:
Iterator<ODataResponse>,ODataBatchResponseItem
- Direct Known Subclasses:
ODataChangesetResponseItem,ODataSingleResponseItem
public abstract class AbstractODataBatchResponseItem
extends Object
implements ODataBatchResponseItem
Abstract representation of a response item about a batch request.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ODataBatchLineIteratorBatch response line iterator.protected StringBatch boundary.protected booleanprotected booleanGives information about the batch response item status.protected ODataResponseLast cached OData response.protected Iterator<ODataResponse>Expected OData responses iterator.protected static final org.slf4j.LoggerLogger.protected final Map<String,ODataResponse> Expected OData responses for the current batch response item. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResponse(String contentId, ODataResponse res) Adds the given OData response template to the current OData batch response item.voidclose()Closes the current batch responses item including all wrapped OData responses.protected ODataResponsegetResponse(String contentId) Gets response about the given contentId.protected Iterator<ODataResponse>Gets OData responses iterator.booleanhasNext()voidinitFromBatch(ODataBatchLineIterator batchLineIterator, String boundary) Initializes ODataResponse template from batch response item part.booleanChecks if the current item is a breaking item like as error item or asynchronous response part.final booleanChecks if the current batch response item is a changeset.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, next, remove
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOGLogger. -
responses
Expected OData responses for the current batch response item. -
expectedItemsIterator
Expected OData responses iterator. -
batchLineIterator
Batch response line iterator. -
boundary
Batch boundary. -
closed
protected boolean closedGives information about the batch response item status. -
current
Last cached OData response. -
breaking
protected boolean breaking
-
-
Constructor Details
-
AbstractODataBatchResponseItem
public AbstractODataBatchResponseItem(boolean isChangeset) Constructor.- Parameters:
isChangeset- 'TRUE' if the current batch response item is a changeset.
-
-
Method Details
-
addResponse
Adds the given OData response template to the current OData batch response item.- Specified by:
addResponsein interfaceODataBatchResponseItem- Parameters:
contentId- changeset contentId in case of changeset; '__RETRIEVE__' in case of retrieve item.res- OData response template to be added.
-
initFromBatch
Initializes ODataResponse template from batch response item part.- Specified by:
initFromBatchin interfaceODataBatchResponseItem- Parameters:
batchLineIterator- batch response line iterator.boundary- batch response boundary.
-
getResponse
Gets response about the given contentId.- Parameters:
contentId- response identifier (a specific contentId in case of changeset item).- Returns:
- ODataResponse corresponding to the given contentId.
-
getResponseIterator
Gets OData responses iterator.- Returns:
- OData responses iterator.
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator<ODataResponse>
-
isBreaking
public boolean isBreaking()Checks if the current item is a breaking item like as error item or asynchronous response part.- Specified by:
isBreakingin interfaceODataBatchResponseItem- Returns:
- 'TRUE' if breaking; 'FALSE' otherwise.
-
isChangeset
public final boolean isChangeset()Checks if the current batch response item is a changeset.- Specified by:
isChangesetin interfaceODataBatchResponseItem- Returns:
- 'TRUE' if the item is a changeset; 'FALSE' otherwise.
-
close
public void close()Closes the current batch responses item including all wrapped OData responses.- Specified by:
closein interfaceODataBatchResponseItem
-