|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.ic.doc.automed.p2p.communication.ResponseHandler
public class ResponseHandler
| Field Summary | |
|---|---|
static java.lang.String |
OUTPUT_SOCKET
|
static java.lang.String |
OUTPUT_STREAM
|
static java.lang.String |
REMOTE_ADDRESS
|
static java.lang.String |
REMOTE_PORT
|
static java.lang.String |
SRC_ADDRESS
|
| Constructor Summary | |
|---|---|
ResponseHandler(java.lang.String protocol,
java.util.Map handlerElements)
Creates a new instance of ResponseHandler |
|
| Method Summary | |
|---|---|
java.lang.String |
getRemoteAddress()
The address of the remote host to which this response is sent |
int |
getRemotePort()
The port on the remote host at which this response is targeted |
java.net.InetAddress |
getSourceAddress()
The address of this host used for sending response |
void |
serialiseOutput(AbstractMessage response)
|
void |
serialiseUDPOutput(byte[] response)
Serialise bytes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String OUTPUT_STREAM
public static final java.lang.String OUTPUT_SOCKET
public static final java.lang.String REMOTE_ADDRESS
public static final java.lang.String REMOTE_PORT
public static final java.lang.String SRC_ADDRESS
| Constructor Detail |
|---|
public ResponseHandler(java.lang.String protocol,
java.util.Map handlerElements)
protocol - communication protocol to use (see #Constants)elements - map of elements which help serialise the response (dependent on protocol)OUTPUT_STREAM --> OutputStream object
OUTPUT_SOCKET --> DatagramSocket object
REMOTE_ADDRESS --> InetAddress of the remote host
REMOTE_PORT --> an integer indicating remote port
| Method Detail |
|---|
public void serialiseOutput(AbstractMessage response)
throws CommunicationException
CommunicationException
public void serialiseUDPOutput(byte[] response)
throws CommunicationException
CommunicationExceptionpublic java.net.InetAddress getSourceAddress()
public java.lang.String getRemoteAddress()
public int getRemotePort()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||