| | |
| | | |
| | | public static final String CALLBACK_CMD_PLAY = "CALLBACK_PLAY"; |
| | | |
| | | public static final String CALLBACK_CMD_PLAYBACK = "CALLBACK_PLAY"; |
| | | public static final String CALLBACK_CMD_PLAYBACK = "CALLBACK_PLAYBACK"; |
| | | |
| | | public static final String CALLBACK_CMD_DOWNLOAD = "CALLBACK_DOWNLOAD"; |
| | | |
| | |
| | | |
| | | public DeferredResult get(String key, String id) { |
| | | Map<String, DeferredResult> deferredResultMap = map.get(key); |
| | | if (deferredResultMap == null) return null; |
| | | if (deferredResultMap == null) { |
| | | return null; |
| | | } |
| | | return deferredResultMap.get(id); |
| | | } |
| | | |
| | | public boolean exist(String key, String id){ |
| | | if (key == null) return false; |
| | | if (key == null) { |
| | | return false; |
| | | } |
| | | Map<String, DeferredResult> deferredResultMap = map.get(key); |
| | | if (id == null) { |
| | | return deferredResultMap != null; |
| | |
| | | if (result == null) { |
| | | return; |
| | | } |
| | | result.setResult(new ResponseEntity<>(msg.getData(),HttpStatus.OK)); |
| | | result.setResult(msg.getData()); |
| | | deferredResultMap.remove(msg.getId()); |
| | | if (deferredResultMap.size() == 0) { |
| | | map.remove(msg.getKey()); |
| | |
| | | if (result == null) { |
| | | return; |
| | | } |
| | | result.setResult(ResponseEntity.ok().body(msg.getData())); |
| | | result.setResult(msg.getData()); |
| | | } |
| | | map.remove(msg.getKey()); |
| | | |
| | | } |
| | | } |