public abstract class AbstractSession extends Object implements Session, io.vertx.ext.web.sstore.impl.SessionInternal
| Constructor and Description |
|---|
AbstractSession()
This constructor is mandatory (even though not referenced anywhere) is required for
serialization purposes.
|
AbstractSession(VertxContextPRNG random) |
AbstractSession(VertxContextPRNG random,
long timeout,
int length) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
checksum() |
Session |
computeIfAbsent(String key,
java.util.function.Function<String,Object> mappingFunction)
Put some data in a session if absent.
|
protected int |
crc() |
Map<String,Object> |
data() |
void |
destroy()
Destroy the session
|
void |
flushed(boolean skipCrc)
Mark this session as flushed, this gives the object a change to clear any state management flags.
|
<T> T |
get(String key)
Get some data from the session
|
String |
id() |
void |
incrementVersion() |
boolean |
isDestroyed() |
boolean |
isEmpty() |
boolean |
isRegenerated() |
long |
lastAccessed() |
String |
oldId() |
Session |
put(String key,
Object obj)
Put some data in a session
|
Session |
putIfAbsent(String key,
Object obj)
Put some data in a session if absent
|
Session |
regenerateId() |
<T> T |
remove(String key)
Remove some data from the session
|
void |
setAccessed()
Mark the session as being accessed.
|
protected void |
setData(JsonObject data) |
protected void |
setData(Map<String,Object> data) |
protected void |
setId(String id) |
protected void |
setLastAccessed(long lastAccessed) |
void |
setPRNG(VertxContextPRNG prng) |
protected void |
setTimeout(long timeout) |
protected void |
setVersion(int version) |
long |
timeout() |
int |
version() |
public AbstractSession()
public AbstractSession(VertxContextPRNG random)
public AbstractSession(VertxContextPRNG random, long timeout, int length)
protected void setId(String id)
protected void setTimeout(long timeout)
protected void setData(JsonObject data)
protected void setLastAccessed(long lastAccessed)
protected void setVersion(int version)
public void setPRNG(VertxContextPRNG prng)
public void flushed(boolean skipCrc)
io.vertx.ext.web.sstore.impl.SessionInternalflushed in interface io.vertx.ext.web.sstore.impl.SessionInternalskipCrc - if the intention is NOT to keep using the session after this call,
a small optimization can be performed (skip updating the internal CRC)
which is unnecessary.public String id()
public Session regenerateId()
regenerateId in interface Sessionpublic long timeout()
public <T> T get(String key)
Sessionpublic Session put(String key, Object obj)
Sessionpublic Session putIfAbsent(String key, Object obj)
SessionputIfAbsent in interface Sessionkey - the key for the dataobj - the datapublic Session computeIfAbsent(String key, java.util.function.Function<String,Object> mappingFunction)
Sessionnull), attempts to compute its value using the given mapping
function and enters it into this map unless null.computeIfAbsent in interface Sessionkey - the key for the datamappingFunction - a mapping functionpublic <T> T remove(String key)
Sessionpublic boolean isEmpty()
public long lastAccessed()
lastAccessed in interface Sessionpublic void setAccessed()
SessionsetAccessed in interface Sessionpublic void destroy()
Sessionpublic boolean isDestroyed()
isDestroyed in interface Sessionpublic boolean isRegenerated()
isRegenerated in interface Sessionpublic int version()
public void incrementVersion()
protected int crc()
protected int checksum()
Copyright © 2021 Eclipse. All rights reserved.