Trait

io.youi.server.session

SessionManager

Related Doc: package session

Permalink

trait SessionManager[Session] extends AnyRef

SessionManager must be implemented in order to have support for sessions

Session

the type of session

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SessionManager
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def create(sessionId: String): Session

    Permalink

    Simple create function used by createBySessionId.

    Simple create function used by createBySessionId. For more advanced usage, extend createBySessionId.

    sessionId

    the session id to create a Session for

    Attributes
    protected
  2. abstract def loadBySessionId(sessionId: String, connection: HttpConnection): Future[Option[SessionTransaction[Session]]]

    Permalink

    Loads a session by id if available and creates a SessionTransaction wrapper

    Loads a session by id if available and creates a SessionTransaction wrapper

    sessionId

    the session id to load from

    connection

    the HttpConnection to work with

    returns

    a future SessionTransaction[Session] if one is persisted for this manager

    Attributes
    protected
  3. abstract def save(transaction: SessionTransaction[Session]): Future[SessionTransaction[Session]]

    Permalink

    Saves a potentially modified Session to this manager

    Saves a potentially modified Session to this manager

    transaction

    the transaction to persist from

    returns

    a potentially modified HttpConnection

    Attributes
    protected

Concrete 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 applySessionId(id: String, connection: HttpConnection): HttpConnection

    Permalink

    Applies a new session id to an HttpConnection.

    Applies a new session id to an HttpConnection. Creates a cookie and sets it on the HttpResponse.

    id

    the session id to apply

    connection

    the HttpConnection to use

    returns

    modified HttpConnection

    Attributes
    protected
  5. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def createBySessionId(sessionId: String, connection: HttpConnection): Future[SessionTransaction[Session]]

    Permalink

    Creates a new session by session id

    Creates a new session by session id

    sessionId

    the session id to create from

    connection

    the HttpConnection to work with

    returns

    a future SessionTransaction[Session]

    Attributes
    protected
  8. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def generateSessionId: String

    Permalink

    Generates a unique id for use when creating a new session

    Generates a unique id for use when creating a new session

    Attributes
    protected
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def getOrCreateSessionId(connection: HttpConnection): (HttpConnection, String)

    Permalink

    Gets a session id if it already exists or creates a new one (and applies it on the HttpConnection) if it doesn't already exist.

    Gets a session id if it already exists or creates a new one (and applies it on the HttpConnection) if it doesn't already exist.

    connection

    the HttpConnection to use

    returns

    a tuple with the potentially modified HttpConnection and the session id

    Attributes
    protected
  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. def session(connection: HttpConnection, f: (SessionTransaction[Session]) ⇒ Future[SessionTransaction[Session]], requestModifiable: Boolean): Future[SessionTransaction[Session]]

    Permalink

    Manages the entire transaction process of working with a session

    Manages the entire transaction process of working with a session

    connection

    the HttpConnection to work with

    f

    the transaction handling function to apply

    requestModifiable

    true if the request can be modified

    returns

    the final, modified HttpConnection

    Attributes
    protected
  20. def sessionId(connection: HttpConnection): Option[String]

    Permalink

    Retrieves the session id from the request / response cookies if available.

    Retrieves the session id from the request / response cookies if available.

    connection

    the HttpConnection to look in

    returns

    the session id if found

    Attributes
    protected
  21. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. def withConnection(connection: Connection)(f: (SessionTransaction[Session]) ⇒ Future[SessionTransaction[Session]] = t => Future.successful(t)): Future[Session]

    Permalink

    Functional use of a Session via a transaction that is fully managed with the result being updated to the manager

    Functional use of a Session via a transaction that is fully managed with the result being updated to the manager

    connection

    the HttpConnection to work with

    f

    the functionality to work with and potentially modify a session instance

    returns

    Future[Unit] since Connection cannot modify the state of HttpConnection

  27. def withHttpConnection(connection: HttpConnection)(f: (SessionTransaction[Session]) ⇒ Future[SessionTransaction[Session]] = t => Future.successful(t)): Future[SessionTransaction[Session]]

    Permalink

    Functional use of a Session via a transaction that is fully managed with the result being updated to the manager

    Functional use of a Session via a transaction that is fully managed with the result being updated to the manager

    connection

    the HttpConnection to work with

    f

    the functionality to work with and potentially modify a session instance

    returns

    potentially modified HttpConnection

Inherited from AnyRef

Inherited from Any

Ungrouped