Packages

abstract class Message extends AnyRef

Rich Message

Base class for Request and Response. There are both input and output methods, though only one set of methods should be used.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Message
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Message()

Abstract Value Members

  1. abstract def chunkReader: Reader[Chunk]

    A read-only handle to a stream of Chunk, representing the message body.

    A read-only handle to a stream of Chunk, representing the message body. This stream is only populated on chunked messages (isChunked == true). Use content to access a payload of a fully-buffered message (isChunked == false).

    Prefer this API over reader when application needs to receive trailing headers (trailers). Trailers are transmitted in the very last chunk (chunk.isLast == true) of the stream and can be retrieved via Chunk.trailers.

    See also

    Reader and Chunk

  2. abstract def chunkWriter: Writer[Chunk]

    A write-only handle to a stream of Chunk, representing the message body.

    A write-only handle to a stream of Chunk, representing the message body. Only chunked messages (isChunked == true) use this stream as their payload, fully-buffered messages (isChunked == false) use content instead.

    Prefer this API over writer when application needs to send trailing headers (trailers). Trailers are transmitted in the very last chunk of the stream and can be populated via Chunk.last factory method.

    See also

    Reader and Chunk

  3. abstract def headerMap: HeaderMap

    HTTP headers associated with this message.

    HTTP headers associated with this message.

    Note

    HeaderMap isn't thread-safe. Any concurrent access should be synchronized externally.

  4. abstract def isRequest: Boolean
  5. abstract def trailers: HeaderMap

    Trailing headers (trailers) associated with this message.

    Trailing headers (trailers) associated with this message.

    These are only populated on fully-buffered inbound messages that were aggregated (see withStreaming(false)) from HTTP streams terminating with trailers.

    Note

    HeaderMap isn't thread-safe. Any concurrent access should be synchronized externally.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addCookie(cookie: Cookie): Unit

    Add a cookie

  5. def allow: Option[String]

    Allow header

  6. def allow_=(values: Iterable[Method]): Unit

    Set Allow header

  7. def allow_=(value: String): Unit

    Set Allow header

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def cacheControl: Option[String]

    Get Cache-Control header

  10. def cacheControl_=(maxAge: Duration): Unit

    Set Cache-Control header with a max-age (and must-revalidate).

  11. def cacheControl_=(value: String): Unit

    Set Cache-Control header

  12. def charset: Option[String]

    Get charset from Content-Type header

  13. def charset_=(value: String): Unit

    Set charset in Content-Type header.

    Set charset in Content-Type header. This does not change the content.

  14. final def clearContent(): Unit

    Clear content (set to "").

  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  16. def close(): Future[Unit]

    End the response stream.

  17. final def content(content: Buf): Message.this.type

    Set the content of this Message.

    Set the content of this Message.

    Any existing content is discarded. If this Message is set to chunked, an IllegalStateException is thrown.

    Annotations
    @throws(scala.this.throws.<init>$default$1[IllegalStateException])
    See also

    content_=(Buf) for Scala users

  18. def content: Buf

    Retrieve the current content of this Message.

    Retrieve the current content of this Message.

    If this message is chunked, the resulting Buf will always be empty.

  19. final def contentLength(value: Long): Message.this.type

    Set Content-Length header.

    Set Content-Length header. Normally, this is automatically set by the Codec, but this method allows you to override that.

    See also

    contentLength_=(Long) for Scala users.

  20. def contentLength: Option[Long]

    Get the value of the Content-Length header.

    Get the value of the Content-Length header. Use length to get the length of actual content.

    See also

    Long for Java users.

  21. final def contentLengthOrElse(default: Long): Long

    Get the value of the Content-Length header, or the provided default if it doesn't exist.

    Get the value of the Content-Length header, or the provided default if it doesn't exist.

    See also

    Option(Long) for Scala users.

  22. def contentLength_=(value: Long): Unit

    Set Content-Length header.

    Set Content-Length header. Normally, this is automatically set by the Codec, but this method allows you to override that.

    See also

    contentLength(Long) for Java users.

  23. def contentString: String

    Get the content as a string.

  24. def contentString_=(value: String): Unit

    Set the content as a string.

  25. def contentType: Option[String]

    Get Content-Type header

  26. def contentType_=(value: String): Unit

    Set Content-Type header

  27. def content_=(content: Buf): Unit

    Set the content of this Message.

    Set the content of this Message.

    Any existing content is discarded. If this Message is set to chunked, an IllegalStateException is thrown.

    Annotations
    @throws(scala.this.throws.<init>$default$1[IllegalStateException])
    See also

    content(Buf) for Java users

  28. lazy val cookies: CookieMap

    Cookies.

    Cookies. In a request, this uses the Cookie headers. In a response, it uses the Set-Cookie headers.

  29. def date: Option[String]

    Get Date header

  30. def date_=(value: Date): Unit

    Set Date header by Date

  31. def date_=(value: String): Unit

    Set Date header

  32. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  34. def expires: Option[String]

    Get Expires header

  35. def expires_=(value: Date): Unit

    Set Expires header by Date

  36. def expires_=(value: String): Unit

    Set Expires header

  37. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  38. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  39. def getContentString(): String
  40. def getCookies(): Iterator[Cookie]

    Get iterator over Cookies

  41. final def getInputStream(): InputStream

    Get InputStream for content.

    Get InputStream for content. Caller must close. (Java interface. Scala users should use withInputStream.)

  42. final def getLength(): Int

    Get length of content.

  43. final def getReader(): Reader

    Get Reader for content.

    Get Reader for content. (Java interface. Scala users should use withReader.)

  44. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  45. def isChunked: Boolean
  46. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  47. def isResponse: Boolean
  48. def isXmlHttpRequest: Boolean

    Check if X-Requested-With contains XMLHttpRequest, usually signalling a request from a JavaScript AJAX libraries.

    Check if X-Requested-With contains XMLHttpRequest, usually signalling a request from a JavaScript AJAX libraries. Some servers treat these requests specially. For example, an endpoint might render JSON or XML instead HTML if it's an XmlHttpRequest. (Tip: don't do this - it's gross.)

  49. final def keepAlive: Boolean
  50. final def keepAlive(keepAlive: Boolean): Message.this.type
  51. def lastModified: Option[String]

    Get Last-Modified header

  52. def lastModified_=(value: Date): Unit

    Set Last-Modified header by Date

  53. def lastModified_=(value: String): Unit

    Set Last-Modified header

  54. final def length: Int

    Get length of content.

  55. def mediaType: Option[String]

    Get media-type from Content-Type header

  56. def mediaType_=(value: String): Unit

    Set media-type in Content-Type header.

    Set media-type in Content-Type header. Charset and parameter values are preserved, though may not be appropriate for the new media type.

  57. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  58. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  59. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  60. final lazy val reader: Reader[Buf]

    A read-only handle to a stream of Buf, representing the message body.

    A read-only handle to a stream of Buf, representing the message body. This stream is only * populated on chunked messages (isChunked == true). Use content to access a payload of a fully-buffered message (isChunked == false).

    Prefer this API over chunkReader when application doesn't need access to trailing headers (trailers).

    See also

    Reader

  61. def removeCookie(name: String): Unit

    Remove a cookie

  62. def setChunked(chunked: Boolean): Unit

    Manipulate the Message content mode.

    Manipulate the Message content mode.

    If chunked is true, any existing content will be discarded and further attempts to manipulate the synchronous content will result in an IllegalStateException.

    If chunked is false, the synchronous content methods will become available and the Reader/Writer of the message will be ignored by Finagle.

  63. final def setContentString(value: String): Unit

    Set the content as a string.

  64. def setContentType(mediaType: String, charset: String = "utf-8"): Unit

    Set Content-Type header by media-type and charset

  65. def setContentTypeJson(): Unit

    Set Content-Type header to application/json;charset=utf-8

  66. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  67. def toString(): String
    Definition Classes
    AnyRef → Any
  68. final def version(version: Version): Message.this.type

    Set the HTTP version

    Set the HTTP version

    * @see version_=(Version) for Scala users

  69. def version: Version

    Get the HTTP version

  70. def version_=(version: Version): Unit

    Set the HTTP version

    Set the HTTP version

    See also

    version(Version) for Java users

  71. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  72. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  73. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  74. def withInputStream[T](f: (InputStream) => T): T

    Use content as InputStream.

    Use content as InputStream. The underlying channel buffer's reader index is advanced. (Scala interface. Java users can use getInputStream().)

  75. final def withOutputStream[T](f: (OutputStream) => T): T

    Append content via an OutputStream.

    Append content via an OutputStream.

    An IllegalStateException is thrown if this message is chunked.

    Annotations
    @throws(classOf[IllegalStateException])
  76. final def withReader[T](f: (Reader) => T): T

    Use content as Reader.

    Use content as Reader. (Scala interface. Java users can use getReader().)

  77. final def withWriter[T](f: (Writer) => T): T

    Append content via a Writer.

    Append content via a Writer.

    An IllegalStateException is thrown if this message is chunked.

    Annotations
    @throws(classOf[IllegalStateException])
  78. final def write(bytes: Array[Byte]): Unit

    Append bytes to content.

    Append bytes to content.

    This method makes a defensive copy of the provided byte array. This can be avoided by wrapping the byte array via Buf.ByteArray.Owned and using the write(Buf) method.

    An IllegalStateException is thrown if this message is chunked.

    Annotations
    @throws(classOf[IllegalStateException])
  79. final def write(buf: Buf): Unit

    Append a Buf to content.

    Append a Buf to content.

    An IllegalStateException is thrown if this message is chunked.

    Annotations
    @throws(classOf[IllegalStateException])
  80. final def write(string: String): Unit

    Append string to content.

    Append string to content.

    An IllegalStateException is thrown if this message is chunked.

    Annotations
    @throws(classOf[IllegalStateException])
  81. final lazy val writer: Writer[Buf]

    A write-only handle to the stream of Buf, representing the message body.

    A write-only handle to the stream of Buf, representing the message body. Only chunked messages (isChunked == true) use this stream as their payload, fully-buffered messages (isChunked == false) use content instead.

    Prefer this API over chunkWriter when application doesn't need to send trailing headers (trailers).

    See also

    Writer

Inherited from AnyRef

Inherited from Any

Ungrouped