Package io.github.dephin.mdp
Class MDPClient
java.lang.Object
io.github.dephin.mdp.MDPClient
- All Implemented Interfaces:
MDPProtocol
public class MDPClient extends java.lang.Object implements MDPProtocol
-
Constructor Summary
Constructors Constructor Description MDPClient(java.lang.String uriStr, MDPHandler handler, java.util.Map<java.lang.String,java.lang.String> httpHeaders, int connectTimeout, long rpcTimeout) -
Method Summary
Modifier and Type Method Description org.json.JSONObjectcallRPC(java.lang.String event, org.json.JSONObject data)voidclose()voidconnect()voidonClose(int code, java.lang.String reason, boolean remote)voidonError(java.lang.Exception ex)voidonMessage(java.lang.String message)voidonOpen()voidsendError(java.lang.String err)voidsendEvent(java.lang.String event, org.json.JSONObject data)voidsendMessage(org.json.JSONObject msg)
-
Constructor Details
-
MDPClient
public MDPClient(java.lang.String uriStr, MDPHandler handler, java.util.Map<java.lang.String,java.lang.String> httpHeaders, int connectTimeout, long rpcTimeout)
-
-
Method Details
-
sendMessage
public void sendMessage(org.json.JSONObject msg)- Specified by:
sendMessagein interfaceMDPProtocol
-
sendEvent
public void sendEvent(java.lang.String event, org.json.JSONObject data)- Specified by:
sendEventin interfaceMDPProtocol
-
callRPC
public org.json.JSONObject callRPC(java.lang.String event, org.json.JSONObject data)- Specified by:
callRPCin interfaceMDPProtocol
-
sendError
public void sendError(java.lang.String err)- Specified by:
sendErrorin interfaceMDPProtocol
-
connect
public void connect()- Specified by:
connectin interfaceMDPProtocol
-
close
public void close()- Specified by:
closein interfaceMDPProtocol
-
onOpen
public void onOpen()- Specified by:
onOpenin interfaceMDPProtocol
-
onClose
public void onClose(int code, java.lang.String reason, boolean remote)- Specified by:
onClosein interfaceMDPProtocol
-
onError
public void onError(java.lang.Exception ex)- Specified by:
onErrorin interfaceMDPProtocol
-
onMessage
public void onMessage(java.lang.String message)- Specified by:
onMessagein interfaceMDPProtocol
-