public class HttpSession extends LocalClientSession
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpSession.HttpVirtualConnection
A virtual server connection relates to a http session which its self can relate to many http
connections.
|
authTokenCHARSET, conn, sessionManager, status, streamManagerMAJOR_VERSION, MINOR_VERSION, STATUS_AUTHENTICATED, STATUS_CLOSED, STATUS_CONNECTED| Constructor and Description |
|---|
HttpSession(PacketDeliverer backupDeliverer,
String serverName,
InetAddress address,
StreamID streamID,
long rid,
HttpConnection connection,
Locale language) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSessionCloseListener(SessionListener listener)
Adds a
SessionListener to this session. |
void |
close()
Closes the session.
|
protected String |
createEmptyBody(boolean terminate) |
void |
deliver(org.xmpp.packet.Packet stanza) |
void |
forwardRequest(long rid,
boolean isSecure,
org.dom4j.Element rootNode,
javax.servlet.AsyncContext context)
Forwards a client request, which is related to a session, to the server.
|
String |
getAvailableStreamFeatures()
Returns a text with the available stream features.
|
Collection<org.dom4j.Element> |
getAvailableStreamFeaturesElements()
Returns the stream features which are available for this session.
|
int |
getHold()
Specifies the maximum number of requests the connection manager is allowed to keep waiting at
any one time during the session.
|
int |
getInactivityTimeout()
Returns the time, in seconds, after which this session will be considered inactive and
terminated.
|
long |
getLastAcknowledged()
Returns the highest 'rid' attribute the server has received where it has also received
all requests with lower 'rid' values.
|
long |
getLastActivity()
Returns the time in milliseconds since the epoch that this session was last active.
|
int |
getMajorVersion()
Returns the major version of BOSH which this session utilizes.
|
int |
getMaxPause()
Returns the maximum length of a temporary session pause (in seconds) that the client MAY
request.
|
int |
getMaxPollingInterval()
Returns the max interval within which a client can send polling requests.
|
int |
getMaxRequests()
Returns the max number of requests it is permissible for this session to have open at any one
time.
|
int |
getMinorVersion()
Returns the major version of BOSH which this session utilizes.
|
X509Certificate[] |
getPeerCertificates()
Return the X509Certificates associated with this session.
|
int |
getWait()
Specifies the longest time (in seconds) that the connection manager is allowed to wait before
responding to any request during the session.
|
boolean |
isClosed()
Returns true if this session has been closed and no longer actively accepting connections.
|
boolean |
isPollingSession()
Returns true if this session is a polling session.
|
boolean |
isSecure()
Returns true if all connections on this session should be secured, and false if they should
not.
|
void |
pause(int duration)
Pauses the session for the given amount of time.
|
void |
removeSessionCloseListener(SessionListener listener)
Removes a
SessionListener from this session. |
void |
resetInactivityTimeout()
Resets the inactivity timeout of this session to default.
|
protected void |
sendPendingPackets()
This methods sends any pending packets in the session.
|
void |
setDefaultInactivityTimeout(int defaultInactivityTimeout)
Sets the default inactivity timeout of this session.
|
void |
setHold(int hold)
Specifies the maximum number of requests the connection manager is allowed to keep waiting at
any one time during the session.
|
void |
setInactivityTimeout(int inactivityTimeout)
Sets the time, in seconds, after which this session will be considered inactive and be be
terminated.
|
void |
setLastResponseEmpty(boolean lastResponseEmpty)
lastResponseEmpty true if last response of this session is an empty body element.
|
void |
setMajorVersion(int majorVersion)
Sets the major version of BOSH which the client implements.
|
void |
setMaxPause(int maxPause)
Sets the maximum length of a temporary session pause (in seconds) that the client MAY
request.
|
void |
setMaxPollingInterval(int maxPollingInterval)
Sets the max interval within which a client can send polling requests.
|
void |
setMaxRequests(int maxRequests)
The max number of requests it is permissible for this session to have open at any one time.
|
void |
setMinorVersion(int minorVersion)
Sets the minor version of BOSH which the client implements.
|
protected void |
setSecure(boolean isSecure)
Sets whether the initial request on the session was secure.
|
void |
setWait(int wait)
Specifies the longest time (in seconds) that the connection manager is allowed to wait before
responding to any request during the session.
|
canFloodOfflineMessages, canProcess, createSession, getActiveList, getAllowedAnonymIPs, getAllowedIPs, getAuthToken, getBlacklistedIPs, getDefaultList, getPresence, getUsername, getWhitelistedAnonymousIPs, getWhitelistedIPs, incrementConflictCount, isAddressInRange, isAllowed, isAllowedAnonymous, isAnonymousUser, isInitialized, isMessageCarbonsEnabled, isOfflineFloodStopped, setActiveList, setAllowedAnonymIPs, setAllowedIPs, setAnonymousAuth, setAuthToken, setAuthToken, setBlacklistedIPs, setDefaultList, setInitialized, setMessageCarbonsEnabled, setOfflineFloodStopped, setPresence, setWhitelistedAnonymousIPs, setWhitelistedIPs, toString, wasAvailabledecodeVersion, deliverRawText, getAddress, getCipherSuiteName, getConnection, getCreationDate, getHostAddress, getHostName, getLanguage, getLastActiveDate, getNumClientPackets, getNumServerPackets, getServerName, getSessionData, getStatus, getStreamID, getStreamManager, incrementClientPacketCount, incrementServerPacketCount, isUsingSelfSignedCertificate, process, removeSessionData, setAddress, setSessionData, setStatus, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdeliverRawText, getAddress, getCipherSuiteName, getCreationDate, getHostAddress, getHostName, getLanguage, getLastActiveDate, getNumClientPackets, getNumServerPackets, getServerName, getStatus, getStreamID, process, validatepublic HttpSession(PacketDeliverer backupDeliverer, String serverName, InetAddress address, StreamID streamID, long rid, HttpConnection connection, Locale language)
public Collection<org.dom4j.Element> getAvailableStreamFeaturesElements()
public String getAvailableStreamFeatures()
LocalSessiongetAvailableStreamFeatures in class LocalClientSessionpublic void close()
close in interface Sessionclose in class LocalSessionpublic boolean isClosed()
isClosed in interface SessionisClosed in class LocalSessionpublic void setWait(int wait)
wait - the longest time it is permissible to wait for a response.public int getWait()
public void setHold(int hold)
hold - the maximum number of simultaneous waiting requests.public int getHold()
public void setMaxPollingInterval(int maxPollingInterval)
maxPollingInterval - time in seconds a client needs to wait before sending polls to the
server, a negative int indicates that there is no limit.public int getMaxPollingInterval()
public void setMaxRequests(int maxRequests)
maxRequests - The max number of requests it is permissible for this session to have open
at any one time.public int getMaxRequests()
public void setMaxPause(int maxPause)
maxPause - the maximum length of a temporary session pause (in seconds) that the client
MAY request.public int getMaxPause()
public boolean isSecure()
isSecure in interface SessionisSecure in class LocalSessionpublic boolean isPollingSession()
public void addSessionCloseListener(SessionListener listener)
SessionListener to this session. The listener
will be notified of changes to the session.listener - the listener which is being added to the session.public void removeSessionCloseListener(SessionListener listener)
SessionListener from this session. The
listener will no longer be updated when an event occurs on the session.listener - the session listener that is to be removed.public void setDefaultInactivityTimeout(int defaultInactivityTimeout)
defaultInactivityTimeout - the default inactivity timeout of this session.pause(int)public void setInactivityTimeout(int inactivityTimeout)
inactivityTimeout - the time, in seconds, after which this session will be considered
inactive and be terminated.public void resetInactivityTimeout()
pause(int)public int getInactivityTimeout()
public void pause(int duration)
duration - the time, in seconds, after which this session will be considered inactive
and terminated.public long getLastActivity()
public long getLastAcknowledged()
public void setMajorVersion(int majorVersion)
majorVersion - the major version of BOSH which the client implements.public int getMajorVersion()
public void setMinorVersion(int minorVersion)
minorVersion - the minor version of BOSH which the client implements.public int getMinorVersion()
public void setLastResponseEmpty(boolean lastResponseEmpty)
lastResponseEmpty - true if last response of this session is an empty body element.protected void setSecure(boolean isSecure)
isSecure - true if the initial request was secure and false if it wasn't.public void forwardRequest(long rid,
boolean isSecure,
org.dom4j.Element rootNode,
javax.servlet.AsyncContext context)
throws HttpBindException,
HttpConnectionClosedException,
IOException
rid - the unique, sequential, requestID sent from the client.isSecure - true if the request was made over a secure channel, HTTPS, and false if it
was not.rootNode - the XML body of the request.context - the context of the asynchronous servlet call leading up to this method call.HttpBindException - for several reasons: if the encoding inside of an auth packet is
not recognized by the server, or if the packet type is not recognized.HttpConnectionClosedException - if the session is no longer available.IOExceptionprotected void sendPendingPackets()
public X509Certificate[] getPeerCertificates()
getPeerCertificates in interface SessiongetPeerCertificates in class LocalSessionpublic void deliver(org.xmpp.packet.Packet stanza)
deliver in class LocalClientSessionprotected String createEmptyBody(boolean terminate)
Copyright © 2003-2008 Jive Software.