Class/Object

com.twitter.finagle.http

Message

Related Docs: object Message | package http

Permalink

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
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Message
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Message()

    Permalink

Abstract Value Members

  1. abstract def httpMessage: HttpMessage

    Permalink
    Attributes
    protected
  2. abstract def isRequest: Boolean

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def accept: Seq[String]

    Permalink

    Accept header

  5. def acceptMediaTypes: Seq[String]

    Permalink

    Accept header media types (normalized, no parameters)

  6. def accept_=(values: Iterable[String]): Unit

    Permalink

    Set Accept header with list of values

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

    Permalink

    Set Accept header

  8. def addCookie(cookie: Cookie): Unit

    Permalink

    Add a cookie

  9. def allow: Option[String]

    Permalink

    Allow header

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

    Permalink

    Set Authorization header

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

    Permalink

    Set Authorization header

  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. def authorization: Option[String]

    Permalink

    Get Authorization header

  14. def authorization_=(value: String): Unit

    Permalink

    Set Authorization header

  15. def cacheControl: Option[String]

    Permalink

    Get Cache-Control header

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

    Permalink

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

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

    Permalink

    Set Cache-Control header

  18. def charset: Option[String]

    Permalink

    Get charset from Content-Type header

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

    Permalink

    Set charset in Content-Type header.

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

  20. def clearContent(): Unit

    Permalink

    Clear content (set to "").

  21. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. def close(): Future[Unit]

    Permalink

    End the response stream.

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

    Permalink

    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( ... )
    See also

    content_=(Buf) for Scala users

  24. def content: Buf

    Permalink

    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.

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

    Permalink

    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.

  26. def contentLength: Option[Long]

    Permalink

    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.

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

    Permalink

    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.

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

    Permalink

    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.

  29. def contentString: String

    Permalink

    Get the content as a string.

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

    Permalink

    Set the content as a string.

  31. def contentType: Option[String]

    Permalink

    Get Content-Type header

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

    Permalink

    Set Content-Type header

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

    Permalink

    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( ... )
    See also

    content(Buf) for Java users

  34. lazy val cookies: CookieMap

    Permalink

    Cookies.

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

  35. def date: Option[String]

    Permalink

    Get Date header

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

    Permalink

    Set Date header by Date

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

    Permalink

    Set Date header

  38. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  39. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  40. def expires: Option[String]

    Permalink

    Get Expires header

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

    Permalink

    Set Expires header by Date

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

    Permalink

    Set Expires header

  43. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  44. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  45. def getContentString(): String

    Permalink
  46. def getCookies(): Iterator[Cookie]

    Permalink

    Get iterator over Cookies

  47. def getInputStream(): InputStream

    Permalink

    Get InputStream for content.

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

  48. final def getLength(): Int

    Permalink

    Get length of content.

  49. def getReader(): Reader

    Permalink

    Get Reader for content.

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

  50. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  51. lazy val headerMap: HeaderMap

    Permalink
  52. def host: Option[String]

    Permalink

    Get Host header

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

    Permalink

    Set Host header

  54. def isChunked: Boolean

    Permalink
  55. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  56. def isResponse: Boolean

    Permalink
  57. def isXmlHttpRequest: Boolean

    Permalink

    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.)

  58. def lastModified: Option[String]

    Permalink

    Get Last-Modified header

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

    Permalink

    Set Last-Modified header by Date

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

    Permalink

    Set Last-Modified header

  61. def length: Int

    Permalink

    Get length of content.

  62. def location: Option[String]

    Permalink

    Get Location header

  63. def location_=(value: String): Unit

    Permalink

    Set Location header

  64. def mediaType: Option[String]

    Permalink

    Get media-type from Content-Type header

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

    Permalink

    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.

  66. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  67. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  68. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  69. def reader: Reader

    Permalink

    A read-only handle to the internal stream of bytes, representing the message body.

    A read-only handle to the internal stream of bytes, representing the message body. See com.twitter.io.Reader for more information.

  70. def referer: Option[String]

    Permalink

    Get Referer [sic] header

  71. def referer_=(value: String): Unit

    Permalink

    Set Referer [sic] header

  72. def removeCookie(name: String): Unit

    Permalink

    Remove a cookie

  73. def retryAfter: Option[String]

    Permalink

    Get Retry-After header

  74. def retryAfter_=(value: Long): Unit

    Permalink

    Set Retry-After header by seconds

  75. def retryAfter_=(value: String): Unit

    Permalink

    Set Retry-After header

  76. def server: Option[String]

    Permalink

    Get Server header

  77. def server_=(value: String): Unit

    Permalink

    Set Server header

  78. def setChunked(chunked: Boolean): Unit

    Permalink

    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.

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

    Permalink

    Set the content as a string.

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

    Permalink

    Set Content-Type header by media-type and charset

  81. def setContentTypeJson(): Unit

    Permalink

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

  82. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  83. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  84. def userAgent: Option[String]

    Permalink

    Get User-Agent header

  85. def userAgent_=(value: String): Unit

    Permalink

    Set User-Agent header

  86. final def version(version: Version): Message.this.type

    Permalink

    Set the HTTP version

    Set the HTTP version

    * @see version_=(Version) for Scala users

  87. def version: Version

    Permalink

    Get the HTTP version

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

    Permalink

    Set the HTTP version

    Set the HTTP version

    See also

    version(Version) for Java users

  89. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  92. def withInputStream[T](f: (InputStream) ⇒ T): T

    Permalink

    Use content as InputStream.

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

  93. def withOutputStream[T](f: (OutputStream) ⇒ T): T

    Permalink

    Append content via an OutputStream.

    Append content via an OutputStream.

    An IllegalStateException is thrown if this message is chunked.

    Annotations
    @throws( classOf[IllegalStateException] )
  94. def withReader[T](f: (Reader) ⇒ T): T

    Permalink

    Use content as Reader.

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

  95. def withWriter[T](f: (Writer) ⇒ T): T

    Permalink

    Append content via a Writer.

    Append content via a Writer.

    An IllegalStateException is thrown if this message is chunked.

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

    Permalink

    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] )
  97. def write(buf: Buf): Unit

    Permalink

    Append a Buf to content.

    Append a Buf to content.

    An IllegalStateException is thrown if this message is chunked.

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

    Permalink

    Append string to content.

    Append string to content.

    An IllegalStateException is thrown if this message is chunked.

    Annotations
    @throws( classOf[IllegalStateException] )
  99. def writer: Writer with Closable

    Permalink

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

    A write-only handle to the internal stream of bytes, representing the message body. See com.twitter.io.Writer for more information.

  100. def wwwAuthenticate: Option[String]

    Permalink

    Get WWW-Authenticate header

  101. def wwwAuthenticate_=(value: String): Unit

    Permalink

    Set WWW-Authenticate header

  102. def xForwardedFor: Option[String]

    Permalink

    Get X-Forwarded-For header

  103. def xForwardedFor_=(value: String): Unit

    Permalink

    Set X-Forwarded-For header

Inherited from AnyRef

Inherited from Any

Ungrouped