public class HTTPSession extends Object implements Session, Serializable
| Constructor and Description |
|---|
HTTPSession(String id,
int maxInactiveInterval,
String path) |
| Modifier and Type | Method and Description |
|---|---|
void |
generateSessionHeader(org.wso2.transport.http.netty.message.HTTPCarbonMessage message,
boolean isSecureRequest)
Add header to response message.
|
String[] |
getAttributeNames()
Get attribute name list.
|
BMap<String,BValue> |
getAttributes()
Get attribute key value map.
|
BValue |
getAttributeValue(String attributeKey)
Retrieve a session attribute value.
|
Long |
getCreationTime()
Get session creation time.
|
String |
getId()
Retrieve a session id.
|
Long |
getLastAccessedTime()
Get last accessed time.
|
int |
getMaxInactiveInterval()
Get max inactive time duration.
|
String |
getPath()
Get path of session.
|
void |
invalidate()
Invalidate a session.
|
boolean |
isNew()
Get session status.
|
boolean |
isValid()
check validity.
|
void |
removeAttribute(String name)
Remove attribute from session.
|
Session |
setAccessed()
Update lastaccesed time and return Session.
|
void |
setAttribute(String attributeKey,
BValue attributeValue)
Add attribute key and value to session attribute map.
|
void |
setManager(SessionManager sessionManager) |
void |
setMaxInactiveInterval(int maxInactiveInterval)
Set max inactive time duration.
|
Session |
setNew(boolean isNew)
Update session stage whether new or already used.
|
public void setAttribute(String attributeKey, BValue attributeValue)
SessionsetAttribute in interface SessionattributeKey - key of the session attributeattributeValue - value of the session attributepublic BValue getAttributeValue(String attributeKey)
SessiongetAttributeValue in interface SessionattributeKey - key of the session attributepublic String[] getAttributeNames()
SessiongetAttributeNames in interface Sessionpublic BMap<String,BValue> getAttributes()
SessiongetAttributes in interface Sessionpublic Session setNew(boolean isNew)
Sessionpublic void removeAttribute(String name)
SessionremoveAttribute in interface Sessionname - which needs to deletepublic Long getLastAccessedTime()
SessiongetLastAccessedTime in interface Sessionpublic Long getCreationTime()
SessiongetCreationTime in interface Sessionpublic int getMaxInactiveInterval()
SessiongetMaxInactiveInterval in interface Sessionpublic void setMaxInactiveInterval(int maxInactiveInterval)
SessionsetMaxInactiveInterval in interface SessionmaxInactiveInterval - is the session max inactive time in secondspublic void invalidate()
Sessioninvalidate in interface Sessionpublic Session setAccessed()
SessionsetAccessed in interface Sessionpublic boolean isValid()
Sessionpublic void generateSessionHeader(org.wso2.transport.http.netty.message.HTTPCarbonMessage message,
boolean isSecureRequest)
SessiongenerateSessionHeader in interface Sessionmessage - which send to clientpublic void setManager(SessionManager sessionManager)
Copyright © 2018 WSO2. All rights reserved.