* the operation timeout millis
* @return the sCMP message
*/
protected final SCMPMessage baseExecute(SCMPMessage reqMessage, int operationTimeoutMillis) {
// create scMessage
SCMessage scMessage = new SCMessage();
scMessage.setData(reqMessage.getBody());
scMessage.setDataLength(reqMessage.getBodyLength());
scMessage.setCompressed(reqMessage.getHeaderFlag(SCMPHeaderAttributeKey.COMPRESSION));
scMessage.setMessageInfo(reqMessage.getHeader(SCMPHeaderAttributeKey.MSG_INFO));
scMessage.setCacheId(reqMessage.getCacheId());
scMessage.setCachePartNr(reqMessage.getHeader(SCMPHeaderAttributeKey.CACHE_PARTN_NUMBER));
scMessage.setServiceName(reqMessage.getServiceName());
scMessage.setSessionId(reqMessage.getSessionId());
// call servlet service implementation
SCMessage scReply = ((ISCSessionServerCallback) this).execute(scMessage, operationTimeoutMillis);
// set up reply
SCMPMessage reply = new SCMPMessage();
reply.setIsReply(true);
reply.setServiceName(serviceName);
reply.setSessionId(reqMessage.getSessionId());
long msgSequenceNr = this.requester.getSCMPMsgSequenceNr().incrementAndGetMsgSequenceNr();
reply.setHeader(SCMPHeaderAttributeKey.MESSAGE_SEQUENCE_NR, msgSequenceNr);
reply.setMessageType(reqMessage.getMessageType());
if (scReply != null) {
reply.setBody(scReply.getData());
if (scReply.getCacheExpirationDateTime() != null) {
reply.setHeader(SCMPHeaderAttributeKey.CACHE_EXPIRATION_DATETIME,
DateTimeUtility.getDateTimeAsString(scReply.getCacheExpirationDateTime()));
}
reply.setCacheId(scReply.getCacheId());
if (scReply.getMessageInfo() != null) {
reply.setHeader(SCMPHeaderAttributeKey.MSG_INFO, scReply.getMessageInfo());
}
if (scReply.isCompressed()) {
reply.setHeaderFlag(SCMPHeaderAttributeKey.COMPRESSION);
}
if (scReply.getAppErrorCode() != Constants.EMPTY_APP_ERROR_CODE) {
reply.setHeader(SCMPHeaderAttributeKey.APP_ERROR_CODE, scReply.getAppErrorCode());
}
if (scReply.getAppErrorText() != null) {
reply.setHeader(SCMPHeaderAttributeKey.APP_ERROR_TEXT, scReply.getAppErrorText());
}
reply.setPartSize(scReply.getPartSize());
}
return reply;
}