/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
IEncoderDecoder encoderDecoder = null;
SCMPMessage scReply = null;
SCMPMessage reqMessage = null;
try {
byte[] buffer = new byte[request.getContentLength()];
request.getInputStream().read(buffer);
Statistics.getInstance().incrementTotalMessages(buffer.length);
if (ConnectionLogger.isEnabledFull()) {
ConnectionLogger.logReadBuffer(this.getClass().getSimpleName(), request.getServerName(), request.getServerPort(),
buffer, 0, buffer.length);
}
ByteArrayInputStream bais = new ByteArrayInputStream(buffer);
encoderDecoder = AppContext.getEncoderDecoderFactory().createEncoderDecoder(buffer);
reqMessage = (SCMPMessage) encoderDecoder.decode(bais);
if (reqMessage.isKeepAlive() == true) {
// keep alive received, just reply nothing more to do.
reqMessage.setIsReply(true);
// write reply to servlet output stream