Class InboundRequestPartsCoordinator
java.lang.Object
de.hybris.platform.odata2services.odata.monitoring.impl.InboundRequestPartsCoordinator
- Direct Known Subclasses:
DefaultInboundRequestService.InboundRequestPartsCoordinator
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 Summary
Modifier and TypeMethodDescriptionprotected RequestBatchEntitygetBatch()protected ResponseChangeSetEntityprotected InboundRequestMediaModelgetMedia()protected booleanhasNext()Determines whether there are more batches not yet iterated.protected voidnext()Advances to the next record by iterating across all collections.protected ResponseChangeSetEntityThe number of the change sets returned from the parser is not consistent.
-
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. SinceInboundRequests correspond toRequestBatchEntity, this method uses the collection ofRequestBatchEntityas the leader. It iterates that collection and then advances to theResponseChangeSetEntityandInboundRequestMediaModelcorresponding to the batch entity in other collections. -
rollToLastChangeSetInBatch
The number of the change sets returned from the parser is not consistent. In case of success, there is aResponseChangeSetEntitycreated for every change set received with the request. In case of the error, however, it's always only oneResponseChangeSetEntityregardless 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 theRequestBatchEntityiterated first before this method is called, so that the current batch record would be correctly set. Implementations ensure this order in thenext()method or, if the order has changed, this method also needs to be overridden to account for it. - See Also:
-
getBatch
-
getChangeSet
-
getMedia
-