Object/Trait

com.lightbend.lagom.scaladsl.server

ServerServiceCall

Related Docs: trait ServerServiceCall | package server

Permalink

object ServerServiceCall

Source
ServerServiceCall.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ServerServiceCall
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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 apply[Request, Response](serviceCall: (RequestHeader, Request) ⇒ Future[(ResponseHeader, Response)]): ServerServiceCall[Request, Response]

    Permalink

    A service call that can handle headers.

    A service call that can handle headers.

    This exists as a convenience function for implementing service calls that handle the request and response headers.

  5. def apply[Request, Response](serviceCall: (Request) ⇒ Future[Response]): ServerServiceCall[Request, Response]

    Permalink

    Factory for creating a ServerServiceCall.

    Factory for creating a ServerServiceCall.

    This exists as a convenience function for implementing service calls that need to be composed with other calls that handle headers.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def compose[Request, Response](block: (RequestHeader) ⇒ ServerServiceCall[Request, Response]): ServerServiceCall[Request, Response]

    Permalink

    Compose a server service call.

    Compose a server service call.

    This is useful for implementing service call composition. For example:

    def authenticated[Request, Response]( authenticatedServiceCall: String => ServerServiceCall[Request, Response] ): ServerServiceCall[Request, Response] = {

    ServerServiceCall.compose { requestHeader =>

    // Get the logged in user ID val userId = requestHeader.principal.getOrElse { throw new NotAuthenticated("Not authenticated") }.getName

    // Pass the user id to the composed service call authenticatedServiceCall(userId) } }

    block

    The block that will do the composition.

    returns

    A service call.

  9. def composeAsync[Request, Response](block: (RequestHeader) ⇒ Future[ServerServiceCall[Request, Response]]): ServerServiceCall[Request, Response]

    Permalink

    Compose a header service call asynchronously.

    Compose a header service call asynchronously.

    This is useful for implementing service call composition. For example:

    def authenticated[Request, Response]( authenticatedServiceCall: String => ServerServiceCall[Request, Response] ): ServerServiceCall[Request, Response] = {

    ServerServiceCall.composeAsync { requestHeader =>

    // Get the logged in user ID val userId = requestHeader.principal.getOrElse { throw new NotAuthenticated("Not authenticated") }.getName

    // Load the user from the user service val userFuture: Future[User] = userService.loadUser(userId)

    // Pass the user to the composed service call userFuture.map(user => authenticatedServiceCall(user)) } }

    block

    The block that will do the composition.

    returns

    A service call.

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

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  19. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped