private void processRequestAcknowledgements ( final AbstractBody req , final AbstractBody resp ) { assertLocked ( ) ; if ( ! cmParams . isAckingRequests ( ) ) { return ; } // If a report or time attribute is set, we aren't acking anything if ( resp . getAttribute ( Attributes . REPORT ) != null ) { return ; } // Figure out what the highest acked RID is String acked = resp . getAttribute ( Attributes . ACK ) ; Long ackUpTo ; if ( acked == null ) { // Implicit ack of all prior requests up until RID ackUpTo = Long . parseLong ( req . getAttribute ( Attributes . RID ) ) ; } else { ackUpTo = Long . parseLong ( acked ) ; } // Remove the acked requests from the list if ( LOG . isLoggable ( Level . FINEST ) ) { LOG . finest ( "Removing pending acks up to: " + ackUpTo ) ; } Iterator < ComposableBody > iter = pendingRequestAcks . iterator ( ) ; while ( iter . hasNext ( ) ) { AbstractBody pending = iter . next ( ) ; Long pendingRID = Long . parseLong ( pending . getAttribute ( Attributes . RID ) ) ; if ( pendingRID . compareTo ( ackUpTo ) <= 0 ) { iter . remove ( ) ; } } }
Check the response for request acknowledgements and take appropriate action .