GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Overview
  • Use
  • Tree
  • Deprecated
  • Index
  • Search
  • Help
  • io.netty.handler.codec.spdy
  • SpdyHttpEncoder

This view

  • Original page
  • New address

GeezerVison is showing netty.io — SpdyHttpEncoder (Netty API Reference (4.1.141.Final))

Class SpdyHttpEncoder

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToMessageEncoder<HttpObject>
io.netty.handler.codec.spdy.SpdyHttpEncoder
All Implemented Interfaces:
ChannelHandler, ChannelOutboundHandler

public class SpdyHttpEncoder extends MessageToMessageEncoder<HttpObject>
Encodes HttpRequests, HttpResponses, and HttpContents into SpdySynStreamFrames and SpdySynReplyFrames.

Request Annotations

SPDY specific headers must be added to HttpRequests:
Header NameHeader Value
"X-SPDY-Stream-ID" The Stream-ID for this request. Stream-IDs must be odd, positive integers, and must increase monotonically.
"X-SPDY-Priority" The priority value for this request. The priority should be between 0 and 7 inclusive. 0 represents the highest priority and 7 represents the lowest. This header is optional and defaults to 0.

Response Annotations

SPDY specific headers must be added to HttpResponses:
Header NameHeader Value
"X-SPDY-Stream-ID" The Stream-ID of the request corresponding to this response.

Pushed Resource Annotations

SPDY specific headers must be added to pushed HttpRequests:
Header NameHeader Value
"X-SPDY-Stream-ID" The Stream-ID for this resource. Stream-IDs must be even, positive integers, and must increase monotonically.
"X-SPDY-Associated-To-Stream-ID" The Stream-ID of the request that initiated this pushed resource.
"X-SPDY-Priority" The priority value for this resource. The priority should be between 0 and 7 inclusive. 0 represents the highest priority and 7 represents the lowest. This header is optional and defaults to 0.

Required Annotations

SPDY requires that all Requests and Pushed Resources contain an HTTP "Host" header.

Optional Annotations

Requests and Pushed Resources must contain a SPDY scheme header. This can be set via the "X-SPDY-Scheme" header but otherwise defaults to "https" as that is the most common SPDY deployment.

Chunked Content

This encoder associates all HttpContents that it receives with the most recently received 'chunked' HttpRequest or HttpResponse.

Pushed Resources

All pushed resources should be sent before sending the response that corresponds to the initial request.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface ChannelHandler

    ChannelHandler.Sharable
    Modifier and Type
    Interface
    Description
    static @interface 
    ChannelHandler.Sharable
    Indicates that the same instance of the annotated ChannelHandler can be added to one or more ChannelPipelines multiple times without a race condition.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpdyHttpEncoder(SpdyVersion version)
    Creates a new instance.
    SpdyHttpEncoder(SpdyVersion version, boolean headersToLowerCase, boolean validateHeaders)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    encode(ChannelHandlerContext ctx, HttpObject msg, List<Object> out)
    Encode from one message to an other.

    Methods inherited from class MessageToMessageEncoder

    acceptOutboundMessage, write
    Modifier and Type
    Method
    Description
    boolean
    acceptOutboundMessage(Object msg)
    Returns true if the given message should be handled.
    void
    write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise)
    Calls ChannelOutboundInvoker.write(Object, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.

    Methods inherited from class ChannelOutboundHandlerAdapter

    bind, close, connect, deregister, disconnect, flush, read
    Modifier and Type
    Method
    Description
    void
    bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise)
    Calls ChannelOutboundInvoker.bind(SocketAddress, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.
    void
    close(ChannelHandlerContext ctx, ChannelPromise promise)
    Calls ChannelOutboundInvoker.close(ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.
    void
    connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise)
    Calls ChannelOutboundInvoker.connect(SocketAddress, SocketAddress, ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.
    void
    deregister(ChannelHandlerContext ctx, ChannelPromise promise)
    Calls ChannelOutboundInvoker.deregister(ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.
    void
    disconnect(ChannelHandlerContext ctx, ChannelPromise promise)
    Calls ChannelOutboundInvoker.disconnect(ChannelPromise) to forward to the next ChannelOutboundHandler in the ChannelPipeline.
    void
    flush(ChannelHandlerContext ctx)
    Calls ChannelHandlerContext.flush() to forward to the next ChannelOutboundHandler in the ChannelPipeline.
    void
    read(ChannelHandlerContext ctx)
    Calls ChannelHandlerContext.read() to forward to the next ChannelOutboundHandler in the ChannelPipeline.

    Methods inherited from class ChannelHandlerAdapter

    ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharable
    Modifier and Type
    Method
    Description
    protected void
    ensureNotSharable()
    Throws IllegalStateException if ChannelHandlerAdapter.isSharable() returns true
    void
    exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
    Deprecated.
    is part of ChannelInboundHandler
    void
    handlerAdded(ChannelHandlerContext ctx)
    Do nothing by default, sub-classes may override this method.
    void
    handlerRemoved(ChannelHandlerContext ctx)
    Do nothing by default, sub-classes may override this method.
    boolean
    isSharable()
    Return true if the implementation is ChannelHandler.Sharable and so can be added to different ChannelPipelines.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpdyHttpEncoder

      public SpdyHttpEncoder(SpdyVersion version)
      Creates a new instance.
      Parameters:
      version - the protocol version
    • SpdyHttpEncoder

      public SpdyHttpEncoder(SpdyVersion version, boolean headersToLowerCase, boolean validateHeaders)
      Creates a new instance.
      Parameters:
      version - the protocol version
      headersToLowerCase - convert header names to lowercase. In a controlled environment, one can disable the conversion.
      validateHeaders - validate the header names and values when adding them to the SpdyHeaders
  • Method Details

    • encode

      protected void encode(ChannelHandlerContext ctx, HttpObject msg, List<Object> out) throws Exception
      Description copied from class: MessageToMessageEncoder
      Encode from one message to an other. This method will be called for each written message that can be handled by this encoder.
      Specified by:
      encode in class MessageToMessageEncoder<HttpObject>
      Parameters:
      ctx - the ChannelHandlerContext which this MessageToMessageEncoder belongs to
      msg - the message to encode to an other one
      out - the List into which the encoded msg should be added needs to do some kind of aggregation
      Throws:
      Exception - is thrown if an error occurs
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.