public interface HttpSession
Modifier and Type | Method and Description |
---|---|
Serializable |
getAttribute(String name)
Obtains the
Object that is bound to the name for this
HttpSession . |
Iterator<String> |
getAttributeNames()
|
long |
getCreationTime()
Obtains the time this
HttpSession was created. |
long |
getExpireTime()
Obtains the time this
HttpSession will be expired should it be
idle. |
HttpSessionAdministration |
getHttpSessionAdministration()
Obtains the
HttpSessionAdministration to administer this
HttpSession . |
String |
getSessionId()
Obtains the session Id.
|
String |
getTokenName()
Obtains the token name.
|
boolean |
isNew()
Indicates if this is a new
HttpSession . |
void |
removeAttribute(String name)
Removes the bound
Object by the name from this
HttpSession . |
void |
setAttribute(String name,
Serializable object)
Binds the
Object to the name within this HttpSession . |
void |
setExpireTime(long expireTime)
Specifies the time this
HttpSession will expire if idle. |
String getSessionId() throws InvalidatedHttpSessionException
InvalidatedHttpSessionException
- Indicating the HttpSession
is invalidated.String getTokenName()
Obtains the token name.
This is the name of the cookie or parameter that contains the session Id.
boolean isNew() throws InvalidatedHttpSessionException
HttpSession
.true
if this is a new HttpSession
.InvalidatedHttpSessionException
- Indicating the HttpSession
is invalidated.long getCreationTime() throws InvalidatedHttpSessionException
HttpSession
was created.HttpSession
was created.InvalidatedHttpSessionException
- Indicating the HttpSession
is invalidated.long getExpireTime() throws InvalidatedHttpSessionException
HttpSession
will be expired should it be
idle.HttpSession
will be expired.InvalidatedHttpSessionException
- Indicating the HttpSession
is invalidated.void setExpireTime(long expireTime) throws StoringHttpSessionException, InvalidatedHttpSessionException
Specifies the time this HttpSession
will expire if idle.
The HttpSessionStore
may increment this time on further requests
to keep the HttpSession
active over a long conversation.
expireTime
- Time to expire this HttpSession
.StoringHttpSessionException
- Indicating the HttpSession
is currently being stored
and can not be altered.InvalidatedHttpSessionException
- Indicating the HttpSession
is invalidated.Serializable getAttribute(String name) throws InvalidatedHttpSessionException
Object
that is bound to the name for this
HttpSession
.name
- Name.Object
bound to the name or null
if no
Object
bound by the name.InvalidatedHttpSessionException
- Indicating the HttpSession
is invalidated.Iterator<String> getAttributeNames() throws InvalidatedHttpSessionException
Iterator
to the names of the bound Object
instances.InvalidatedHttpSessionException
- Indicating the HttpSession
is invalidated.void setAttribute(String name, Serializable object) throws StoringHttpSessionException, InvalidatedHttpSessionException
Object
to the name within this HttpSession
.name
- Name.object
- Object
. Must be Serializable
as the attributes
of this HttpSession
may be serialised to larger,
cheaper memory stores or for clustered HttpSession
management sent over the network.StoringHttpSessionException
- Indicating the HttpSession
is currently being stored
and can not be altered.InvalidatedHttpSessionException
- Indicating the HttpSession
is invalidated.void removeAttribute(String name) throws StoringHttpSessionException, InvalidatedHttpSessionException
Object
by the name from this
HttpSession
.name
- Name of bound Object
to remove.StoringHttpSessionException
- Indicating the HttpSession
is currently being stored
and can not be altered.InvalidatedHttpSessionException
- Indicating the HttpSession
is invalidated.HttpSessionAdministration getHttpSessionAdministration()
HttpSessionAdministration
to administer this
HttpSession
.HttpSessionAdministration
to administer this
HttpSession
.Copyright © 2005–2016. All rights reserved.