BAEL-3352 - Websockets with the Play Framework and Akka (#7983)
* Websocket implementation * Websocket implementation with Akka Streams * Websocket implementation with Akka Streams * Websocket implementation with Akka Streams * Added configuration options for play server timeout and websocket frame lengths * Cleaned up code for consuming http endpoint in Messenger actor * Cleaned up code for consuming http endpoint in Messenger actor * Cleaned up code for akka streams implementation for websocket * Renamed unit test method * Added Poison Pill for stopping the actor. Fixed indentations. * Refactored the WebSocket method for readability * Refactored the JavaScript for readability * Code refactoring and removing unwanted comments * Added the latest version of jQuery * Removed .gitignore in favor of the one at the project root
This commit is contained in:
committed by
ashleyfrieze
parent
13c42ac4dc
commit
59ac0633fc
@@ -0,0 +1,24 @@
|
||||
package utils;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import dto.MessageDTO;
|
||||
import dto.RequestDTO;
|
||||
|
||||
public class MessageConverter {
|
||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||
public static MessageDTO jsonNodeToMessage(JsonNode jsonNode) {
|
||||
return OBJECT_MAPPER.convertValue(jsonNode, MessageDTO.class);
|
||||
}
|
||||
|
||||
public static JsonNode messageToJsonNode(MessageDTO messageDTO) {
|
||||
return OBJECT_MAPPER.convertValue(messageDTO, JsonNode.class);
|
||||
}
|
||||
public static RequestDTO jsonNodeToRequest(JsonNode jsonNode) {
|
||||
return OBJECT_MAPPER.convertValue(jsonNode, RequestDTO.class);
|
||||
}
|
||||
|
||||
public static JsonNode requestToJsonNode(RequestDTO requestDTO) {
|
||||
return OBJECT_MAPPER.convertValue(requestDTO, JsonNode.class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user