UnsecuredActionBuilder

play.silhouette.api.actions.UnsecuredActionBuilder
final case class UnsecuredActionBuilder[E <: Env, P](requestHandler: UnsecuredRequestHandlerBuilder[E], parser: BodyParser[P]) extends ActionBuilder[Request, P]

Action builder implementation to provide the foundation for unsecured actions.

Type parameters

E

The type of the environment.

P

The type of the request body.

Value parameters

parser

The body parser.

requestHandler

The request handler instance.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait ActionBuilder[Request, P]
trait ActionFunction[Request, Request]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Creates a unsecured action builder with a new error handler in place.

Creates a unsecured action builder with a new error handler in place.

Value parameters

errorHandler

An error handler instance.

Attributes

Returns

A unsecured action builder.

override def invokeBlock[B](request: Request[B], block: Request[B] => Future[Result]): Future[Result]

Invokes the block.

Invokes the block.

Type parameters

B

The type of the request body.

Value parameters

block

The block of code to invoke.

request

The current request.

Attributes

Returns

A handler result.

Definition Classes
ActionFunction

Inherited methods

override def andThen[Q[_]](other: ActionFunction[Request, Q]): ActionBuilder[Q, B]

Compose this ActionFunction with another, with this one applied first.

Compose this ActionFunction with another, with this one applied first.

Value parameters

other

ActionFunction with which to compose

Attributes

Returns

The new ActionFunction

Definition Classes
ActionBuilder -> ActionFunction
Inherited from:
ActionBuilder
final def apply(block: => Result): Action[AnyContent]

Constructs an Action with default content, and no request parameter.

Constructs an Action with default content, and no request parameter.

For example:

val hello = Action {
 Ok("Hello!")
}

Value parameters

block

the action code

Attributes

Returns

an action

Inherited from:
ActionBuilder
final def apply(block: Request[P] => Result): Action[B]

Constructs an Action with default content.

Constructs an Action with default content.

For example:

val echo = Action { request =>
 Ok("Got request [" + request + "]")
}

Value parameters

block

the action code

Attributes

Returns

an action

Inherited from:
ActionBuilder
final def apply[A](bodyParser: BodyParser[A]): ActionBuilder[R, A]

Constructs an ActionBuilder with the given BodyParser. The result can then be applied directly to a block.

Constructs an ActionBuilder with the given BodyParser. The result can then be applied directly to a block.

For example:

val echo = Action(parse.anyContent) { request =>
 Ok("Got request [" + request + "]")
}

Type parameters

A

the type of the request body

Value parameters

bodyParser

the BodyParser to use to parse the request body

Attributes

Returns

an action

Inherited from:
ActionBuilder
final def async[A](bodyParser: BodyParser[A])(block: Request[A] => Future[Result]): Action[A]

Constructs an Action with the given BodyParser that returns a future of a result.

Constructs an Action with the given BodyParser that returns a future of a result.

For example:

val hello = Action.async(parse.anyContent) { request =>
 ws.url(request.getQueryString("url").get).get().map { r =>
   if (r.status == 200) Ok("The website is up") else NotFound("The website is down")
 }
}

Value parameters

block

the action code

Attributes

Returns

an action

Inherited from:
ActionBuilder
final def async(block: Request[P] => Future[Result]): Action[B]

Constructs an Action that returns a future of a result, with default content.

Constructs an Action that returns a future of a result, with default content.

For example:

val hello = Action.async { request =>
 ws.url(request.getQueryString("url").get).get().map { r =>
   if (r.status == 200) Ok("The website is up") else NotFound("The website is down")
 }
}

Value parameters

block

the action code

Attributes

Returns

an action

Inherited from:
ActionBuilder
final def async(block: => Future[Result]): Action[AnyContent]

Constructs an Action that returns a future of a result, with default content, and no request parameter.

Constructs an Action that returns a future of a result, with default content, and no request parameter.

For example:

val hello = Action.async {
 ws.url("http://www.playframework.com").get().map { r =>
   if (r.status == 200) Ok("The website is up") else NotFound("The website is down")
 }
}

Value parameters

block

the action code

Attributes

Returns

an action

Inherited from:
ActionBuilder
def compose[B](other: ActionBuilder[Request, B]): ActionBuilder[P, B]

Attributes

Inherited from:
ActionFunction
def compose[Q[_]](other: ActionFunction[Q, Request]): ActionFunction[Q, P]

Compose another ActionFunction with this one, with this one applied last.

Compose another ActionFunction with this one, with this one applied last.

Value parameters

other

ActionFunction with which to compose

Attributes

Returns

The new ActionFunction

Inherited from:
ActionFunction
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product