| org.jicarilla.http.HTTPHandler
All known Subclasses: org.jicarilla.http.HTTPMessageGenerator,
HTTPHandler | public interface HTTPHandler (Code) | | The handler gets notified whenever the parser finds a new
element of a message. Handlers do *not* need to be
threadsafe.
author: Leo Simons version: $Id: HTTPHandler.java,v 1.5 2004/04/03 10:13:23 lsimons Exp $ |
Method Summary | |
void | endMessage() This method will be called by the parser to signal that
the current message has ended. | void | foundBody(ByteBuffer buffer) This method will be called zero or more times, after
the request or response line and the headers have been
parsed. | void | foundHeaderName(ByteBuffer header) This method will be called zero or more times, once
for each header name, after the start line
has been parsed. | void | foundHeaderValue(ByteBuffer value) This method will be called zero or more times, once
for each header value, after the start line
has been parsed. | void | foundStartLineFirstField(ByteBuffer firstField) This will be the second method called. | void | foundStartLineSecondField(ByteBuffer secondField) This will be the third method called. | void | foundStartLineThirdField(ByteBuffer thirdField) this will be the fourth method called. | void | foundTrailerName(ByteBuffer trailer) This method will be called one or more times, once
for each trailer name, after the body
has been parsed, if and only if
HTTPHandler.hasTrailers() returned
true. | void | foundTrailerValue(ByteBuffer value) This method will be called one or more times, once
for each footer value, after the body has been parsed, if and
only if
HTTPHandler.hasTrailers() returned
true. | int | getBodySize() This method will be caleld once by the parser to determine
the size of the expected body, if and only if the call to
HTTPHandler.getBodyType() returned
HTTPParser.BODY_TYPE_NORMAL . | int | getBodyType() This method will be called once by the parser, after
all the headers have been found. | String[] | getTrailerNames() This method will be called once by the parser directly after
HTTPHandler.hasTrailers() if and only if that method returned
true.
a non-empty array of non-null strings representingthe trailers that will be present. | boolean | hasTrailers() This method will be called by the parser if
HTTPHandler.getBodyType() returns
HTTPParser.BODY_TYPE_CHUNKING to determine whether
any trailers will be present. | void | newMessage() This method will be called by the parser to signal that
it will start providing the data of a new message that
is being received. |
endMessage | void endMessage()(Code) | | This method will be called by the parser to signal that
the current message has ended. It will always be called
exactly once.
|
foundBody | void foundBody(ByteBuffer buffer)(Code) | | This method will be called zero or more times, after
the request or response line and the headers have been
parsed. It will always follow after a call to
foundHeaderValue() .
Parameters: buffer - part of the body of the message. Notethat decoding of any Chunked transfer codings willhave been done already. |
foundHeaderName | void foundHeaderName(ByteBuffer header)(Code) | | This method will be called zero or more times, once
for each header name, after the start line
has been parsed. It will be followed by a call to the
foundHeaderValue() method.
Parameters: header - the name of the header that was found |
foundHeaderValue | void foundHeaderValue(ByteBuffer value)(Code) | | This method will be called zero or more times, once
for each header value, after the start line
has been parsed. It will always follow immediately after
the foundHeaderName() has been called.
Parameters: value - the value of the header that was found |
foundStartLineFirstField | void foundStartLineFirstField(ByteBuffer firstField)(Code) | | This will be the second method called. In the case of
a request, this field will container the request
method. In the case of a response, this will be the
HTTP version.
Parameters: firstField - the value of the first field |
foundStartLineSecondField | void foundStartLineSecondField(ByteBuffer secondField)(Code) | | This will be the third method called. In the case of
a request, this field will contain the request
URI. In the case of a response, this field will contain
the status code.
Parameters: secondField - the value of the second field |
foundStartLineThirdField | void foundStartLineThirdField(ByteBuffer thirdField)(Code) | | this will be the fourth method called. In the case of a
request, this field will contain the version. In the case
of a response, this field will contain the reason phrase.
Parameters: thirdField - the value of the third field |
foundTrailerName | void foundTrailerName(ByteBuffer trailer)(Code) | | This method will be called one or more times, once
for each trailer name, after the body
has been parsed, if and only if
HTTPHandler.hasTrailers() returned
true. It will be followed by a call to the
foundTrailerValue() method. Only trailer
names that have been returned from the parser's call to
HTTPHandler.getTrailerNames() will be provided.
Parameters: trailer - the name of the trailer that was found. |
foundTrailerValue | void foundTrailerValue(ByteBuffer value)(Code) | | This method will be called one or more times, once
for each footer value, after the body has been parsed, if and
only if
HTTPHandler.hasTrailers() returned
true. It will always follow immediately after
the foundTrailerName() has been called.
Parameters: value - the value of the trailer that was found. |
getTrailerNames | String[] getTrailerNames()(Code) | | This method will be called once by the parser directly after
HTTPHandler.hasTrailers() if and only if that method returned
true.
a non-empty array of non-null strings representingthe trailers that will be present. |
hasTrailers | boolean hasTrailers()(Code) | | This method will be called by the parser if
HTTPHandler.getBodyType() returns
HTTPParser.BODY_TYPE_CHUNKING to determine whether
any trailers will be present. It will be followed by a call
to the getTrailerNames() method if and only if
this method returns true. It will be followed by a call to
the endMessage() method if and only if this
method returns false.
true if there are trailers present, false otherwise. |
newMessage | void newMessage()(Code) | | This method will be called by the parser to signal that
it will start providing the data of a new message that
is being received.
|
|
|