Updated APIviz tags and improved Javadoc of the HTTP codec

This commit is contained in:
Trustin Lee 2009-07-20 03:37:35 +00:00
parent 5c49cae981
commit f15db3a65e
13 changed files with 55 additions and 4 deletions

View File

@ -31,6 +31,8 @@ import java.util.Set;
* @author Trustin Lee (tlee@redhat.com)
* @author Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
*
* @apiviz.landmark
*/
public interface Cookie extends Comparable<Cookie> {

View File

@ -35,6 +35,12 @@ import java.util.regex.Pattern;
* Decodes an HTTP header value into {@link Cookie}s. This decoder can decode
* the HTTP cookie version 0, 1, and 2.
*
* <pre>
* HttpRequest req = ...;
* String value = req.getHeader("Cookie");
* Set&lt;Cookie&gt; cookies = new CookieDecoder().decode(value);
* </pre>
*
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)

View File

@ -35,6 +35,19 @@ import java.util.TreeSet;
* method. Once {@link #encode()} is called, all added {@link Cookie}s are
* encoded into an HTTP header value and all {@link Cookie}s in the internal
* data structure are removed so that the encoder can start over.
* <pre>
* // Client-side example
* HttpRequest req = ...;
* CookieEncoder encoder = new CookieEncoder(false);
* encoder.addCookie("JSESSIONID", "1234");
* res.setHeader("Cookie", encoder.encode());
*
* // Server-side example
* HttpResponse res = ...;
* CookieEncoder encoder = new CookieEncoder(true);
* encoder.addCookie("JSESSIONID", "1234");
* res.setHeader("Set-Cookie", encoder.encode());
* </pre>
*
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org)

View File

@ -39,6 +39,8 @@ import org.jboss.netty.channel.ChannelPipeline;
* @version $Rev$, $Date$
*
* @see HttpChunkAggregator
*
* @apiviz.landmark
*/
public interface HttpChunk {

View File

@ -55,6 +55,7 @@ import org.jboss.netty.handler.codec.frame.TooLongFrameException;
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.landmark
* @apiviz.has org.jboss.netty.handler.codec.http.HttpChunk oneway - - filters out
*/
@ChannelPipelineCoverage("one")

View File

@ -37,8 +37,10 @@ import org.jboss.netty.buffer.ChannelBuffers;
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @see HttpHeaders
*
* @apiviz.landmark
* @apiviz.has org.jboss.netty.handler.codec.http.HttpChunk oneway - - is followed by
* @apiviz.uses org.jboss.netty.handler.codec.http.HttpHeaders - - useful
*/
public interface HttpMessage {

View File

@ -79,6 +79,8 @@ import org.jboss.netty.handler.codec.replay.ReplayingDecoder;
* @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.landmark
*/
public abstract class HttpMessageDecoder extends ReplayingDecoder<HttpMessageDecoder.State> {

View File

@ -53,6 +53,8 @@ import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
* @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.landmark
*/
@ChannelPipelineCoverage("all")
public abstract class HttpMessageEncoder extends OneToOneEncoder {

View File

@ -26,6 +26,13 @@ package org.jboss.netty.handler.codec.http;
/**
* An HTTP request.
*
* <h3>Accessing Query Parameters and Cookie</h3>
* <p>
* Unlike the Servlet API, a query string is constructed and decomposed by
* {@link QueryStringEncoder} and {@link QueryStringDecoder}. {@link Cookie}
* support is also provided separately via {@link CookieEncoder} and
* {@link CookieDecoder}.
*
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org)
* @version $Rev$, $Date$
@ -33,6 +40,8 @@ package org.jboss.netty.handler.codec.http;
* @see HttpResponse
* @see QueryStringEncoder
* @see QueryStringDecoder
* @see CookieEncoder
* @see CookieDecoder
*/
public interface HttpRequest extends HttpMessage {

View File

@ -26,12 +26,19 @@ package org.jboss.netty.handler.codec.http;
/**
* An HTTP response.
*
* <h3>Accessing Cookie</h3>
* <p>
* Unlike the Servlet API, {@link Cookie} support is provided separately via
* {@link CookieEncoder} and {@link CookieDecoder}.
*
* @author The Netty Project (netty-dev@lists.jboss.org)
* @author Andy Taylor (andy.taylor@jboss.org)
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @see HttpRequest
* @see CookieEncoder
* @see CookieDecoder
*/
public interface HttpResponse extends HttpMessage {

View File

@ -47,8 +47,10 @@ import java.util.regex.Pattern;
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.stereotype utility
* @see QueryStringEncoder
*
* @apiviz.stereotype utility
* @apiviz.has org.jboss.netty.handler.codec.http.HttpRequest oneway - - decodes
*/
public class QueryStringDecoder {

View File

@ -45,8 +45,10 @@ import java.util.List;
* @author Trustin Lee (tlee@redhat.com)
* @version $Rev$, $Date$
*
* @apiviz.stereotype utility
* @see QueryStringDecoder
*
* @apiviz.stereotype utility
* @apiviz.has org.jboss.netty.handler.codec.http.HttpRequest oneway - - encodes
*/
public class QueryStringEncoder {

View File

@ -24,9 +24,10 @@
/**
* Encoder, decoder and their related message types for HTTP.
*
* @apiviz.exclude HttpHeaders\.
* @apiviz.exclude ^java\.lang\.
* @apiviz.exclude OneToOne(Encoder|Decoder)$
* @apiviz.exclude HttpHeaders
* @apiviz.exclude (QueryString|Cookie)(Encoder|Decoder)$
* @apiviz.exclude \.codec\.replay\.
* @apiviz.exclude \.(Simple)?Channel[A-Za-z]*Handler$
*/