uk.gov.hmrc.play.fsm

# JourneyController

###
Related Doc: package fsm

#### trait JourneyController extends HeaderCarrierProvider

Base controller for journeys based on Finite State Machine.

Provides 2 extension points:

- getCallFor: what is the endpoint representing given state
- renderState: how to render given state

and few action creation helpers:

- action
- authorised
- authorisedWithForm
- authorisedWithBootstrapAndForm
- authorisedShowCurrentStateWhen

Linear Supertypes
HeaderCarrierProvider, AnyRef, Any
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. JourneyController
2. HeaderCarrierProvider
3. AnyRef
4. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Type Members

1. #### type ExpectedStates = PartialFunction[State, Unit]

2. #### type Route = (Request[_]) ⇒ Result

3. #### type RouteFactory = (StateAndBreadcrumbs) ⇒ Route

4. #### type WithAuthorised[User] = (Request[_]) ⇒ ((User) ⇒ Future[Result]) ⇒ Future[Result]

### Abstract Value Members

1. #### abstract def getCallFor(state: State)(implicit request: Request[_]): Call

   implement this to map states into endpoints for redirection and back linking

2. #### abstract def hc(implicit rh: RequestHeader): HeaderCarrier

   Definition Classes
     HeaderCarrierProvider

3. #### abstract val journeyService: JourneyService

   This has to be injected in the concrete controller

4. #### abstract def renderState(state: State, breadcrumbs: List[State], formWithErrors: Option[Form[_]])(implicit request: Request[_]): Result

   implement this to render state after transition or when form validation fails

5. #### abstract val root: Call

   root call of this journey, used as fallback for back links

### Concrete 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. #### final def action(body: (Request[_]) ⇒ Future[Result]): Action[AnyContent]

   Attributes
     protected

5. #### def apply(transition: Transition, routeFactory: RouteFactory)(implicit hc: HeaderCarrier, request: Request[_], ec: ExecutionContext): Future[Result]

   applies transition to the current state

6. #### final def asInstanceOf[T0]: T0

   Definition Classes
     Any

7. #### final def authorised[User](withAuthorised: WithAuthorised[User])(transition: (User) ⇒ Transition)(routeFactory: RouteFactory)(implicit hc: HeaderCarrier, request: Request[_], ec: ExecutionContext): Future[Result]

   Attributes
     protected

8. #### final def authorisedWithBootstrapAndForm[User, Payload, T](bootstrap: Transition)(withAuthorised: WithAuthorised[User])(form: Form[Payload])(transition: (User) ⇒ (Payload) ⇒ Transition)(implicit hc: HeaderCarrier, request: Request[_], ec: ExecutionContext): Future[Result]

   Attributes
     protected

9. #### final def authorisedWithForm[User, Payload](withAuthorised: WithAuthorised[User])(form: Form[Payload])(transition: (User) ⇒ (Payload) ⇒ Transition)(implicit hc: HeaderCarrier, request: Request[_], ec: ExecutionContext): Future[Result]

   Attributes
     protected

10. #### def backLinkFor(breadcrumbs: List[State])(implicit request: Request[_]): Call

    Attributes
      protected

11. #### def clone(): AnyRef

    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

12. #### final val display: RouteFactory

    displays template for the state and breadcrumbs

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. #### final val redirect: RouteFactory

    redirects to the endpoint matching state

23. #### final def showCurrentStateWhen(expectedStates: ExpectedStates)(implicit ec: ExecutionContext): Action[AnyContent]

    Attributes
      protected

24. #### final def showCurrentStateWhenAuthorised[User](withAuthorised: WithAuthorised[User])(expectedStates: ExpectedStates)(implicit ec: ExecutionContext): Action[AnyContent]

    Attributes
      protected

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

    Definition Classes
      AnyRef

26. #### def toString(): String

    Definition Classes
      AnyRef → Any

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( ... )

29. #### final def wait(): Unit

    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

### Inherited from HeaderCarrierProvider

### Inherited from AnyRef

### Inherited from Any

### Ungrouped