com.caucho.cloud.hmtp
Class HmtpRequest

java.lang.Object
  extended by com.caucho.network.listen.AbstractProtocolConnection
      extended by com.caucho.cloud.hmtp.HmtpRequest
All Implemented Interfaces:
ProtocolConnection

public class HmtpRequest
extends AbstractProtocolConnection

Handles HMTP requests from a peer server. If the request does not match one of the HMTP codes, it the HmtpRequest will forward to the HMUX request for compatibility.


Field Summary
static int HMUX_HMTP_OK
           
static int HMUX_SWITCH_TO_HMTP
           
static int HMUX_TO_UNIDIR_HMTP
           
 
Constructor Summary
HmtpRequest(SocketLink conn, BamSystem bamService)
           
 
Method Summary
 java.lang.String dbgId()
           
protected  java.lang.String getRequestId()
           
 boolean handleRequest()
          Handles a new connection.
 boolean isWaitForRead()
          Return true if the connection should wait for a read before handling the request.
 void onCloseConnection()
          Close when the socket closes.
 void onStartConnection()
          Called when the connection starts, i.e.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.network.listen.AbstractProtocolConnection
getProtocolRequestURL, handleResume, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HMUX_TO_UNIDIR_HMTP

public static final int HMUX_TO_UNIDIR_HMTP
See Also:
Constant Field Values

HMUX_SWITCH_TO_HMTP

public static final int HMUX_SWITCH_TO_HMTP
See Also:
Constant Field Values

HMUX_HMTP_OK

public static final int HMUX_HMTP_OK
See Also:
Constant Field Values
Constructor Detail

HmtpRequest

public HmtpRequest(SocketLink conn,
                   BamSystem bamService)
Method Detail

isWaitForRead

public boolean isWaitForRead()
Description copied from interface: ProtocolConnection
Return true if the connection should wait for a read before handling the request.


onStartConnection

public void onStartConnection()
Description copied from interface: ProtocolConnection
Called when the connection starts, i.e. just after the accept

Specified by:
onStartConnection in interface ProtocolConnection
Overrides:
onStartConnection in class AbstractProtocolConnection

handleRequest

public boolean handleRequest()
                      throws java.io.IOException
Description copied from class: AbstractProtocolConnection
Handles a new connection. The controlling TcpServer may call handleConnection again after the connection completes, so the implementation must initialize any variables for each connection.

Specified by:
handleRequest in interface ProtocolConnection
Specified by:
handleRequest in class AbstractProtocolConnection
Throws:
java.io.IOException

onCloseConnection

public void onCloseConnection()
Close when the socket closes.

Specified by:
onCloseConnection in interface ProtocolConnection
Overrides:
onCloseConnection in class AbstractProtocolConnection

getRequestId

protected java.lang.String getRequestId()

dbgId

public final java.lang.String dbgId()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object