Advertisement
scosaje

Untitled

Sep 21st, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. @Override
  2. public Object pushWorkFlowDirectToDroidClient(final Map<String, Object> notifParams) {
  3.  
  4. if (notifParams != null && !notifParams.isEmpty()) {
  5. final String targetServiceMethod =
  6. extractMethodToCallFromObject(notifParams);
  7. final RTMPClient client = new RTMPClient();
  8. client.connect("localhost", 1935, targetServiceMethod,
  9. new IPendingServiceCallback() {
  10. @Override
  11. public void resultReceived(IPendingServiceCall call) {
  12. Object payloadObj = null;
  13. System.err.println("Connected: " + call.getResult());
  14. if (notifParams.containsKey(MESSAGE_PAYLOAD_KEY)) {
  15. payloadObj = notifParams.get(MESSAGE_PAYLOAD_KEY);
  16. }
  17. if (payloadObj == null) {
  18. payloadObj = notifParams;
  19. }
  20. if(payloadObj==null){
  21. payloadObj = notifParams;
  22. }
  23. if (payloadObj != null) {
  24. client.invoke(targetServiceMethod,
  25. new Object[]{payloadObj},
  26. new IPendingServiceCallback() {
  27. @Override
  28. public void resultReceived(
  29. IPendingServiceCall call) {
  30. System.err.println("Received: "
  31. + call.getResult());
  32. }
  33. });
  34. }else{
  35.  
  36. }
  37. }
  38. });
  39. }
  40. return null;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement