// SCMPLargeRequest handles splitting, works like an iterator
SCMPCompositeSender largeResponse = new SCMPCompositeSender(message);
requesterCallback = new SCRequesterSCMPCallback(message, scmpCallback, connectionContext, largeResponse,
msgSequenceNr);
// setting up operation timeout after successful send
TimeoutWrapper timeoutWrapper = new TimeoutWrapper((ITimeout) requesterCallback);
SCRequesterSCMPCallback reqCallback = (SCRequesterSCMPCallback) requesterCallback;
ScheduledFuture<TimeoutWrapper> timeout = (ScheduledFuture<TimeoutWrapper>) AppContext.otiScheduler.schedule(
timeoutWrapper, (long) timeoutMillis, TimeUnit.MILLISECONDS);
reqCallback.setOperationTimeout(timeout);
reqCallback.setTimeoutMillis(timeoutMillis);
// extract first part message & send
SCMPMessage part = largeResponse.getFirst();
// handling msgSequenceNr
if (SCMPMessageSequenceNr.necessaryToWrite(message.getMessageType())) {
part.setHeader(SCMPHeaderAttributeKey.MESSAGE_SEQUENCE_NR, msgSequenceNr.getCurrentNr());
}
// send
connection.send(part, requesterCallback);
} else {
requesterCallback = new SCRequesterSCMPCallback(message, scmpCallback, connectionContext, msgSequenceNr);
// setting up operation timeout after successful send
TimeoutWrapper timeoutWrapper = new TimeoutWrapper((ITimeout) requesterCallback);
SCRequesterSCMPCallback reqCallback = (SCRequesterSCMPCallback) requesterCallback;
ScheduledFuture<TimeoutWrapper> timeout = (ScheduledFuture<TimeoutWrapper>) AppContext.otiScheduler.schedule(
timeoutWrapper, (long) timeoutMillis, TimeUnit.MILLISECONDS);
reqCallback.setOperationTimeout(timeout);
reqCallback.setTimeoutMillis(timeoutMillis);