Package io.vertx.mutiny.ext.web
Class Session
java.lang.Object
io.vertx.mutiny.ext.web.Session
- All Implemented Interfaces:
- MutinyDelegate
Represents a browser session.
 
Sessions persist between HTTP requests for a single browser session. They are deleted when the browser is closed, or they time-out. Session cookies are used to maintain sessions using a secure UUID.
Sessions can be used to maintain data for a browser session, e.g. a shopping basket.
 The context must have first been routed to a SessionHandler
 for sessions to be available.
 
original non Mutiny-ified interface using Vert.x codegen.- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncomputeIfAbsent(String key, Function<String, Object> mappingFunction) data()voiddestroy()boolean<T> Tio.vertx.ext.web.SessioninthashCode()id()booleanbooleanisEmpty()booleanlongstatic SessionnewInstance(io.vertx.ext.web.Session arg) oldId()putIfAbsent(String key, Object obj) <T> Tvoidlongtimeout()toString()value()
- 
Field Details- 
__TYPE_ARG
 
- 
- 
Constructor Details- 
Sessionpublic Session(io.vertx.ext.web.Session delegate) 
- 
Session
 
- 
- 
Method Details- 
getDelegatepublic io.vertx.ext.web.Session getDelegate()- Specified by:
- getDelegatein interface- MutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
 
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
- 
regenerateId- Returns:
- The new unique ID of the session.
 
- 
id- Returns:
- The unique ID of the session. This is generated using a random secure UUID.
 
- 
put- Parameters:
- key- the key for the data
- obj- the data
- Returns:
- a reference to this, so the API can be used fluently
 
- 
putIfAbsent- Parameters:
- key- the key for the data
- obj- the data
- Returns:
- a reference to this, so the API can be used fluently
 
- 
computeIfAbsent- Parameters:
- key- the key for the data
- mappingFunction- a mapping function
- Returns:
- a reference to this, so the API can be used fluently
 
- 
get- Parameters:
- key- the key of the data
- Returns:
- the data
 
- 
remove- Parameters:
- key- the key of the data
- Returns:
- the data that was there or null if none there
 
- 
isEmptypublic boolean isEmpty()- Returns:
- true if the session has data
 
- 
lastAccessedpublic long lastAccessed()- Returns:
- the time the session was last accessed
 
- 
destroypublic void destroy()
- 
isDestroyedpublic boolean isDestroyed()- Returns:
- has the session been destroyed?
 
- 
isRegeneratedpublic boolean isRegenerated()- Returns:
- has the session been renewed?
 
- 
oldId- Returns:
- old ID if renewed
 
- 
timeoutpublic long timeout()- Returns:
- the amount of time in ms, after which the session will expire, if not accessed.
 
- 
setAccessedpublic void setAccessed()
- 
value- Returns:
- short representation string.
 
- 
data- Returns:
- the session data as a map
 
- 
newInstance
 
-