public class SessionResponse extends Object
SessionResponse
class represents a
SessionResponse
XML document. The SessionResponse
DTD is defined as the following:
<?xml version="1.0"> < !DOCTYPE SessionResponse [ < !ELEMENT SessionResponse(GetSession | GetValidSessions | DestroySession | Logout | AddSessionListener | AddSessionListenerOnAllSessions | SetProperty | GetSessionCount)> < !ATTLIST SessionResponse vers CDATA #REQUIRED reqid CDATA #REQUIRED> < !ELEMENT GetSession (Session|Exception)> < !ELEMENT GetValidSessions ((SessionList Status)|Exception)> < !ELEMENT DestroySession (OK|Exception)> < !ELEMENT Logout (OK|Exception)> < !ELEMENT AddSessionListener (OK|Exception)> < !ELEMENT AddSessionListenerOnAllSessions (OK|Exception)> < !ELEMENT SetProperty (OK|Exception)> < !ELEMENT GetSessionCount (AllSessionsGivenUUID|Exception)> < !ELEMENT SessionExpirationTimeInfo> < !ATTLIST SessionExpirationTimeInfo sid CDATA #REQUIRED expTime CDATA #REQUIRED> < !ELEMENT AllSessionsGivenUUID (SessionExpirationTimeInfo)*> < !ELEMENT Session (Property)*> < !ATTLIST Session sid CDATA #REQUIRED stype (user|application) "user" cid CDATA #REQUIRED cdomain CDATA #REQUIRED maxtime CDATA #REQUIRED maxidle CDATA #REQUIRED maxcaching CDATA #REQUIRED timeleft CDATA #REQUIRED timeidle CDATA #REQUIRED state (invalid|valid|inactive|destroyed) "invalid"> < !ELEMENT Property> < !ATTLIST Property name CDATA #REQUIRED value CDATA #REQUIRED> < !ELEMENT SessionList (Session)*> < !ELEMENT OK (#PCDATA)> < !ELEMENT Exception (#PCDATA)> < !ELEMENT Status (#PCDATA)> ]>
Constructor and Description |
---|
SessionResponse(String reqid,
int method)
This constructor shall only be used at the server side to construct a
SessionResponse object. |
Modifier and Type | Method and Description |
---|---|
void |
addSessionForGivenUUID(String sid,
Long expTime)
Adds the Session Information for a User.
|
void |
addSessionInfo(SessionInfo info)
Adds a
SessionInfo object. |
boolean |
getBooleanFlag()
Returns the flag.
|
String |
getException()
Returns the exception.
|
int |
getMethodID()
Returns the method ID.
|
String |
getRequestID()
Returns the request ID.
|
String |
getResponseVersion()
Returns the response version.
|
List<SessionInfo> |
getSessionInfo()
Returns the
SessionInfo . |
Map |
getSessionsForGivenUUID()
Returns the Session Information for a User.
|
int |
getStatus()
Returns the status.
|
static SessionResponse |
parseXML(String xml)
This method is used primarily at the client side to reconstruct a
SessionResponse object based on the XML document received
from server. |
void |
setBooleanFlag(boolean flag)
Sets the flag.
|
void |
setException(String ex)
Sets the exception.
|
void |
setSessionInfo(List<SessionInfo> infos)
Sets the
SessionInfo . |
void |
setSessionsForGivenUUID(Map sessions)
Sets the Sessions.
|
void |
setStatus(int value)
Sets the status.
|
String |
toXMLString()
Translates the response to an XML document String based on
the
SessionResponse DTD described above. |
public SessionResponse(String reqid, int method)
SessionResponse
object.reqid
- The original SessionRequest
ID.method
- The method ID of the original Session Request.public static SessionResponse parseXML(String xml) throws SessionException
SessionResponse
object based on the XML document received
from server. The DTD of this XML document is described above.xml
- The SessionResponse
XML document.SessionException
public String getResponseVersion()
public String getRequestID()
public int getMethodID()
public void addSessionInfo(SessionInfo info)
SessionInfo
object.public List<SessionInfo> getSessionInfo()
SessionInfo
.public void setSessionInfo(List<SessionInfo> infos)
SessionInfo
.infos
- set containing the session information.public void setBooleanFlag(boolean flag)
flag
- public boolean getBooleanFlag()
true
if the flag is set, false
otherwisepublic void addSessionForGivenUUID(String sid, Long expTime)
sid
- Session ID.expTime
- time when the session would expire.public void setSessionsForGivenUUID(Map sessions)
sessions
- number for sessions for the user.public Map getSessionsForGivenUUID()
public String getException()
public void setException(String ex)
ex
- Exception.public int getStatus()
public void setStatus(int value)
value
- Status.public String toXMLString()
SessionResponse
DTD described above.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.