public interface Session
HttpSession
that is used to maintain state information
between requests for a particular user of a web application.Modifier and Type | Field and Description |
---|---|
static String |
SESSION_CREATED_EVENT
The SessionEvent event type when a session is created.
|
static String |
SESSION_DESTROYED_EVENT
The SessionEvent event type when a session is destroyed.
|
Modifier and Type | Method and Description |
---|---|
void |
access()
Update the accessed time information for this session.
|
void |
addSessionListener(SessionListener listener)
Add a session event listener to this component.
|
void |
endAccess()
End access to the session.
|
void |
expire()
Perform the internal processing required to invalidate this session,
without triggering an exception if the session has already expired.
|
Map<String,Object> |
getAttributes()
Gets the attributes of this session.
|
String |
getAuthType()
Return the authentication type used to authenticate our cached
Principal, if any.
|
long |
getCreationTime()
Return the creation time for this session.
|
String |
getId()
Return the session identifier for this session.
|
String |
getIdInternal()
Return the session identifier for this session.
|
String |
getInfo()
Return descriptive information about this Session implementation and
the corresponding version number, in the format
<description>/<version> . |
boolean |
getIsValid()
Return the
isValid flag for this session. |
long |
getLastAccessedTime()
Return the last time the client sent a request associated with this
session, as the number of milliseconds since midnight, January 1, 1970
GMT.
|
Manager |
getManager()
Return the Manager within which this Session is valid.
|
int |
getMaxInactiveInterval()
Return the maximum time interval, in seconds, between client requests
before the servlet container will invalidate the session.
|
Object |
getNote(String name)
Return the object bound with the specified name to the internal notes
for this session, or
null if no such binding exists. |
Iterator |
getNoteNames()
Return an Iterator containing the String names of all notes bindings
that exist for this session.
|
Principal |
getPrincipal()
Return the authenticated Principal that is associated with this Session.
|
javax.servlet.http.HttpSession |
getSession()
Return the
HttpSession for which this object
is the facade. |
String |
getSsoId()
Return the single sign on id.
|
long |
getSsoVersion()
Return the single sign on version.
|
long |
getVersion()
Gets the version number of this Session
|
boolean |
hasExpired()
Checks whether this Session has expired.
|
boolean |
isValid()
Expire the expired session if necessary and
return the
isValid flag for this session. |
boolean |
lockForeground()
lock the session for background
returns true if successful; false if unsuccessful
|
void |
recycle()
Release all object references, and initialize instance variables, in
preparation for reuse of this object.
|
void |
removeNote(String name)
Remove any object bound to the specified name in the internal notes
for this session.
|
void |
removeSessionListener(SessionListener listener)
Remove a session event listener from this component.
|
void |
setAuthType(String authType)
Set the authentication type used to authenticate our cached
Principal, if any.
|
void |
setCreationTime(long time)
Set the creation time for this session.
|
void |
setId(String id)
Set the session identifier for this session.
|
void |
setManager(Manager manager)
Set the Manager within which this Session is valid.
|
void |
setMaxInactiveInterval(int interval)
Set the maximum time interval, in seconds, between client requests
before the servlet container will invalidate the session.
|
void |
setNew(boolean isNew)
Set the
isNew flag for this session. |
void |
setNote(String name,
Object value)
Bind an object to a specified name in the internal notes associated
with this session, replacing any existing binding for this name.
|
void |
setPrincipal(Principal principal)
Set the authenticated Principal that is associated with this Session.
|
void |
setSsoId(String ssoId)
Set the single sign on id.
|
void |
setSsoVersion(long ssoVersion)
Set the single sign on version.
|
void |
setValid(boolean isValid)
Set the
isValid flag for this session. |
void |
unlockForeground()
unlock the session from foreground
|
static final String SESSION_CREATED_EVENT
static final String SESSION_DESTROYED_EVENT
String getAuthType()
void setAuthType(String authType)
authType
- The new cached authentication typelong getCreationTime()
void setCreationTime(long time)
time
- The new creation timeString getId()
String getIdInternal()
void setId(String id)
id
- The new session identifierString getInfo()
<description>/<version>
.long getLastAccessedTime()
Manager getManager()
void setManager(Manager manager)
manager
- The new Managerint getMaxInactiveInterval()
void setMaxInactiveInterval(int interval)
interval
- The new maximum intervalvoid setNew(boolean isNew)
isNew
flag for this session.isNew
- The new value for the isNew
flagPrincipal getPrincipal()
Authenticator
with a means to cache a
previously authenticated Principal, and avoid potentially expensive
Realm.authenticate()
calls on every request. If there
is no current associated Principal, return null
.void setPrincipal(Principal principal)
Authenticator
with a means to cache a
previously authenticated Principal, and avoid potentially expensive
Realm.authenticate()
calls on every request.principal
- The new Principal, or null
if nonejavax.servlet.http.HttpSession getSession()
HttpSession
for which this object
is the facade.void setValid(boolean isValid)
isValid
flag for this session.isValid
- The new value for the isValid
flagboolean isValid()
isValid
flag for this session.boolean getIsValid()
isValid
flag for this session.void access()
void addSessionListener(SessionListener listener)
void endAccess()
void expire()
Object getNote(String name)
null
if no such binding exists.name
- Name of the note to be returnedIterator getNoteNames()
void recycle()
void removeNote(String name)
name
- Name of the note to be removedvoid removeSessionListener(SessionListener listener)
void setNote(String name, Object value)
name
- Name to which the object should be boundvalue
- Object to be bound to the specified nameboolean hasExpired()
long getVersion()
Map<String,Object> getAttributes()
String getSsoId()
void setSsoId(String ssoId)
long getSsoVersion()
void setSsoVersion(long ssoVersion)
boolean lockForeground()
void unlockForeground()
Copyright © 2019. All rights reserved.