|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface specifies all the methods a CommunicationsServer object must support allowing the details of the specific protocol used to be abstracted away.
CommunicationsObject
Method Summary | |
java.lang.String |
addReplyProtocol(java.lang.String reply)
This abstract method strips the protocol away from the received request |
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 |
void |
handleIncomingRequest(java.net.Socket socket)
This abstract method handles incoming requests on a given socket |
void |
quit()
Abstract method to call when stopping a CommunicationsServer object |
void |
start()
Abstract method to call when starting a CommunicationsServer object |
RequestData |
stripRequestProtocol(java.net.Socket socket)
This abstract method strips the protocol away from the received request |
Method Detail |
public void start()
public void quit()
public java.lang.String getProtocol()
public RequestData stripRequestProtocol(java.net.Socket socket) throws ProtocolException
socket
- The socket the request is being received on
ProtocolException
- thrown if protocol can't be stripped awayaddReplyProtocol(String)
,
CommunicationsClient.addRequestProtocol(String,String)
,
CommunicationsClient.stripReplyProtocol(java.net.Socket)
public java.lang.String addReplyProtocol(java.lang.String reply) throws ProtocolException
reply
- The reply to add the protocol to
ProtocolException
- thrown if protocol can't be addedstripRequestProtocol(java.net.Socket)
,
CommunicationsClient.addRequestProtocol(String,String)
,
CommunicationsClient.stripReplyProtocol(java.net.Socket)
public void handleIncomingRequest(java.net.Socket socket)
socket
- The socket requests are coming in onpublic 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 |