Package com.iplanet.dpro.session.share
Class SessionResponse
- java.lang.Object
-
- com.iplanet.dpro.session.share.SessionResponse
-
public class SessionResponse extends Object
ThisSessionResponse
class represents aSessionResponse
XML document. TheSessionResponse
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 Summary
Constructors Constructor Description SessionResponse(String reqid, int method)
This constructor shall only be used at the server side to construct aSessionResponse
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSessionForGivenUUID(String sid, Long expTime)
Adds the Session Information for a User.void
addSessionInfo(SessionInfo info)
Adds aSessionInfo
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 theSessionInfo
.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 aSessionResponse
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 theSessionInfo
.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 theSessionResponse
DTD described above.
-
-
-
Constructor Detail
-
SessionResponse
public SessionResponse(String reqid, int method)
This constructor shall only be used at the server side to construct aSessionResponse
object.- Parameters:
reqid
- The originalSessionRequest
ID.method
- The method ID of the original Session Request.
-
-
Method Detail
-
parseXML
public static SessionResponse parseXML(String xml) throws SessionException
This method is used primarily at the client side to reconstruct aSessionResponse
object based on the XML document received from server. The DTD of this XML document is described above.- Parameters:
xml
- TheSessionResponse
XML document.- Throws:
SessionException
-
getResponseVersion
public String getResponseVersion()
Returns the response version.- Returns:
- The response version.
-
getRequestID
public String getRequestID()
Returns the request ID.- Returns:
- The request ID.
-
getMethodID
public int getMethodID()
Returns the method ID.- Returns:
- The method ID.
-
addSessionInfo
public void addSessionInfo(SessionInfo info)
Adds aSessionInfo
object.
-
getSessionInfo
public List<SessionInfo> getSessionInfo()
Returns theSessionInfo
.- Returns:
- Set containing the session information
-
setSessionInfo
public void setSessionInfo(List<SessionInfo> infos)
Sets theSessionInfo
.- Parameters:
infos
- set containing the session information.
-
setBooleanFlag
public void setBooleanFlag(boolean flag)
Sets the flag.- Parameters:
flag
-
-
getBooleanFlag
public boolean getBooleanFlag()
Returns the flag.- Returns:
- flag
true
if the flag is set,false
otherwise
-
addSessionForGivenUUID
public void addSessionForGivenUUID(String sid, Long expTime)
Adds the Session Information for a User.- Parameters:
sid
- Session ID.expTime
- time when the session would expire.
-
setSessionsForGivenUUID
public void setSessionsForGivenUUID(Map sessions)
Sets the Sessions.- Parameters:
sessions
- number for sessions for the user.
-
getSessionsForGivenUUID
public Map getSessionsForGivenUUID()
Returns the Session Information for a User.- Returns:
- list sessions for the user
-
getException
public String getException()
Returns the exception.- Returns:
- The exception.
-
setException
public void setException(String ex)
Sets the exception.- Parameters:
ex
- Exception.
-
getStatus
public int getStatus()
Returns the status.- Returns:
- The status.
-
setStatus
public void setStatus(int value)
Sets the status.- Parameters:
value
- Status.
-
toXMLString
public String toXMLString()
Translates the response to an XML document String based on theSessionResponse
DTD described above.- Returns:
- An XML String representing the response.
-
-