Interface MsgSender
-
- All Known Implementing Classes:
DefaultHTTPMsgSender
public interface MsgSenderInterface to send and receive request and response messages to an end point. Created by Philip Vendil on 16/06/16.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceMsgSender.MsgCallbackMessage callback interface for receiving response data or errors.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]sendMsg(byte[] request)Method to syncronically send a request and wait for a response.voidsendMsg(byte[] request, MsgSender.MsgCallback callback)Method to asyncronically send a request and response (or error) is signaled through callback.booleantestConnection()Method to check the connection
-
-
-
Method Detail
-
sendMsg
byte[] sendMsg(byte[] request) throws MessageContentException, MessageProcessingException, java.io.IOException, SpamProtectionExceptionMethod to syncronically send a request and wait for a response. I.e the method will wait for the response from the client.- Parameters:
request- the request message to send.- Returns:
- the response message to receive.
- Throws:
MessageContentException- if content of the request was illegal.MessageProcessingException- if internal problems occurred processing the request.java.io.IOException- if communication problems occurred.SpamProtectionException- if server side regarded call as a SPAM request and denied it.
-
sendMsg
void sendMsg(byte[] request, MsgSender.MsgCallback callback)Method to asyncronically send a request and response (or error) is signaled through callback.- Parameters:
request- the request to send.callback- the callback to signal when the reply is recieved.
-
testConnection
boolean testConnection()
Method to check the connection- Returns:
- true, if connection works.
-
-