Package com.iplanet.dpro.session.share
Class SessionResponse
- java.lang.Object
-
- com.iplanet.dpro.session.share.SessionResponse
-
public class SessionResponse extends Object
ThisSessionResponseclass represents aSessionResponseXML document. TheSessionResponseDTD 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 aSessionResponseobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSessionForGivenUUID(String sid, Long expTime)Adds the Session Information for a User.voidaddSessionInfo(SessionInfo info)Adds aSessionInfoobject.booleangetBooleanFlag()Returns the flag.StringgetException()Returns the exception.intgetMethodID()Returns the method ID.StringgetRequestID()Returns the request ID.StringgetResponseVersion()Returns the response version.List<SessionInfo>getSessionInfo()Returns theSessionInfo.MapgetSessionsForGivenUUID()Returns the Session Information for a User.intgetStatus()Returns the status.static SessionResponseparseXML(String xml)This method is used primarily at the client side to reconstruct aSessionResponseobject based on the XML document received from server.voidsetBooleanFlag(boolean flag)Sets the flag.voidsetException(String ex)Sets the exception.voidsetSessionInfo(List<SessionInfo> infos)Sets theSessionInfo.voidsetSessionsForGivenUUID(Map sessions)Sets the Sessions.voidsetStatus(int value)Sets the status.StringtoXMLString()Translates the response to an XML document String based on theSessionResponseDTD described above.
-
-
-
Constructor Detail
-
SessionResponse
public SessionResponse(String reqid, int method)
This constructor shall only be used at the server side to construct aSessionResponseobject.- Parameters:
reqid- The originalSessionRequestID.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 aSessionResponseobject based on the XML document received from server. The DTD of this XML document is described above.- Parameters:
xml- TheSessionResponseXML 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 aSessionInfoobject.
-
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
trueif the flag is set,falseotherwise
-
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 theSessionResponseDTD described above.- Returns:
- An XML String representing the response.
-
-