Connection Manager 3.4.4 Javadoc

org.jivesoftware.multiplexer.net.http
Class HttpSession

java.lang.Object
  extended by org.jivesoftware.multiplexer.Session
      extended by org.jivesoftware.multiplexer.net.http.HttpSession

public class HttpSession
extends Session

A session represents a serious of interactions with an XMPP client sending packets using the HTTP Binding protocol specified in XEP-0124. A session can have several client connections open simultaneously while awaiting packets bound for the client from the server.

Author:
Alexander Wenckus

Field Summary
 
Fields inherited from class org.jivesoftware.multiplexer.Session
CHARSET, conn, idFactory, MAJOR_VERSION, MINOR_VERSION, status, STATUS_AUTHENTICATED, STATUS_CLOSED, STATUS_CONNECTED, STATUS_STREAMING
 
Constructor Summary
protected HttpSession(java.lang.String serverName, java.lang.String streamID)
           
 
Method Summary
 void addSessionCloseListener(SessionListener listener)
           
 void close()
          Indicate the server that the session has been closed.
 void close(boolean isServerShuttingDown)
           
 void deliver(org.dom4j.Element stanza)
           
 java.lang.String getAvailableStreamFeatures()
          Returns a text with the available stream features.
 int getConnectionCount()
           
 int getHold()
          This attribute specifies the maximum number of requests the connection manager is allowed to keep waiting at any one time during the session.
 int getInactivityTimeout()
           
 java.lang.String getLanguage()
           
 int getWait()
          This attribute specifies the longest time (in seconds) that the connection manager is allowed to wait before responding to any request during the session.
 boolean isClosed()
           
 boolean isSecure()
          Returns true if all connections on this session should be secured, and false if they should not.
 void removeSessionCloseListener(SessionListener listener)
           
 void setHold(int hold)
          This attribute 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)
           
 void setLanaguage(java.lang.String language)
           
 void setMaxPollingInterval(int maxPollingInterval)
          Sets the max interval within which a client can send polling requests.
protected  void setSecure(boolean isSecure)
          Sets whether the initial request on the session was secure.
 void setWait(int wait)
          This attribute specifies the longest time (in seconds) that the connection manager is allowed to wait before responding to any request during the session.
 
Methods inherited from class org.jivesoftware.multiplexer.Session
addSession, closeAll, decodeVersion, getCreationDate, getServerName, getSession, getStatus, getStreamID, removeSession, setStatus, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpSession

protected HttpSession(java.lang.String serverName,
                      java.lang.String streamID)
Method Detail

getAvailableStreamFeatures

public java.lang.String getAvailableStreamFeatures()
Description copied from class: Session
Returns a text with the available stream features. Each subclass may return different values depending whether the session has been authenticated or not.

Specified by:
getAvailableStreamFeatures in class Session
Returns:
a text with the available stream features or null to add nothing.

close

public void close()
Description copied from class: Session
Indicate the server that the session has been closed. Do nothing if the session was the one that originated the close action.

Specified by:
close in class Session

close

public void close(boolean isServerShuttingDown)
Specified by:
close in class Session

isClosed

public boolean isClosed()
Specified by:
isClosed in class Session

deliver

public void deliver(org.dom4j.Element stanza)
Specified by:
deliver in class Session

setWait

public void setWait(int wait)
This attribute specifies the longest time (in seconds) that the connection manager is allowed to wait before responding to any request during the session. This enables the client to prevent its TCP connection from expiring due to inactivity, as well as to limit the delay before it discovers any network failure.

Parameters:
wait - the longest time it is permissible to wait for a response.

getWait

public int getWait()
This attribute specifies the longest time (in seconds) that the connection manager is allowed to wait before responding to any request during the session. This enables the client to prevent its TCP connection from expiring due to inactivity, as well as to limit the delay before it discovers any network failure.

Returns:
the longest time it is permissible to wait for a response.

setHold

public void setHold(int hold)
This attribute specifies the maximum number of requests the connection manager is allowed to keep waiting at any one time during the session. (For example, if a constrained client is unable to keep open more than two HTTP connections to the same HTTP server simultaneously, then it SHOULD specify a value of "1".)

Parameters:
hold - the maximum number of simultaneous waiting requests.

getHold

public int getHold()
This attribute specifies the maximum number of requests the connection manager is allowed to keep waiting at any one time during the session. (For example, if a constrained client is unable to keep open more than two HTTP connections to the same HTTP server simultaneously, then it SHOULD specify a value of "1".)

Returns:
the maximum number of simultaneous waiting requests

setLanaguage

public void setLanaguage(java.lang.String language)

getLanguage

public java.lang.String getLanguage()

setMaxPollingInterval

public void setMaxPollingInterval(int maxPollingInterval)
Sets the max interval within which a client can send polling requests. If more than one request occurs in the interval the session will be terminated.

Parameters:
maxPollingInterval - time in seconds a client needs to wait before sending polls to the server, a negative int indicates that there is no limit.

setSecure

protected void setSecure(boolean isSecure)
Sets whether the initial request on the session was secure.

Parameters:
isSecure - true if the initial request was secure and false if it wasn't.

isSecure

public boolean isSecure()
Returns true if all connections on this session should be secured, and false if they should not.

Returns:
true if all connections on this session should be secured, and false if they should not.

addSessionCloseListener

public void addSessionCloseListener(SessionListener listener)

removeSessionCloseListener

public void removeSessionCloseListener(SessionListener listener)

setInactivityTimeout

public void setInactivityTimeout(int inactivityTimeout)

getInactivityTimeout

public int getInactivityTimeout()

getConnectionCount

public int getConnectionCount()

Connection Manager 3.4.4 Javadoc

Copyright © 2003-2006 Jive Software.