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 Details

    • LOG

      protected static final org.slf4j.Logger LOG
      Logger.
    • responses

      protected final Map<String,ODataResponse> responses
      Expected OData responses for the current batch response item.
    • expectedItemsIterator

      protected Iterator<ODataResponse> expectedItemsIterator
      Expected OData responses iterator.
    • batchLineIterator

      protected ODataBatchLineIterator batchLineIterator
      Batch response line iterator.
    • boundary

      protected String boundary
      Batch boundary.
    • closed

      protected boolean closed
      Gives information about the batch response item status.
    • current

      protected ODataResponse 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

      public void addResponse(String contentId, ODataResponse res)
      Adds the given OData response template to the current OData batch response item.
      Specified by:
      addResponse in interface ODataBatchResponseItem
      Parameters:
      contentId - changeset contentId in case of changeset; '__RETRIEVE__' in case of retrieve item.
      res - OData response template to be added.
    • initFromBatch

      public void initFromBatch(ODataBatchLineIterator batchLineIterator, String boundary)
      Initializes ODataResponse template from batch response item part.
      Specified by:
      initFromBatch in interface ODataBatchResponseItem
      Parameters:
      batchLineIterator - batch response line iterator.
      boundary - batch response boundary.
    • getResponse

      protected ODataResponse getResponse(String contentId)
      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

      protected Iterator<ODataResponse> getResponseIterator()
      Gets OData responses iterator.
      Returns:
      OData responses iterator.
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<ODataResponse>
    • isBreaking

      public boolean isBreaking()
      Checks if the current item is a breaking item like as error item or asynchronous response part.
      Specified by:
      isBreaking in interface ODataBatchResponseItem
      Returns:
      'TRUE' if breaking; 'FALSE' otherwise.
    • isChangeset

      public final boolean isChangeset()
      Checks if the current batch response item is a changeset.
      Specified by:
      isChangeset in interface ODataBatchResponseItem
      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:
      close in interface ODataBatchResponseItem