default:
// code for other types of services is below
break;
}
FileSession session = (FileSession) this.getSessionById(message.getSessionId());
// sets the time of last execution
session.resetExecuteTime();
// reset session timeout to OTI+ECI - during wait for server reply
int otiOnSCMillis = (int) (oti * basicConf.getOperationTimeoutMultiplier());
double otiOnSCSeconds = (otiOnSCMillis / Constants.SEC_TO_MILLISEC_FACTOR);
this.sessionRegistry.resetSessionTimeout(session, (otiOnSCSeconds + session.getSessionTimeoutMillis()));
SCMPMessage reply = null;
try {
String remoteFileName = message.getHeader(SCMPHeaderAttributeKey.REMOTE_FILE_NAME);
FileServer fileServer = session.getFileServer();
reply = fileServer.serverDownloadFile(session, message, remoteFileName, oti);
} catch (Exception e) {
// SCMP Version request
reply = new SCMPMessage(message.getSCMPVersion());
SCMPCommandException scmpCommandException = new SCMPCommandException(SCMPError.FILE_DOWNLOAD_FAILED,
"Error occured in file server on SC.");
scmpCommandException.setMessageType(getKey());
throw scmpCommandException;
}
reply.setIsReply(true);
reply.setMessageType(getKey());
response.setSCMP(reply);
// reset session timeout to ECI
this.sessionRegistry.resetSessionTimeout(session, session.getSessionTimeoutMillis());
responderCallback.responseCallback(request, response);
}