|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface specifies all the methods a CommunicationsClient object must support allowing the details of the specific protocol used to be abstracted away.
CommunicationsObject| Method Summary | |
java.lang.String |
addRequestProtocol(java.lang.String data,
java.lang.String listener)
This abstract method adds the protocol to a request to be sent |
java.lang.String |
addRequestProtocol(java.lang.String data,
java.lang.String listener,
java.lang.String type)
This abstract method adds the protocol to a request to be sent |
DataObject |
getErrorMessage()
This abstract method generates an error message if a request can't be handled properly, to the point where a contextual error message can still be sent as the reply |
java.lang.String |
getFatalMessage()
This abstract method generates an fatal message if a request can't be handled properly, to the point where no contextual error message can be sent as the reply |
java.lang.String |
getProtocol()
Abstract method to get the communications protocol being used |
java.net.Socket |
sendRequest(java.lang.String request)
This abstract method sends a request |
RequestData |
stripReplyProtocol(java.net.Socket socket)
This abstract method strips the protocol away from the received reply |
| Method Detail |
public java.lang.String getProtocol()
public RequestData stripReplyProtocol(java.net.Socket socket)
throws ProtocolException
socket - The socket the reply is being received on
ProtocolException - thrown if protocol can't be stripped awayaddRequestProtocol(String,String),
CommunicationsServer.stripRequestProtocol(Socket),
CommunicationsServer.addReplyProtocol(String)
public java.lang.String addRequestProtocol(java.lang.String data,
java.lang.String listener)
throws ProtocolException
data - The request to add the protocol tolistener - The recipient of the request (eg, an URL in HTTP). May be null.
ProtocolException - thrown if protocol can't be addedstripReplyProtocol(Socket),
CommunicationsServer.stripRequestProtocol(Socket),
CommunicationsServer.addReplyProtocol(String)
public java.lang.String addRequestProtocol(java.lang.String data,
java.lang.String listener,
java.lang.String type)
throws ProtocolException
data - The request to add the protocol tolistener - The recipient of the request (eg, an URL in HTTP). May be null.type - The type of the request: GET or POST.
ProtocolException - thrown if protocol can't be addedstripReplyProtocol(Socket),
CommunicationsServer.stripRequestProtocol(Socket),
CommunicationsServer.addReplyProtocol(String)
public java.net.Socket sendRequest(java.lang.String request)
throws java.io.IOException
request - The request to send
java.io.IOExceptionpublic DataObject getErrorMessage()
getFatalMessage()public java.lang.String getFatalMessage()
getErrorMessage()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||