Connection Manager 3.4.4 Javadoc

org.jivesoftware.multiplexer.net.http
Class HttpConnection

java.lang.Object
  extended by org.jivesoftware.multiplexer.net.http.HttpConnection

public class HttpConnection
extends java.lang.Object

A connection to a client. The client will wait on getDeliverable() until the server forwards a message to it or the wait time on the session timesout.

Author:
Alexander Wenckus

Constructor Summary
HttpConnection(long requestId, boolean isSecure)
           
 
Method Summary
 void close()
          The connection should be closed without delivering a stanza to the requestor.
 void deliverBody(java.lang.String body)
          Delivers content to the client.
 Connection.CompressionPolicy getCompressionPolicy()
           
 java.lang.String getDeliverable()
          A call that will cause a wait, or in the case of Jetty the thread to be freed, if there is no deliverable currently available.
 long getRequestId()
           
 HttpSession getSession()
          Returns the session that this connection belongs to.
 boolean isClosed()
           
 boolean isCompressed()
           
 boolean isSecure()
           
 void setCompressionPolicy(Connection.CompressionPolicy compressionPolicy)
           
 boolean validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpConnection

public HttpConnection(long requestId,
                      boolean isSecure)
Method Detail

validate

public boolean validate()

close

public void close()
The connection should be closed without delivering a stanza to the requestor.


isClosed

public boolean isClosed()

isSecure

public boolean isSecure()

deliverBody

public void deliverBody(java.lang.String body)
                 throws HttpConnectionClosedException
Delivers content to the client. The content should be valid XMPP wrapped inside of a body. A null value for body indicates that the connection should be closed and the client sent an empty body.

Parameters:
body - the XMPP content to be forwarded to the client inside of a body tag.
Throws:
HttpConnectionClosedException - when this connection to the client has already recieved a deliverable to forward to the client

getDeliverable

public java.lang.String getDeliverable()
                                throws org.jivesoftware.multiplexer.net.http.HttpBindTimeoutException
A call that will cause a wait, or in the case of Jetty the thread to be freed, if there is no deliverable currently available. Once the deliverable becomes available it is returned.

Returns:
the deliverable to send to the client
Throws:
HttpBindTimeoutException - to indicate that the maximum wait time requested by the client has been surpassed and an empty response should be returned.

isCompressed

public boolean isCompressed()

getCompressionPolicy

public Connection.CompressionPolicy getCompressionPolicy()

setCompressionPolicy

public void setCompressionPolicy(Connection.CompressionPolicy compressionPolicy)

getRequestId

public long getRequestId()

getSession

public HttpSession getSession()
Returns the session that this connection belongs to.

Returns:
the session that this connection belongs to.

Connection Manager 3.4.4 Javadoc

Copyright © 2003-2006 Jive Software.