类 InMemorySessionRepository.InMemoryWebSession

java.lang.Object
cn.taketoday.session.AbstractWebSession
cn.taketoday.session.InMemorySessionRepository.InMemoryWebSession
所有已实现的接口:
SerializableSession, WebSession, Serializable
封闭类:
InMemorySessionRepository

final class InMemorySessionRepository.InMemoryWebSession extends AbstractWebSession implements WebSession, Serializable, SerializableSession
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • getId

      public String getId()
      从接口复制的说明: WebSession
      returns this session's id
      指定者:
      getId 在接口中 WebSession
    • getCreationTime

      public Instant getCreationTime()
      从接口复制的说明: WebSession
      Return the time when the session was created.
      指定者:
      getCreationTime 在接口中 WebSession
    • getLastAccessTime

      public Instant getLastAccessTime()
      从接口复制的说明: WebSession
      Return the last time of session access as a result of user activity such as an HTTP request. Together with maxIdleTimeInSeconds this helps to determine when a session is expired.
      指定者:
      getLastAccessTime 在接口中 WebSession
    • setLastAccessTime

      public void setLastAccessTime(Instant lastAccessTime)
      从接口复制的说明: WebSession
      Sets the last accessed time.
      指定者:
      setLastAccessTime 在接口中 WebSession
      参数:
      lastAccessTime - the last accessed time
    • changeSessionId

      public void changeSessionId()
      从接口复制的说明: WebSession
      Generate a new id for the session and update the underlying session storage to reflect the new id. After a successful call WebSession.getId() reflects the new session id.
      指定者:
      changeSessionId 在接口中 WebSession
    • doInvalidate

      protected void doInvalidate()
      覆盖:
      doInvalidate 在类中 AbstractWebSession
    • save

      public void save()
      从接口复制的说明: WebSession
      Save the session through the SessionRepository as 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 was invalidated and 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
    • setMaxIdleTime

      public void setMaxIdleTime(Duration maxIdleTime)
      从接口复制的说明: WebSession
      Configure the max amount of time that may elapse after the lastAccessTime before a session is considered expired. A negative value indicates the session should not expire.
      指定者:
      setMaxIdleTime 在接口中 WebSession
    • getMaxIdleTime

      public Duration getMaxIdleTime()
      从接口复制的说明: WebSession
      Return the maximum time after the lastAccessTime before 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 when save() is called.
      指定者:
      start 在接口中 WebSession
    • isStarted

      public boolean isStarted()
      Whether a session with the client has been started explicitly via start() or implicitly by adding session attributes. If "false" then the session id is not sent to the client and the save() method is essentially a no-op.
      指定者:
      isStarted 在接口中 WebSession
    • attributeBinding

      protected boolean attributeBinding(Object value, @Nullable Object oldValue)
      覆盖:
      attributeBinding 在类中 AbstractWebSession
    • allowAttributeReplaced

      protected boolean allowAttributeReplaced(Object value, @Nullable Object oldValue)
      覆盖:
      allowAttributeReplaced 在类中 AbstractWebSession
    • checkMaxSessionsLimit

      private void checkMaxSessionsLimit()
    • isExpired

      public boolean isExpired()
      从接口复制的说明: WebSession
      Return true if the session expired after maxIdleTime elapsed.

      Typically expiration checks should be automatically made when a session is accessed, a new WebSession instance 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

      private boolean isExpired(Instant now)
    • checkExpired

      private boolean checkExpired(Instant currentTime)
    • writeObjectData

      public void writeObjectData(ObjectOutputStream stream) throws IOException
      从接口复制的说明: SerializableSession
      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.
      指定者:
      writeObjectData 在接口中 SerializableSession
      参数:
      stream - The object output stream to write to
      抛出:
      IOException - if an input/output error occurs
    • readObjectData

      public void readObjectData(ObjectInputStream stream) throws ClassNotFoundException, IOException
      从接口复制的说明: SerializableSession
      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.
      指定者:
      readObjectData 在接口中 SerializableSession
      参数:
      stream - The object input stream to read from
      抛出:
      ClassNotFoundException - if an unknown class is specified
      IOException - if an input/output error occurs
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 AbstractWebSession