trait RequestHandlerBuilder[E <: Env, +R[_]] extends ExecutionContextProvider
Base implementation for building request handlers.
The base implementations to handle secured endpoints are encapsulated into request handlers which can execute an arbitrary block of code and must return a HandlerResult. This HandlerResult consists of a normal Play result and arbitrary additional data which can be transported out of these handlers.
- E
The type of the environment.
- R
The type of the request.
- Alphabetic
- By Inheritance
- RequestHandlerBuilder
- ExecutionContextProvider
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
implicit
class
ExtractEither[T] extends AnyRef
Provides an
extractmethod on anEitherwhich contains the same types.Provides an
extractmethod on anEitherwhich contains the same types.- Attributes
- protected
Abstract Value Members
-
abstract
val
environment: Environment[E]
The environment instance to handle the request.
-
abstract
def
invokeBlock[B, T](block: (R[B]) ⇒ Future[HandlerResult[T]])(implicit request: Request[B]): Future[HandlerResult[T]]
Invoke the block.
Invoke the block.
This is the main method that an request handler has to implement.
- B
The type of the request body.
- T
The type of the data included in the handler result.
- block
The block of code to invoke.
- request
The current request.
- returns
A handler result.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
apply[B, T](request: Request[B])(block: (R[B]) ⇒ Future[HandlerResult[T]]): Future[HandlerResult[T]]
Constructs a request handler with the content of the given request.
Constructs a request handler with the content of the given request.
- B
The type of the request body.
- T
The type of the data included in the handler result.
- request
The current request.
- block
The block of code to invoke.
- returns
A handler result.
-
final
def
apply[T](block: (R[AnyContent]) ⇒ Future[HandlerResult[T]])(implicit request: Request[AnyContent]): Future[HandlerResult[T]]
Constructs a request handler with default content.
Constructs a request handler with default content.
- T
The type of the data included in the handler result.
- block
The block of code to invoke.
- request
The current request.
- returns
A handler result.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
implicit
lazy val
executionContext: ExecutionContext
The execution context to handle the asynchronous operations.
The execution context to handle the asynchronous operations.
- Definition Classes
- RequestHandlerBuilder → ExecutionContextProvider
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
handleAuthentication[B](implicit request: Request[B]): Future[(Option[Either[E.A, E.A]], Option[E.I])]
Handles the authentication of an identity.
Handles the authentication of an identity.
As first it checks for authenticators in requests, then it tries to authenticate against a request provider. This method marks the returned authenticators by returning already initialized authenticators on the left and new authenticators on the right. All new authenticators must be initialized later in the flow, with the result returned from the invoked block.
- B
The type of the request body.
- request
The current request.
- returns
A tuple which consists of (maybe the existing authenticator on the left or a new authenticator on the right -> maybe the identity).
- Attributes
- protected
-
def
handleBlock[T](authenticator: Either[E.A, E.A], block: (E.A) ⇒ Future[HandlerResult[T]])(implicit request: RequestHeader): Future[HandlerResult[T]]
Handles a block for an authenticator.
Handles a block for an authenticator.
Invokes the block with the authenticator and handles the result. See
handleInitializedAuthenticatorandhandleUninitializedAuthenticatormethods too see how the different authenticator types will be handled.- T
The type of the data included in the handler result.
- authenticator
An already initialized authenticator on the left and a new authenticator on the right.
- block
The block to handle with the authenticator.
- request
The current request header.
- returns
A handler result.
- Attributes
- protected
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()