com.caucho.hmtp
Class HmtpWriter

java.lang.Object
  extended by com.caucho.hmtp.HmtpWriter

public class HmtpWriter
extends java.lang.Object

HmtpWriteStream writes HMTP packets to an OutputStream.


Constructor Summary
HmtpWriter()
           
 
Method Summary
 void close()
           
 void flush()
           
 java.lang.String getAddress()
          The address of the stream
protected  void init(java.io.OutputStream os)
           
 void message(java.io.OutputStream os, java.lang.String to, java.lang.String from, java.io.Serializable payload)
          Sends a message to a given address
 void messageError(java.io.OutputStream os, java.lang.String to, java.lang.String from, java.io.Serializable value, BamError error)
          Sends a message error to a given address
 void query(java.io.OutputStream os, long id, java.lang.String to, java.lang.String from, java.io.Serializable value)
          Low-level query
 void queryError(java.io.OutputStream os, long id, java.lang.String to, java.lang.String from, java.io.Serializable value, BamError error)
          Low-level query error
 void queryResult(java.io.OutputStream os, long id, java.lang.String to, java.lang.String from, java.io.Serializable value)
          Low-level query response
 void setAddress(java.lang.String address)
          The address of the stream
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HmtpWriter

public HmtpWriter()
Method Detail

init

protected void init(java.io.OutputStream os)

getAddress

public java.lang.String getAddress()
The address of the stream


setAddress

public void setAddress(java.lang.String address)
The address of the stream


message

public void message(java.io.OutputStream os,
                    java.lang.String to,
                    java.lang.String from,
                    java.io.Serializable payload)
             throws java.io.IOException
Sends a message to a given address

Parameters:
os - the output stream for the message
to - the address of the target actor
from - the address of the source actor
payload - the message payload
Throws:
java.io.IOException

messageError

public void messageError(java.io.OutputStream os,
                         java.lang.String to,
                         java.lang.String from,
                         java.io.Serializable value,
                         BamError error)
                  throws java.io.IOException
Sends a message error to a given address

Throws:
java.io.IOException

query

public void query(java.io.OutputStream os,
                  long id,
                  java.lang.String to,
                  java.lang.String from,
                  java.io.Serializable value)
           throws java.io.IOException
Low-level query

Throws:
java.io.IOException

queryResult

public void queryResult(java.io.OutputStream os,
                        long id,
                        java.lang.String to,
                        java.lang.String from,
                        java.io.Serializable value)
                 throws java.io.IOException
Low-level query response

Throws:
java.io.IOException

queryError

public void queryError(java.io.OutputStream os,
                       long id,
                       java.lang.String to,
                       java.lang.String from,
                       java.io.Serializable value,
                       BamError error)
                throws java.io.IOException
Low-level query error

Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

close

public void close()

toString

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