Package

com.lightbend.lagom.scaladsl.api

transport

Permalink

package transport

Visibility
  1. Public
  2. All

Type Members

  1. final class BadRequest extends TransportException

    Permalink
  2. final class DeserializationException extends TransportException

    Permalink
  3. final class ExceptionMessage extends Serializable

    Permalink

    A high level exception message.

    A high level exception message.

    This is used by the default exception serializer to serialize exceptions into messages.

  4. final class Forbidden extends TransportException

    Permalink
  5. trait HeaderFilter extends AnyRef

    Permalink

    Filter for headers.

    Filter for headers.

    This is used to transform transport and protocol headers according to various strategies for protocol and version negotiation, as well as authentication.

  6. sealed trait MessageHeader extends AnyRef

    Permalink

    A message header.

  7. sealed trait MessageProtocol extends AnyRef

    Permalink

    A message protocol.

    A message protocol.

    This describes the negotiated protocol being used for a message. It has three elements, a content type, a charset, and a version.

    The contentType may be registered mime type such as application/json, or it could be an application specific content type, such as application/vnd.myservice+json. It could also contain protocol versioning information, such as application/vnd.github.v3+json. During the protocol negotiation process, the content type may be transformed, for example, if the content type contains a version, the configured HeaderFilter will be expected to extract that version out into the version, leaving a contentType that will be understood by the message serializer.

    The charset applies to text messages, if the message is not in a text format, then no charset should be specified. This is not only used in setting of content negotiation headers, it's also used as a hint to the framework of when it can treat a message as text. For example, if the charset is set, then when a message gets sent via WebSockets, it will be sent as a text message, otherwise it will be sent as a binary message.

    The version is used to describe the version of the protocol being used. Lagom does not, out of the box, prescribe any semantics around the version, from Lagom's perspective, two message protocols with different versions are two different protocols. The version is however treated as a separate piece of information so that generic parsers, such as json/xml, can make sensible use of the content type passed to them. The version could come from a media type header, but it does not necessarily have to come from there, it could come from the URI or any other header.

    MessageProtocol instances can also be used in content negotiation, an empty value means that any value is accepted.

  8. final class Method extends AnyVal

    Permalink
  9. final class NotAcceptable extends TransportException

    Permalink
  10. final class NotFound extends TransportException

    Permalink
  11. final class PayloadTooLarge extends TransportException

    Permalink
  12. final class PolicyViolation extends TransportException

    Permalink
  13. sealed trait RequestHeader extends MessageHeader

    Permalink

    A request header.

    A request header.

    This header may or may not be mapped down onto HTTP. In order to remain agnostic to the underlying protocol, information required by Lagom, such as protocol information, is extracted. It is encouraged that the protocol information always be used in preference to reading the information directly out of headers, since the headers may not contain the necessary protocol information.

    The headers are however still provided, in case information needs to be extracted out of non standard headers.

  14. sealed trait ResponseHeader extends MessageHeader

    Permalink

    This header may or may not be mapped down onto HTTP.

    This header may or may not be mapped down onto HTTP. In order to remain agnostic to the underlying protocol, information required by Lagom, such as protocol information, is extracted. It is encouraged that the protocol information always be used in preference to reading the information directly out of headers, since the headers may not contain the necessary protocol information.

    The headers are however still provided, in case information needs to be extracted out of non standard headers.

  15. final class SerializationException extends TransportException

    Permalink
  16. sealed trait TransportErrorCode extends Serializable

    Permalink

    An error code that gets translated into an appropriate underlying error code.

    An error code that gets translated into an appropriate underlying error code.

    This attempts to match up corresponding HTTP error codes with WebSocket close codes, so that user code can generically select a code without worrying about the underlying transport.

    While most WebSocket close codes that we typically use do have a corresponding HTTP error code, there are many HTTP error codes that don't have a corresponding WebSocket close code. In these cases, we use the private WebSocket close code range (4xxx), with the HTTP error code as the last three digits. Such WebSocket close codes will be in the range 4400 to 4599.

    This class should only be used to represent error codes, status codes like HTTP 200 should not be represented using this class. This is enforced for HTTP codes, since they have a well defined categorisation, codes between 400 and 599 are considered errors. It is however not enforced for WebSockets, since the WebSocket protocol defines no such categorisation of codes, it specifies a number of well known codes from 1000 to 1015, with no particular pattern to their meaning, and the remaining codes are only categorised by whether they are private, reserved for the WebSocket spec, or reserved for applications to specify.

    For WebSocket close codes that are not known, or are not in the private range of 4400 to 4599 defined by us, this use class uses the generic HTTP 404 error code.

  17. class TransportException extends RuntimeException

    Permalink

    An exception that can be translated down to a specific error in the transport.

    An exception that can be translated down to a specific error in the transport.

    Transport exceptions describe the HTTP/WebSocket error code associated with them, allowing Lagom to send an error code specific to the type of error. They also have an exception message, which is used both to capture exception details, as well as to identify the exception, so that the right type of exception can be deserialized at the other end.

  18. final class UnsupportedMediaType extends TransportException

    Permalink

Value Members

  1. object BadRequest extends Serializable

    Permalink
  2. object DeserializationException extends Serializable

    Permalink
  3. object Forbidden extends Serializable

    Permalink
  4. object HeaderFilter

    Permalink
  5. object MessageProtocol

    Permalink
  6. object Method

    Permalink
  7. object NotAcceptable extends Serializable

    Permalink
  8. object NotFound extends Serializable

    Permalink
  9. object PayloadTooLarge extends Serializable

    Permalink
  10. object PolicyViolation extends Serializable

    Permalink
  11. object RequestHeader

    Permalink
  12. object ResponseHeader

    Permalink
  13. object SerializationException extends Serializable

    Permalink
  14. object TransportErrorCode extends Serializable

    Permalink
  15. object TransportException extends Serializable

    Permalink
  16. object UnsupportedMediaType extends Serializable

    Permalink
  17. object UserAgentHeaderFilter extends HeaderFilter

    Permalink

    Transfers service principal information via the User-Agent header.

    Transfers service principal information via the User-Agent header.

    If using this on a service that serves requests from the outside world, it would be a good idea to block the User-Agent header in the web facing load balancer/proxy.

Ungrouped