rabbit.httpio
Class HttpHeaderReader
java.lang.Object
rabbit.httpio.BaseSocketHandler
rabbit.httpio.HttpHeaderReader
- All Implemented Interfaces:
- ReadHandler, SocketChannelHandler, LineListener
public class HttpHeaderReader
- extends BaseSocketHandler
- implements LineListener, ReadHandler
A handler that reads http headers
- Author:
- Robert Olofsson
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpHeaderReader
public HttpHeaderReader(SocketChannel channel,
BufferHandle bh,
NioHandler nioHandler,
TrafficLogger tl,
boolean request,
boolean strictHttp,
HttpHeaderListener reader)
- Parameters:
request
- true if a request is read, false if a response is read.
Servers may respond without header (HTTP/0.9) so try to
handle that.
readRequest
public void readRequest()
throws IOException
- Throws:
IOException
getDescription
public String getDescription()
- Specified by:
getDescription
in interface SocketChannelHandler
- Overrides:
getDescription
in class BaseSocketHandler
closed
public void closed()
- Description copied from class:
BaseSocketHandler
- Does nothing by default
- Specified by:
closed
in interface SocketChannelHandler
- Overrides:
closed
in class BaseSocketHandler
timeout
public void timeout()
- Description copied from class:
BaseSocketHandler
- Does nothing by default
- Specified by:
timeout
in interface SocketChannelHandler
- Overrides:
timeout
in class BaseSocketHandler
read
public void read()
- Specified by:
read
in interface ReadHandler
lineRead
public void lineRead(String line)
throws IOException
- Handle a newly read line.
- Specified by:
lineRead
in interface LineListener
- Parameters:
line
- the line of text that have been read.
- Throws:
IOException
readHeader
public void readHeader(String msg)
throws IOException
- Throws:
IOException