@Override
public void responseCallback(IRequest request, IResponse response) {
SCMPMessage scmpRequest = request.getMessage();
String sessionId = scmpRequest.getSessionId();
SCMPMessageSequenceNr msgSequenceNr = NettyResponderRequestHandlerTask.compositeRegistry.getSCMPMsgSequenceNr(sessionId);
if (response.isLarge() && AppContext.isScEnvironment() == false) {
// response is large & not on SC, create a large response for reply
SCMPCompositeSender largeResponse = new SCMPCompositeSender(response.getSCMP());
SCMPMessage firstSCMP = largeResponse.getFirst();
response.setSCMP(firstSCMP);
if (SCMPMessageSequenceNr.necessaryToWrite(firstSCMP.getMessageType())) {
// no incrementation necessary - already done inside commands
firstSCMP.setHeader(SCMPHeaderAttributeKey.MESSAGE_SEQUENCE_NR, msgSequenceNr.getCurrentNr());
}
int oti = scmpRequest.getHeaderInt(SCMPHeaderAttributeKey.OPERATION_TIMEOUT);
// adding compositeReceiver to the composite registry
NettyResponderRequestHandlerTask.compositeRegistry.addSCMPLargeResponse(sessionId, largeResponse, oti);
}