Hi,

I need (or want) to decode the content of the http request itself in a own decoder extending the old HttpRequestDecoder. The reason is, that I have already some other acceptor / decoder pairs, which all decode the incoming stuff in the same message objects and bind to a unique SessionHandler.

I thought, that I only have to overwrite the finishDecode method from HttpRequestDecodingState to get all raw parts of the request, convert it to my own message objects and forward them afterwards to the ProtocolDecoderOutput.

Unfortunately the HttpRequestDecodingState is only a friendly defined class in the codec package and not visible from outside. Am I missing something or is there a mistake in my understanding?


public class OwnRequestDecoder extends HttpRequestDecoder
{
  public OwnRequestDecoder()
  {
    super( new HttpRequestDecodingState()
    {
      @Override
protected DecodingState finishDecode(List<Object> childProducts, ProtocolDecoderOutput out) throws Exception
      {
        for (Object m: childProducts)
        {
          // do something with the data
          // then write them out
          out.write(m);
        }
        return null;
      }
    });
  }
}


Hope that somebody has a helpful hint for me.


Best Regards
Michael

Reply via email to