public class Session extends Object
Constructor and Description |
---|
Session() |
Session(String id)
Create a new session using a session identifier
|
Modifier and Type | Method and Description |
---|---|
ConcurrentMap<String,Object> |
attributes()
Return a
ConcurrentMap of attributes. |
Object |
getAttribute(String key)
Return an attribute.
|
String |
getIdInternal()
Return the session identifier for this session.
|
long |
getSessionTimeout()
Return a long representing the maximum idle time (in milliseconds) a session can be.
|
long |
getTimestamp() |
boolean |
isValid()
Is the current Session valid?
|
Object |
removeAttribute(String key)
Remove an attribute.
|
void |
setAttribute(String key,
Object value)
Add an attribute to this session.
|
protected void |
setIdInternal(String id)
Return the session identifier for this session.
|
void |
setSessionTimeout(long sessionTimeout)
Set a long representing the maximum idle time (in milliseconds) a session can be.
|
void |
setTimestamp(long timestamp)
Set the timestamp when this session has been created.
|
void |
setValid(boolean isValid)
Set this object as validated.
|
public Session()
public Session(String id)
id
- session identifierpublic boolean isValid()
public void setValid(boolean isValid)
isValid
- public String getIdInternal()
protected void setIdInternal(String id)
public void setAttribute(String key, Object value)
key
- value
- public Object getAttribute(String key)
key
- public Object removeAttribute(String key)
key
- public ConcurrentMap<String,Object> attributes()
ConcurrentMap
of attributes.public long getSessionTimeout()
public void setSessionTimeout(long sessionTimeout)
sessionTimeout
- a long representing the maximum idle time (in milliseconds) a session can be.public long getTimestamp()
public void setTimestamp(long timestamp)
timestamp
- a long representing when the session has been created.Copyright © 2014 Oracle Corporation. All rights reserved.