类 InMemorySessionRepository.InMemoryWebSession
java.lang.Object
cn.taketoday.session.AbstractWebSession
cn.taketoday.session.InMemorySessionRepository.InMemoryWebSession
- 所有已实现的接口:
SerializableSession,WebSession,Serializable
final class InMemorySessionRepository.InMemoryWebSession
extends AbstractWebSession
implements WebSession, Serializable, SerializableSession
-
字段概要
字段修饰符和类型字段说明private Instantprivate final AtomicReference<String>private Instantprivate Durationprivate static final longprivate final AtomicReference<InMemorySessionRepository.State>从类继承的字段 cn.taketoday.session.AbstractWebSession
attributes, eventDispatcher -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected booleanallowAttributeReplaced(Object value, Object oldValue) protected booleanattributeBinding(Object value, Object oldValue) voidGenerate a new id for the session and update the underlying session storage to reflect the new id.private booleancheckExpired(Instant currentTime) private voidprotected voidbooleanReturn the time when the session was created.getId()returns this session's idReturn the last time of session access as a result of user activity such as an HTTP request.Return the maximum time after thelastAccessTimebefore a session expires.inthashCode()booleanReturntrueif the session expired aftermaxIdleTimeelapsed.private booleanbooleanWhether a session with the client has been started explicitly viastart()or implicitly by adding session attributes.voidreadObjectData(ObjectInputStream stream) Read a serialized version of the contents of this session object from the specified object input stream, without requiring that the StandardSession itself have been serialized.voidsave()Save the session through theSessionRepositoryas follows: If the session is new (i.e. created but never persisted), it must have been started explicitly viaWebSession.start()or implicitly by adding attributes, or otherwise this method should have no effect.voidsetLastAccessTime(Instant lastAccessTime) Sets the last accessed time.voidsetMaxIdleTime(Duration maxIdleTime) Configure the max amount of time that may elapse after thelastAccessTimebefore a session is considered expired.voidstart()Force the creation of a session causing the session id to be sent whensave()is called.voidwriteObjectData(ObjectOutputStream stream) Write a serialized version of the contents of this session object to the specified object output stream, without requiring that the StandardSession itself have been serialized.从类继承的方法 cn.taketoday.session.AbstractWebSession
attributeAdded, attributeNames, attributeRemoved, attributeReplaced, copyAttributesFrom, createAttributes, getAttribute, getAttributeNames, getAttributes, hasAttribute, hasAttributes, invalidate, removeAttribute, setAttribute从接口继承的方法 cn.taketoday.session.WebSession
attributeNames, getAttribute, getAttributeNames, getAttributes, hasAttribute, hasAttributes, invalidate, removeAttribute, setAttribute
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID- 另请参阅:
-
creationTime
-
maxIdleTime
-
lastAccessTime
-
id
-
state
-
-
构造器详细资料
-
InMemoryWebSession
-
-
方法详细资料
-
getId
从接口复制的说明:WebSessionreturns this session's id- 指定者:
getId在接口中WebSession
-
getCreationTime
从接口复制的说明:WebSessionReturn the time when the session was created.- 指定者:
getCreationTime在接口中WebSession
-
getLastAccessTime
从接口复制的说明:WebSessionReturn the last time of session access as a result of user activity such as an HTTP request. Together withmaxIdleTimeInSecondsthis helps to determine when a session isexpired.- 指定者:
getLastAccessTime在接口中WebSession
-
setLastAccessTime
从接口复制的说明:WebSessionSets the last accessed time.- 指定者:
setLastAccessTime在接口中WebSession- 参数:
lastAccessTime- the last accessed time
-
changeSessionId
public void changeSessionId()从接口复制的说明:WebSessionGenerate a new id for the session and update the underlying session storage to reflect the new id. After a successful callWebSession.getId()reflects the new session id.- 指定者:
changeSessionId在接口中WebSession
-
doInvalidate
protected void doInvalidate()- 覆盖:
doInvalidate在类中AbstractWebSession
-
save
public void save()从接口复制的说明:WebSessionSave the session through theSessionRepositoryas follows:- If the session is new (i.e. created but never persisted), it must have
been started explicitly via
WebSession.start()or implicitly by adding attributes, or otherwise this method should have no effect. - If the session was retrieved through the
WebSessionStore, the implementation for this method must check whether the session wasinvalidatedand if so return an error.
Note that this method is not intended for direct use by applications. Instead it is automatically invoked just before the response is committed.
- 指定者:
save在接口中WebSession
- If the session is new (i.e. created but never persisted), it must have
been started explicitly via
-
setMaxIdleTime
从接口复制的说明:WebSessionConfigure the max amount of time that may elapse after thelastAccessTimebefore a session is considered expired. A negative value indicates the session should not expire.- 指定者:
setMaxIdleTime在接口中WebSession
-
getMaxIdleTime
从接口复制的说明:WebSessionReturn the maximum time after thelastAccessTimebefore a session expires. A negative time indicates the session doesn't expire.- 指定者:
getMaxIdleTime在接口中WebSession
-
start
public void start()Force the creation of a session causing the session id to be sent whensave()is called.- 指定者:
start在接口中WebSession
-
isStarted
public boolean isStarted()Whether a session with the client has been started explicitly viastart()or implicitly by adding session attributes. If "false" then the session id is not sent to the client and thesave()method is essentially a no-op.- 指定者:
isStarted在接口中WebSession
-
attributeBinding
- 覆盖:
attributeBinding在类中AbstractWebSession
-
allowAttributeReplaced
-
checkMaxSessionsLimit
private void checkMaxSessionsLimit() -
isExpired
public boolean isExpired()从接口复制的说明:WebSessionReturntrueif the session expired aftermaxIdleTimeelapsed.Typically expiration checks should be automatically made when a session is accessed, a new
WebSessioninstance created if necessary, at the start of request processing so that applications don't have to worry about expired session by default.- 指定者:
isExpired在接口中WebSession
-
isExpired
-
checkExpired
-
writeObjectData
从接口复制的说明:SerializableSessionWrite a serialized version of the contents of this session object to the specified object output stream, without requiring that the StandardSession itself have been serialized.- 指定者:
writeObjectData在接口中SerializableSession- 参数:
stream- The object output stream to write to- 抛出:
IOException- if an input/output error occurs
-
readObjectData
从接口复制的说明:SerializableSessionRead a serialized version of the contents of this session object from the specified object input stream, without requiring that the StandardSession itself have been serialized.- 指定者:
readObjectData在接口中SerializableSession- 参数:
stream- The object input stream to read from- 抛出:
ClassNotFoundException- if an unknown class is specifiedIOException- if an input/output error occurs
-
equals
-
hashCode
public int hashCode()- 覆盖:
hashCode在类中AbstractWebSession
-