Class InboundRequestPartsCoordinator

java.lang.Object
de.hybris.platform.odata2services.odata.monitoring.impl.InboundRequestPartsCoordinator
Direct Known Subclasses:
DefaultInboundRequestService.InboundRequestPartsCoordinator

public class InboundRequestPartsCoordinator extends Object
Receives collections of the parts, from which an InboundRequest is created, and coordinates access to the collections in a way that after each iteration the state contains parts (batch entry, change set entry and media) related to exactly same InboundRequest.
  • Method Details

    • hasNext

      protected boolean hasNext()
      Determines whether there are more batches not yet iterated.
      Returns:
      true, if there is at least one more not iterated batch; false, otherwise.
      See Also:
    • next

      protected void next()
      Advances to the next record by iterating across all collections. Since InboundRequests correspond to RequestBatchEntity, this method uses the collection of RequestBatchEntity as the leader. It iterates that collection and then advances to the ResponseChangeSetEntity and InboundRequestMediaModel corresponding to the batch entity in other collections.
    • rollToLastChangeSetInBatch

      protected ResponseChangeSetEntity rollToLastChangeSetInBatch()
      The number of the change sets returned from the parser is not consistent. In case of success, there is a ResponseChangeSetEntity created for every change set received with the request. In case of the error, however, it's always only one ResponseChangeSetEntity regardless of how many change sets were submitted in the batch in the request body. That is because if one change set fails, the whole batch is rolled back and therefore a status for the whole batch is returned rather then for each of its change sets.
      Returns:
      last change set for the current RequestBatchEntity.

      Note: this method relies on the RequestBatchEntity iterated first before this method is called, so that the current batch record would be correctly set. Implementations ensure this order in the next() method or, if the order has changed, this method also needs to be overridden to account for it.

      See Also:
    • getBatch

      protected RequestBatchEntity getBatch()
    • getChangeSet

      protected ResponseChangeSetEntity getChangeSet()
    • getMedia

      protected InboundRequestMediaModel getMedia()