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)
Session
setAttribute
in interface Session
attributeKey
- key of the session attributeattributeValue
- value of the session attributepublic BValue getAttributeValue(String attributeKey)
Session
getAttributeValue
in interface Session
attributeKey
- key of the session attributepublic String[] getAttributeNames()
Session
getAttributeNames
in interface Session
public BMap<String,BValue> getAttributes()
Session
getAttributes
in interface Session
public Session setNew(boolean isNew)
Session
public void removeAttribute(String name)
Session
removeAttribute
in interface Session
name
- which needs to deletepublic Long getLastAccessedTime()
Session
getLastAccessedTime
in interface Session
public Long getCreationTime()
Session
getCreationTime
in interface Session
public int getMaxInactiveInterval()
Session
getMaxInactiveInterval
in interface Session
public void setMaxInactiveInterval(int maxInactiveInterval)
Session
setMaxInactiveInterval
in interface Session
maxInactiveInterval
- is the session max inactive time in secondspublic void invalidate()
Session
invalidate
in interface Session
public Session setAccessed()
Session
setAccessed
in interface Session
public boolean isValid()
Session
public void generateSessionHeader(org.wso2.transport.http.netty.message.HttpCarbonMessage message, boolean isSecureRequest)
Session
generateSessionHeader
in interface Session
message
- which send to clientisSecureRequest
- is Request Securepublic void setManager(SessionManager sessionManager)
Copyright © 2019 WSO2. All rights reserved.