play.core.server.common

ServerResultUtils

Related Doc: package common

object ServerResultUtils

Source
ServerResultUtils.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ServerResultUtils
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait ConnectionHeader extends AnyRef

    The connection header logic to use for the result.

  2. final case class InvalidResult(reason: String, alternativeResult: Result) extends Product with Serializable

    Used to indicate that a result can't be streamed.

    Used to indicate that a result can't be streamed. Offers an alternative result that can be sent instead.

  3. final case class PerformChunkedTransferEncoding(enum: Enumerator[Array[Byte]]) extends ResultStreaming with Product with Serializable

    A stream where the response should be chunk encoded.

    A stream where the response should be chunk encoded. This is usually used for an HTTP 1.1 connection where the response has unknown size.

  4. sealed trait ResultStreaming extends AnyRef

    Indicates the streaming strategy to use for returning the response.

  5. final case class StreamWithClose(enum: Enumerator[Array[Byte]]) extends ResultStreaming with Product with Serializable

    Used for responses that have unknown length and should be delimited by the connection closing.

    Used for responses that have unknown length and should be delimited by the connection closing. This is used for all HTTP 1.0 responses with unknown length, since HTTP 1.0 doesn't support chunked encoding. It can also be used for some HTTP 1.1 responses, if chunked encoding isn't desired for some reason, e.g. see the Results.feed method.

  6. final case class StreamWithKnownLength(enum: Enumerator[Array[Byte]]) extends ResultStreaming with Product with Serializable

    A stream with a known length where the Content-Length header can be set.

  7. final case class StreamWithStrictBody(body: Array[Byte]) extends ResultStreaming with Product with Serializable

    A stream with bytes that are already entirely known.

    A stream with bytes that are already entirely known. The Content-Length can be sent and an efficient streaming strategy can be used by the server.

  8. final case class UseExistingTransferEncoding(transferEncodedEnum: Enumerator[Array[Byte]]) extends ResultStreaming with Product with Serializable

    A stream where the response has already been encoded by the user, e.g.

    A stream where the response has already been encoded by the user, e.g. using Results.chunked. The server may be able to feed this encoded data directly - or it may need to reverse the encoding before resending it. :(

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. object DefaultClose extends ConnectionHeader with Product with Serializable

    No Connection header should be sent.

    No Connection header should be sent. Used on an HTTP 1.0 connection where the default behavior is to close the connection.

  5. object DefaultKeepAlive extends ConnectionHeader with Product with Serializable

    No Connection header should be sent.

    No Connection header should be sent. Used on an HTTP 1.1 connection where the default behavior is to keep the connection open.

  6. object SendClose extends ConnectionHeader with Product with Serializable

    A Connection: close header should be sent.

    A Connection: close header should be sent. Used to force an HTTP 1.1 connection to close.

  7. object SendKeepAlive extends ConnectionHeader with Product with Serializable

    A Connection: keep-alive header should be sent.

    A Connection: keep-alive header should be sent. Used to force an HTTP 1.0 connection to remain open.

  8. object StreamWithNoBody extends ResultStreaming with Product with Serializable

    Used for responses that may not contain a body, e.g.

    Used for responses that may not contain a body, e.g. 204 or 304 responses. The server shouldn't send a body and, since the response cannot have a body, the Content-Length header shouldn't be sent either.

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def cleanFlashCookie(requestHeader: RequestHeader, result: Result): Result

    Update the result's Set-Cookie header so that it removes any Flash cookies we received in the incoming request.

  11. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def determineResultStreaming(requestHeader: RequestHeader, result: Result): Future[Either[InvalidResult, (ResultStreaming, ConnectionHeader)]]

    Analyze the Result and determine how best to send it.

    Analyze the Result and determine how best to send it. This may involve looking at headers, buffering the enumerator, etc. The returned value will indicate how to stream the result and will provide an Enumerator or Array with the result body that should be streamed.

    CannotStream will be returned if the Result cannot be streamed to the given client. This can happen if a result requires Transfer-Encoding but the client uses HTTP 1.0. It can also happen if there is an error in the Result headers.

    The ConnectionHeader returned for a successful result will indicate how the header should be set in the response header.

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

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

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

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

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

    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  22. def readAheadOne[A](enum: Enumerator[A]): Future[Either[Option[A], Enumerator[A]]]

    Start reading an Enumerator and see if it is only zero or one elements long.

    Start reading an Enumerator and see if it is only zero or one elements long. - If zero-length, return Left(None). - If one-length, return the element in Left(Some(el)) - If more than one element long, return Right(enumerator) where enumerator is an Enumerator that contains *all* the input. Any already-read elements will still be included in this Enumerator.

  23. def splitSetCookieHeaders(headers: Map[String, String]): Iterable[(String, String)]

    Given a map of headers, split it into a sequence of individual headers.

    Given a map of headers, split it into a sequence of individual headers. Most headers map into a single pair in the new sequence. The exception is the Set-Cookie header which we split into a pair for each cookie it contains. This allows us to work around issues with clients that can't handle combined headers. (Also RFC6265 says multiple headers shouldn't be folded together, which Play's API unfortunately does.)

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

    Definition Classes
    AnyRef
  25. def toString(): String

    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped