trait SessionManager[Session] extends AnyRef
SessionManager must be implemented in order to have support for sessions
- Session
the type of session
- Alphabetic
- By Inheritance
- SessionManager
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
abstract
def
create(sessionId: String): Future[Session]
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
-
abstract
def
loadBySessionId(sessionId: String, connection: HttpConnection): Future[Option[SessionTransaction[Session]]]
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
-
abstract
def
save(transaction: SessionTransaction[Session]): Future[SessionTransaction[Session]]
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
-
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
-
def
applySessionId(id: String, connection: HttpConnection): HttpConnection
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. Also updates the URL if applyToURL is true.
- id
the session id to apply
- connection
the HttpConnection to use
- returns
modified HttpConnection
- Attributes
- protected
-
def
applyToURL: Boolean
Set to true to apply the session id to the URL.
Set to true to apply the session id to the URL. Defaults to false.
- Attributes
- protected
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
createBySessionId(sessionId: String, connection: HttpConnection): Future[SessionTransaction[Session]]
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
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
generateSessionId: String
Generates a unique id for use when creating a new session
Generates a unique id for use when creating a new session
- Attributes
- protected
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getOrCreateSessionId(connection: HttpConnection): (HttpConnection, String)
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
-
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()
-
def
session(connection: HttpConnection, f: (SessionTransaction[Session]) ⇒ Future[SessionTransaction[Session]], requestModifiable: Boolean): Future[SessionTransaction[Session]]
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
-
def
sessionId(connection: HttpConnection): Option[String]
Retrieves the session id from the request / response cookies if available and from the URL if applyToURL is true.
Retrieves the session id from the request / response cookies if available and from the URL if applyToURL is true.
- connection
the HttpConnection to look in
- returns
the session id if found
- Attributes
- protected
-
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()
- def withConnection(connection: Connection)(f: (SessionTransaction[Session]) ⇒ Future[SessionTransaction[Session]] = t => Future.successful(t)): Future[Session]
-
def
withHttpConnection(connection: HttpConnection)(f: (SessionTransaction[Session]) ⇒ Future[SessionTransaction[Session]] = t => Future.successful(t)): Future[SessionTransaction[Session]]
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
-
def
withWebSocketListener(listener: WebSocketListener)(f: (SessionTransaction[Session]) ⇒ Future[SessionTransaction[Session]] = t => Future.successful(t)): Future[Session]
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
- listener
the WebSocketListener
- f
the functionality to work with and potentially modify a session instance
- returns
Future[Unit] since Connection cannot modify the state of HttpConnection