diff --git a/openvidu-js-java/pom.xml b/openvidu-js-java/pom.xml index 00681637..244400a4 100644 --- a/openvidu-js-java/pom.xml +++ b/openvidu-js-java/pom.xml @@ -1,14 +1,15 @@ - 4.0.0 io.openvidu openvidu-js-java - 2.7.0 + 2.8.0 jar openvidu-js-java - http://maven.apache.org + https://github.com/OpenVidu/openvidu-tutorials/tree/master/openvidu-js-java org.springframework.boot diff --git a/openvidu-mvc-java/pom.xml b/openvidu-mvc-java/pom.xml index c0e4a83b..cd807cb8 100644 --- a/openvidu-mvc-java/pom.xml +++ b/openvidu-mvc-java/pom.xml @@ -1,10 +1,11 @@ - 4.0.0 io.openvidu openvidu-mvc-java - 2.5.0 + 2.8.0 jar openvidu-mvc-java diff --git a/openvidu-mvc-java/src/main/java/io/openvidu/mvc/java/LoginController.java b/openvidu-mvc-java/src/main/java/io/openvidu/mvc/java/LoginController.java index 00ed026d..09a8aa19 100644 --- a/openvidu-mvc-java/src/main/java/io/openvidu/mvc/java/LoginController.java +++ b/openvidu-mvc-java/src/main/java/io/openvidu/mvc/java/LoginController.java @@ -49,28 +49,27 @@ public class LoginController { @RequestMapping(value = "/dashboard", method = { RequestMethod.GET, RequestMethod.POST }) public String login(@RequestParam(name = "user", required = false) String user, - @RequestParam(name = "pass", required = false) String pass, - Model model, HttpSession httpSession) { + @RequestParam(name = "pass", required = false) String pass, Model model, HttpSession httpSession) { // Check if the user is already logged in String userName = (String) httpSession.getAttribute("loggedUser"); - if (userName != null) { + if (userName != null) { // User is already logged. Immediately return dashboard model.addAttribute("username", userName); return "dashboard"; } - + // User wasn't logged and wants to if (login(user, pass)) { // Correct user-pass - - // Validate session and return OK + + // Validate session and return OK // Value stored in HttpSession allows us to identify the user in future requests httpSession.setAttribute("loggedUser", user); model.addAttribute("username", user); - + // Return dashboard.html template return "dashboard"; - + } else { // Wrong user-pass // Invalidate session and redirect to index.html httpSession.invalidate(); diff --git a/openvidu-mvc-java/src/main/java/io/openvidu/mvc/java/SessionController.java b/openvidu-mvc-java/src/main/java/io/openvidu/mvc/java/SessionController.java index a43ff640..55939d30 100644 --- a/openvidu-mvc-java/src/main/java/io/openvidu/mvc/java/SessionController.java +++ b/openvidu-mvc-java/src/main/java/io/openvidu/mvc/java/SessionController.java @@ -32,7 +32,6 @@ public class SessionController { private String OPENVIDU_URL; // Secret shared with our OpenVidu server private String SECRET; - public SessionController(@Value("${openvidu.secret}") String secret, @Value("${openvidu.url}") String openviduUrl) { this.SECRET = secret; @@ -53,7 +52,7 @@ public class SessionController { // Role associated to this user OpenViduRole role = LoginController.users.get(httpSession.getAttribute("loggedUser")).role; - + // Optional data to be passed to other users when this user connects to the video-call // In this case, a JSON with the value we stored in the HttpSession object on login String serverData = "{\"serverData\": \"" + httpSession.getAttribute("loggedUser") + "\"}"; @@ -65,10 +64,10 @@ public class SessionController { // Session already exists System.out.println("Existing session " + sessionName); try { - + // Generate a new token with the recently created tokenOptions String token = this.mapSessions.get(sessionName).generateToken(tokenOptions); - + // Update our collection storing the new token this.mapSessionNamesTokens.get(sessionName).put(token, role); @@ -80,7 +79,7 @@ public class SessionController { // Return session.html template return "session"; - + } catch (Exception e) { // If error just return dashboard.html template model.addAttribute("username", httpSession.getAttribute("loggedUser")); @@ -90,7 +89,7 @@ public class SessionController { // New session System.out.println("New session " + sessionName); try { - + // Create a new OpenVidu Session Session session = this.openVidu.createSession(); // Generate a new token with the recently created tokenOptions @@ -109,7 +108,7 @@ public class SessionController { // Return session.html template return "session"; - + } catch (Exception e) { // If error just return dashboard.html template model.addAttribute("username", httpSession.getAttribute("loggedUser")); @@ -131,7 +130,7 @@ public class SessionController { // If the session exists ("TUTORIAL" in this case) if (this.mapSessions.get(sessionName) != null && this.mapSessionNamesTokens.get(sessionName) != null) { - + // If the token exists if (this.mapSessionNamesTokens.get(sessionName).remove(token) != null) { // User left the session @@ -140,13 +139,13 @@ public class SessionController { this.mapSessions.remove(sessionName); } return "redirect:/dashboard"; - + } else { // The TOKEN wasn't valid System.out.println("Problems in the app server: the TOKEN wasn't valid"); return "redirect:/dashboard"; } - + } else { // The SESSION does not exist System.out.println("Problems in the app server: the SESSION does not exist"); diff --git a/openvidu-recording-java/pom.xml b/openvidu-recording-java/pom.xml index cf2e68a3..78394200 100644 --- a/openvidu-recording-java/pom.xml +++ b/openvidu-recording-java/pom.xml @@ -5,11 +5,11 @@ io.openvidu openvidu-recording-java - 2.2.0 + 2.8.0 jar openvidu-recording-java - http://maven.apache.org + https://github.com/OpenVidu/openvidu-tutorials/tree/master/openvidu-recording-java org.springframework.boot @@ -63,7 +63,6 @@ org.springframework.boot spring-boot-starter-web - org.springframework.boot spring-boot-devtools @@ -73,7 +72,6 @@ openvidu-java-client 2.8.1 - org.junit.jupiter junit-jupiter-api @@ -107,19 +105,17 @@ 23.0 test - - ws.schild jave-all-deps 2.4.5 + test ws.schild jave-core 2.4.5 + test