org.mashupbots.socko.context

HttpChunkProcessingContext

case class HttpChunkProcessingContext (channel: Channel, initialHttpRequest: InitialHttpRequest, httpChunk: HttpChunk) extends HttpProcessingContext with Product with Serializable

Context for processing HTTP chunks.

The HttpChunkProcessingContext will only be sent to processors:

channel

Channel by which the request entered and response will be written

initialHttpRequest

The initial HTTP request associated with this chunk

httpChunk

Incoming chunk of data for processing

Linear Supertypes
Serializable, Serializable, Product, Equals, HttpProcessingContext, ProcessingContext, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. HttpChunkProcessingContext
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. HttpProcessingContext
  7. ProcessingContext
  8. AnyRef
  9. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HttpChunkProcessingContext (channel: Channel, initialHttpRequest: InitialHttpRequest, httpChunk: HttpChunk)

    channel

    Channel by which the request entered and response will be written

    initialHttpRequest

    The initial HTTP request associated with this chunk

    httpChunk

    Incoming chunk of data for processing

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. val acceptedEncodings : Array[String]

    Array of accepted encoding for content compression from the HTTP header

    Array of accepted encoding for content compression from the HTTP header

    For example, give then header Accept-Encoding: gzip, deflate, then an array containing gzip and defalte will be returned.

    Definition Classes
    HttpChunkProcessingContextHttpProcessingContext
  7. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  8. val cache : Map[String, String]

    Cache that can be use to pass data from handler to processor and between processors

    Cache that can be use to pass data from handler to processor and between processors

    Definition Classes
    ProcessingContext
  9. def canEqual (arg0: Any): Boolean

    Definition Classes
    HttpChunkProcessingContext → Equals
  10. val channel : Channel

    Channel by which the request entered and response will be written

    Channel by which the request entered and response will be written

    Definition Classes
    HttpChunkProcessingContextProcessingContext
  11. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. val endPoint : EndPoint

    HTTP end point used by this chunk

    HTTP end point used by this chunk

    Definition Classes
    HttpChunkProcessingContextHttpProcessingContextProcessingContext
  13. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  14. def equals (arg0: Any): Boolean

    Definition Classes
    HttpChunkProcessingContext → Equals → AnyRef → Any
  15. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  17. def hashCode (): Int

    Definition Classes
    HttpChunkProcessingContext → AnyRef → Any
  18. val httpChunk : HttpChunk

    Incoming chunk of data for processing

  19. val initialHttpRequest : InitialHttpRequest

    The initial HTTP request associated with this chunk

  20. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  21. val isKeepAlive : Boolean

    True if and only if this connection is to be kept alive and the channel should NOT be closed after a response is returned.

    True if and only if this connection is to be kept alive and the channel should NOT be closed after a response is returned.

    This flag is controlled by the existence of the keep alive HTTP header.

    Connection: keep-alive
    
    Definition Classes
    HttpChunkProcessingContextHttpProcessingContext
  22. val isLastChunk : Boolean

    Flag to indicate if this is the last chunk

  23. def lastChunkHeaders : List[Entry[String, String]]

    Headers associated with the last chunk

  24. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  25. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  26. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  27. def productArity : Int

    Definition Classes
    HttpChunkProcessingContext → Product
  28. def productElement (arg0: Int): Any

    Definition Classes
    HttpChunkProcessingContext → Product
  29. def productIterator : Iterator[Any]

    Definition Classes
    Product
  30. def productPrefix : String

    Definition Classes
    HttpChunkProcessingContext → Product
  31. def readBinaryContent (): Array[Byte]

    Get content as byte array.

    Get content as byte array. Empty array is returned if there is no content

    Definition Classes
    HttpChunkProcessingContextProcessingContext
  32. def readStringContent (charset: Charset): String

    Get content as a string.

    Get content as a string. Empty string is returned if there is no content.

    charset

    Character set to use to convert data to string

    Definition Classes
    HttpChunkProcessingContextProcessingContext
  33. def readStringContent (): String

    Get content as a UTF8 string.

    Get content as a UTF8 string. Empty string is returned if there is no content.

    Definition Classes
    HttpChunkProcessingContextProcessingContext
  34. def redirect (url: String): Unit

    Redirects the browser to the specified URL using the 302 HTTP status code.

    Redirects the browser to the specified URL using the 302 HTTP status code.

    Request

    GET /index.html HTTP/1.1
    Host: www.example.com
    

    Response

    HTTP/1.1 302 Found
    Location: http://www.newurl.org/
    
    url

    URL to which the browser will be redirected

    Definition Classes
    HttpProcessingContext
  35. def setContentTypeHeader (response: HttpResponse, mimeType: String): Unit

    Sets the content type header for the HTTP Response

    Sets the content type header for the HTTP Response

    For example:

    Content-Type: image/gif
    
    response

    HTTP response

    mimeType

    MIME type

    Definition Classes
    HttpProcessingContext
  36. def setContentTypeHeader (response: HttpResponse, file: File): Unit

    Sets the content type header for the HTTP Response based on the file name extension

    Sets the content type header for the HTTP Response based on the file name extension

    For example:

    Content-Type: image/gif
    

    This implementation uses MimetypesFileTypeMap and relies on the presence of the file extening in a mime.types file.

    response

    HTTP response

    file

    file to extract content type

    Definition Classes
    HttpProcessingContext
  37. def setDateAndCacheHeaders (response: HttpResponse, lastModified: Date, browserCacheSeconds: Int): Unit

    Sets the Date, Last-Modified, Expires and Cache-Control headers in the HTTP Response

    Sets the Date, Last-Modified, Expires and Cache-Control headers in the HTTP Response

    For example:

    Date:          Tue, 01 Mar 2011 22:44:26 GMT
    Last-Modified: Wed, 30 Jun 2010 21:36:48 GMT
    Expires:       Tue, 01 Mar 2012 22:44:26 GMT
    Cache-Control: private, max-age=31536000
    
    response

    HTTP response

    lastModified

    When the file was last modified

    browserCacheSeconds

    Number of seconds for which the file should be cached by the browser

    Definition Classes
    HttpProcessingContext
  38. def setDateHeader (response: HttpResponse): Unit

    Sets the Date header in the HTTP response.

    Sets the Date header in the HTTP response.

    For example:

    Date: Tue, 01 Mar 2011 22:44:26 GMT
    
    response

    HTTP response

    Definition Classes
    HttpProcessingContext
  39. def setKeepAliveHeader (response: HttpResponse): Unit

    Sets the connection header for the HTTP Response

    Sets the connection header for the HTTP Response

    According to HTTP 1.1 specifications: The Connection header field with a keep-alive keyword must be sent on all requests and responses that wish to continue the persistence.

    For example:

    Connection: keep-alive
    
    response

    HTTP response

    Definition Classes
    HttpProcessingContext
  40. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  41. def toString (): String

    Definition Classes
    HttpChunkProcessingContext → AnyRef → Any
  42. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  43. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  44. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  45. def writeErrorResponse (status: HttpResponseStatus, forceCloseChannel: Boolean = false, msg: String = null): Unit

    Sends a HTTP error response to the client.

    Sends a HTTP error response to the client.

    status

    HTTP error status indicating the nature of the error

    forceCloseChannel

    Option flag to force closing channel. Default is false and channel will only be closed if keep-alive header is not set.

    msg

    Optional error message. If not supplied, status description will be used.

    Definition Classes
    HttpProcessingContext
  46. def writeResponse (content: Array[Byte], contentType: String, headers: Map[String, String]): Unit

    Sends a binary HTTP response to the client with a status of "200 OK".

    Sends a binary HTTP response to the client with a status of "200 OK".

    content

    String to send

    contentType

    MIME content type to set in the response header. For example, "image/gif"

    headers

    Additional headers to add to the HTTP response. Defaults to empty map; i.e. no additional headers.

    Definition Classes
    HttpProcessingContext
  47. def writeResponse (content: String, contentType: String = "text/plain; charset=UTF-8", charset: Charset = CharsetUtil.UTF_8, headers: Map[String, String] = Map.empty): Unit

    Sends a string HTTP response to the client with a status of "200 OK".

    Sends a string HTTP response to the client with a status of "200 OK".

    content

    String to send

    contentType

    MIME content type to set in the response header. Defaults to "text/plain; charset=UTF-8".

    charset

    Character set encoding. Defaults to "UTF-8"

    headers

    Additional headers to add to the HTTP response. Defaults to empty map; i.e. no additional headers.

    Definition Classes
    HttpProcessingContext

Deprecated Value Members

  1. def productElements : Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from HttpProcessingContext

Inherited from ProcessingContext

Inherited from AnyRef

Inherited from Any