diff --git a/src/main/java/de/thm/arsnova/CASLogoutSuccessHandler.java b/src/main/java/de/thm/arsnova/CASLogoutSuccessHandler.java index 074832b300e853ea587b6144b2c002a45f683d53..a7ce378f47f81342050fa111a0f2da5ebc51280d 100644 --- a/src/main/java/de/thm/arsnova/CASLogoutSuccessHandler.java +++ b/src/main/java/de/thm/arsnova/CASLogoutSuccessHandler.java @@ -34,7 +34,7 @@ import java.io.IOException; */ public class CASLogoutSuccessHandler implements LogoutSuccessHandler { - public static final Logger LOGGER = LoggerFactory.getLogger(CASLogoutSuccessHandler.class); + public static final Logger logger = LoggerFactory.getLogger(CASLogoutSuccessHandler.class); private String casUrl; private String defaultTarget; @@ -50,7 +50,7 @@ public class CASLogoutSuccessHandler implements LogoutSuccessHandler { /* Typo in "referer" intended. It is in the spec. */ String referrer = request.getHeader("referer"); if (response.isCommitted()) { - LOGGER.info("Response has already been committed. Unable to redirect to target"); + logger.info("Response has already been committed. Unable to redirect to target"); return; } redirectStrategy.sendRedirect( diff --git a/src/main/java/de/thm/arsnova/ImageUtils.java b/src/main/java/de/thm/arsnova/ImageUtils.java index 0203e2a148fdac38f2f2d7a4aacf083af9a3ddc5..5d4fc27aa4d93aba28679ddb8420fcc316fecf43 100644 --- a/src/main/java/de/thm/arsnova/ImageUtils.java +++ b/src/main/java/de/thm/arsnova/ImageUtils.java @@ -56,7 +56,7 @@ public class ImageUtils { /* default value is 200 pixel in height, set the value in the configuration file */ static final int THUMB_HEIGHT_DEFAULT = 200; - public static final Logger LOGGER = LoggerFactory.getLogger(ImageUtils.class); + public static final Logger logger = LoggerFactory.getLogger(ImageUtils.class); @Value("${imageupload.thumbnail.width}") private int thumbWidth = THUMB_WIDTH_DEFAULT; @@ -200,7 +200,7 @@ public class ImageUtils { return result.toString(); } catch (IOException e) { - LOGGER.error(e.getLocalizedMessage()); + logger.error(e.getLocalizedMessage()); return null; } } @@ -248,7 +248,7 @@ public class ImageUtils { return baos.toByteArray(); } catch (IOException e) { - LOGGER.error(e.getLocalizedMessage()); + logger.error(e.getLocalizedMessage()); } return null; diff --git a/src/main/java/de/thm/arsnova/LoginAuthenticationFailureHandler.java b/src/main/java/de/thm/arsnova/LoginAuthenticationFailureHandler.java index 34792b3b2d56a99932df3d1fe82ea50d0d9ba47e..f3f4298751c83d7fa410272ff28bb3a729216453 100644 --- a/src/main/java/de/thm/arsnova/LoginAuthenticationFailureHandler.java +++ b/src/main/java/de/thm/arsnova/LoginAuthenticationFailureHandler.java @@ -17,8 +17,6 @@ */ package de.thm.arsnova; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.security.core.AuthenticationException; import org.springframework.security.web.DefaultRedirectStrategy; import org.springframework.security.web.RedirectStrategy; @@ -40,8 +38,6 @@ public class LoginAuthenticationFailureHandler extends private final RedirectStrategy redirectStrategy = new DefaultRedirectStrategy(); private String failureUrl; - public static final Logger LOGGER = LoggerFactory.getLogger(LoginAuthenticationFailureHandler.class); - @Override public void onAuthenticationFailure( final HttpServletRequest request, diff --git a/src/main/java/de/thm/arsnova/LoginAuthenticationSucessHandler.java b/src/main/java/de/thm/arsnova/LoginAuthenticationSucessHandler.java index f84cdaf5698d934e2ed10717817c487c84bbbbaf..714578ee6ef33665a588ae9443b495da91a8c2d3 100644 --- a/src/main/java/de/thm/arsnova/LoginAuthenticationSucessHandler.java +++ b/src/main/java/de/thm/arsnova/LoginAuthenticationSucessHandler.java @@ -17,8 +17,6 @@ */ package de.thm.arsnova; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler; import javax.servlet.http.HttpServletRequest; @@ -33,8 +31,6 @@ public class LoginAuthenticationSucessHandler extends private String targetUrl; - public static final Logger LOGGER = LoggerFactory.getLogger(LoginAuthenticationSucessHandler.class); - @Override protected String determineTargetUrl( final HttpServletRequest request, diff --git a/src/main/java/de/thm/arsnova/controller/AudienceQuestionController.java b/src/main/java/de/thm/arsnova/controller/AudienceQuestionController.java index 7aec9eb6789421d943e32c8325714d68afaad002..2de2dc3638733d9ded5968821bbc7ea6a3233510 100644 --- a/src/main/java/de/thm/arsnova/controller/AudienceQuestionController.java +++ b/src/main/java/de/thm/arsnova/controller/AudienceQuestionController.java @@ -28,8 +28,6 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PathVariable; @@ -50,8 +48,6 @@ import java.util.List; @Api(value = "/audiencequestion", description = "the Audience Question API") public class AudienceQuestionController extends PaginationController { - public static final Logger LOGGER = LoggerFactory.getLogger(AudienceQuestionController.class); - @Autowired private IQuestionService questionService; diff --git a/src/main/java/de/thm/arsnova/controller/ConfigurationController.java b/src/main/java/de/thm/arsnova/controller/ConfigurationController.java index 75970e43f7728e11bf6b5b3a3d4ce03f291f07fe..134eda8b4852996d10aad1a0a9ae1f21223c5328 100644 --- a/src/main/java/de/thm/arsnova/controller/ConfigurationController.java +++ b/src/main/java/de/thm/arsnova/controller/ConfigurationController.java @@ -36,7 +36,7 @@ import java.util.HashMap; @Controller @RequestMapping({"/configuration", "/arsnova-config"}) public class ConfigurationController extends AbstractController { - public static final Logger LOGGER = LoggerFactory + public static final Logger logger = LoggerFactory .getLogger(ConfigurationController.class); @Value("${api.path:}") diff --git a/src/main/java/de/thm/arsnova/controller/CourseController.java b/src/main/java/de/thm/arsnova/controller/CourseController.java index adc24428e62964f6d32516984c3daf9844d34826..f213fcd95b171290461f03673d8ce32307016277 100644 --- a/src/main/java/de/thm/arsnova/controller/CourseController.java +++ b/src/main/java/de/thm/arsnova/controller/CourseController.java @@ -45,7 +45,7 @@ import java.util.List; @RestController public class CourseController extends AbstractController { - public static final Logger LOGGER = LoggerFactory.getLogger(CourseController.class); + public static final Logger logger = LoggerFactory.getLogger(CourseController.class); @Autowired(required = false) private ConnectorClient connectorClient; diff --git a/src/main/java/de/thm/arsnova/controller/FeedbackController.java b/src/main/java/de/thm/arsnova/controller/FeedbackController.java index 5a60f2ed1671504be549a24d5c0f0ddfa6269112..a0fc5a6f793844b4e8adabaaf01080bb03aad1b1 100644 --- a/src/main/java/de/thm/arsnova/controller/FeedbackController.java +++ b/src/main/java/de/thm/arsnova/controller/FeedbackController.java @@ -43,7 +43,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController public class FeedbackController extends AbstractController { - public static final Logger LOGGER = LoggerFactory.getLogger(FeedbackController.class); + public static final Logger logger = LoggerFactory.getLogger(FeedbackController.class); @Autowired private IFeedbackService feedbackService; diff --git a/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java b/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java index 8ce847445867e2d75e622dc4515851f368abfd86..23acef6d44b2501788beb0dab49cc32d89457cb3 100644 --- a/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java +++ b/src/main/java/de/thm/arsnova/controller/LecturerQuestionController.java @@ -56,7 +56,7 @@ import java.util.List; @Api(value = "/lecturerquestion", description = "Operations for Lecture Questions") public class LecturerQuestionController extends PaginationController { - public static final Logger LOGGER = LoggerFactory.getLogger(LecturerQuestionController.class); + public static final Logger logger = LoggerFactory.getLogger(LecturerQuestionController.class); @Autowired private IQuestionService questionService; diff --git a/src/main/java/de/thm/arsnova/controller/LegacyController.java b/src/main/java/de/thm/arsnova/controller/LegacyController.java index c7a96a53c2372a6d94cd6fb86979d1c5c9ec79ba..c9f809c63b73415f788860754cec0716d9c2be90 100644 --- a/src/main/java/de/thm/arsnova/controller/LegacyController.java +++ b/src/main/java/de/thm/arsnova/controller/LegacyController.java @@ -19,8 +19,6 @@ package de.thm.arsnova.controller; import de.thm.arsnova.services.IQuestionService; import de.thm.arsnova.web.DeprecatedApi; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; @@ -34,8 +32,6 @@ import org.springframework.web.bind.annotation.ResponseBody; @Controller public class LegacyController extends AbstractController { - public static final Logger LOGGER = LoggerFactory.getLogger(LegacyController.class); - @Autowired private IQuestionService questionService; diff --git a/src/main/java/de/thm/arsnova/controller/LoginController.java b/src/main/java/de/thm/arsnova/controller/LoginController.java index 672729156a1f34aaa8f5653460cf930d777356fb..766972fd2a4d3a2e20abb9e6f9a487b53e8bc2fe 100644 --- a/src/main/java/de/thm/arsnova/controller/LoginController.java +++ b/src/main/java/de/thm/arsnova/controller/LoginController.java @@ -141,7 +141,7 @@ public class LoginController extends AbstractController { @Autowired private UserSessionService userSessionService; - public static final Logger LOGGER = LoggerFactory.getLogger(LoginController.class); + public static final Logger logger = LoggerFactory.getLogger(LoginController.class); @RequestMapping(value = { "/auth/login", "/doLogin" }, method = { RequestMethod.POST, RequestMethod.GET }) public void doLogin( @@ -174,7 +174,7 @@ public class LoginController extends AbstractController { return; } } catch (AuthenticationException e) { - LOGGER.info("Authentication failed: {}", e.getMessage()); + logger.info("Authentication failed: {}", e.getMessage()); } userService.increaseFailedLoginCount(addr); @@ -197,9 +197,9 @@ public class LoginController extends AbstractController { return; } - LOGGER.info("LDAPLOGIN: {}", auth.isAuthenticated()); + logger.info("LDAPLOGIN: {}", auth.isAuthenticated()); } catch (AuthenticationException e) { - LOGGER.info("No LDAP login: {}", e); + logger.info("No LDAP login: {}", e); } userService.increaseFailedLoginCount(addr); diff --git a/src/main/java/de/thm/arsnova/controller/MotdController.java b/src/main/java/de/thm/arsnova/controller/MotdController.java index 5a77d9e3d806b45ec41b597c1deff23b7089a5b4..e76edeb4b5cf2efb06ce7cdc9ea1f1239e75d79a 100644 --- a/src/main/java/de/thm/arsnova/controller/MotdController.java +++ b/src/main/java/de/thm/arsnova/controller/MotdController.java @@ -25,8 +25,6 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PathVariable; @@ -49,8 +47,6 @@ import java.util.List; @Api(value = "/motd", description = "the Motd Controller API") public class MotdController extends AbstractController { - private static final Logger LOGGER = LoggerFactory.getLogger(MotdController.class); - @Autowired private IMotdService motdService; diff --git a/src/main/java/de/thm/arsnova/controller/SessionController.java b/src/main/java/de/thm/arsnova/controller/SessionController.java index e27e60fbe04a772d555fe9112e25087d9f37f3e6..7cc40a1bafe472000ff0802978745c95ffe39ad2 100644 --- a/src/main/java/de/thm/arsnova/controller/SessionController.java +++ b/src/main/java/de/thm/arsnova/controller/SessionController.java @@ -63,7 +63,7 @@ import java.util.List; @Api(value = "/session", description = "the Session Controller API") public class SessionController extends PaginationController { - public static final Logger LOGGER = LoggerFactory.getLogger(SessionController.class); + public static final Logger logger = LoggerFactory.getLogger(SessionController.class); @Autowired private ISessionService sessionService; diff --git a/src/main/java/de/thm/arsnova/controller/SocketController.java b/src/main/java/de/thm/arsnova/controller/SocketController.java index 266c22eb756c0cc97af76b0040a9d1d70bdd19dd..63c9fb35a683f991710b8d57b3af9b811fcafb86 100644 --- a/src/main/java/de/thm/arsnova/controller/SocketController.java +++ b/src/main/java/de/thm/arsnova/controller/SocketController.java @@ -57,7 +57,7 @@ public class SocketController extends AbstractController { @Autowired private ARSnovaSocket server; - private static final Logger LOGGER = LoggerFactory.getLogger(SocketController.class); + private static final Logger logger = LoggerFactory.getLogger(SocketController.class); @ApiOperation(value = "requested to assign Websocket session", nickname = "authorize") @@ -70,13 +70,13 @@ public class SocketController extends AbstractController { public void authorize(@ApiParam(value = "sessionMap", required = true) @RequestBody final Map <String, String> sessionMap, @ApiParam(value = "response", required = true) final HttpServletResponse response) { String socketid = sessionMap.get("session"); if (null == socketid) { - LOGGER.debug("Expected property 'session' missing"); + logger.debug("Expected property 'session' missing"); response.setStatus(HttpStatus.BAD_REQUEST.value()); return; } User u = userService.getCurrentUser(); if (null == u) { - LOGGER.debug("Client {} requested to assign Websocket session but has not authenticated", socketid); + logger.debug("Client {} requested to assign Websocket session but has not authenticated", socketid); response.setStatus(HttpStatus.FORBIDDEN.value()); return; } diff --git a/src/main/java/de/thm/arsnova/controller/UserController.java b/src/main/java/de/thm/arsnova/controller/UserController.java index c036beec807c37a5965efe91684082d4f2904b90..3aa76475c100cfeae503de8deacc8735501c6928 100644 --- a/src/main/java/de/thm/arsnova/controller/UserController.java +++ b/src/main/java/de/thm/arsnova/controller/UserController.java @@ -48,7 +48,7 @@ public class UserController extends AbstractController { @Autowired private UserSessionService userSessionService; - public static final Logger LOGGER = LoggerFactory + public static final Logger logger = LoggerFactory .getLogger(UserController.class); @RequestMapping(value = "/register", method = RequestMethod.POST) diff --git a/src/main/java/de/thm/arsnova/dao/CouchDBDao.java b/src/main/java/de/thm/arsnova/dao/CouchDBDao.java index 326f0fa95dceda9641d2668c66e95e33ab81bf22..80663022e07368ecd0a9ff5ad4ef25a8007b36c0 100644 --- a/src/main/java/de/thm/arsnova/dao/CouchDBDao.java +++ b/src/main/java/de/thm/arsnova/dao/CouchDBDao.java @@ -81,7 +81,7 @@ import java.util.concurrent.ConcurrentLinkedQueue; @Component("databaseDao") public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware { - private final int BULK_PARTITION_SIZE = 500; + private static final int BULK_PARTITION_SIZE = 500; @Autowired private ISessionService sessionService; @@ -95,7 +95,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware private final Queue<AbstractMap.SimpleEntry<Document, AnswerQueueElement>> answerQueue = new ConcurrentLinkedQueue<>(); - public static final Logger LOGGER = LoggerFactory.getLogger(CouchDBDao.class); + public static final Logger logger = LoggerFactory.getLogger(CouchDBDao.class); @Value("${couchdb.host}") public void setDatabaseHost(final String newDatabaseHost) { @@ -142,7 +142,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware try { database.saveDocument(d); } catch (final IOException e) { - LOGGER.error("Logging of '{}' event to database failed.", event); + logger.error("Logging of '{}' event to database failed.", event); } } @@ -534,7 +534,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware if (document.has("keyword")) { return (String) document.get("keyword"); } - LOGGER.error("No session found for internal id: {}", internalSessionId); + logger.error("No session found for internal id: {}", internalSessionId); return null; } @@ -547,7 +547,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware ); database = session.getDatabase(databaseName); } catch (final Exception e) { - LOGGER.error( + logger.error( "Cannot connect to CouchDB database '" + databaseName + "' on host '" + databaseHost + "' using port " + databasePort @@ -572,7 +572,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware question.set_rev(q.getRev()); return question; } catch (final IOException e) { - LOGGER.error("Could not save question {}", question); + logger.error("Could not save question {}", question); } return null; } @@ -703,7 +703,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware return question; } catch (final IOException e) { - LOGGER.error("Could not update question {}", question); + logger.error("Could not update question {}", question); } return null; @@ -730,7 +730,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware return question; } catch (final IOException e) { - LOGGER.error("Could not save interposed question {}", question); + logger.error("Could not save interposed question {}", question); } return null; @@ -754,7 +754,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware question.setSessionKeyword(getSessionKeyword(question.getSessionId())); return question; } catch (final IOException e) { - LOGGER.error("Could not get question with id {}", id); + logger.error("Could not get question with id {}", id); } return null; } @@ -828,7 +828,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware getDatabase().saveDocument(new Document(json)); return session; } catch (final IOException e) { - LOGGER.error("Failed to update lastOwnerActivity for Session {}", session); + logger.error("Failed to update lastOwnerActivity for Session {}", session); return session; } } @@ -855,7 +855,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware return count; } catch (final IOException e) { - LOGGER.error("IOException: Could not delete question {}", question.get_id()); + logger.error("IOException: Could not delete question {}", question.get_id()); } return 0; @@ -918,14 +918,14 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware if (database.bulkSaveDocuments(answersToDelete.toArray(new Document[answersToDelete.size()]))) { count += partition.size(); } else { - LOGGER.error("Could not bulk delete answers"); + logger.error("Could not bulk delete answers"); } } log("delete", "type", "answer", "answerCount", count); return count; } catch (final IOException e) { - LOGGER.error("IOException: Could not delete answers for question {}", question.get_id()); + logger.error("IOException: Could not delete answers for question {}", question.get_id()); } return 0; @@ -1347,7 +1347,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware } return stats; } catch (final Exception e) { - LOGGER.error("Error while retrieving session count", e); + logger.error("Error while retrieving session count", e); } return stats; } @@ -1361,7 +1361,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware question.setSessionId(getSessionKeyword(question.getSessionId())); return question; } catch (final IOException e) { - LOGGER.error("Could not load interposed question {}", questionId); + logger.error("Could not load interposed question {}", questionId); } return null; } @@ -1374,7 +1374,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware document.put("read", question.isRead()); getDatabase().saveDocument(document); } catch (final IOException e) { - LOGGER.error("Could not mark interposed question as read {}", question.get_id()); + logger.error("Could not mark interposed question as read {}", question.get_id()); } } @@ -1439,7 +1439,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware final Document doc = new Document(json); getDatabase().saveDocument(doc); } catch (IOException e) { - LOGGER.error("Could not clean up logged_in document of {}", user.getUsername()); + logger.error("Could not clean up logged_in document of {}", user.getUsername()); } return result; } @@ -1505,7 +1505,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware final Document doc = new Document(json); getDatabase().saveDocument(doc); } catch (IOException e) { - LOGGER.error("Could not clean up logged_in document of {}", username); + logger.error("Could not clean up logged_in document of {}", username); } return result; } @@ -1572,7 +1572,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware this.publisher.publishEvent(new NewAnswerEvent(this, e.getSession(), e.getAnswer(), e.getUser(), e.getQuestion())); } } catch (IOException e) { - LOGGER.error("Could not bulk save answers from queue"); + logger.error("Could not bulk save answers from queue"); } } @@ -1596,7 +1596,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware answer.set_rev(a.getRev()); return answer; } catch (final IOException e) { - LOGGER.error("Could not save answer {}", answer); + logger.error("Could not save answer {}", answer); } return null; } @@ -1609,7 +1609,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware database.deleteDocument(database.getDocument(answerId)); log("delete", "type", "answer"); } catch (final IOException e) { - LOGGER.error("Could not delete answer {} because of {}", answerId, e.getMessage()); + logger.error("Could not delete answer {} because of {}", answerId, e.getMessage()); } } @@ -1619,7 +1619,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware deleteDocument(question.get_id()); log("delete", "type", "comment"); } catch (final IOException e) { - LOGGER.error("Could not delete interposed question {} because of {}", question.get_id(), e.getMessage()); + logger.error("Could not delete interposed question {} because of {}", question.get_id(), e.getMessage()); } } @@ -1692,7 +1692,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware return session; } catch (final IOException e) { - LOGGER.error("Could not lock session {}", session); + logger.error("Could not lock session {}", session); } return null; @@ -1707,7 +1707,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware database.saveDocument(s); session.set_rev(s.getRev()); } catch (final IOException e) { - LOGGER.error("Could not lock session {}", session); + logger.error("Could not lock session {}", session); } return session; @@ -1720,10 +1720,10 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware try { count = deleteAllQuestionsWithAnswers(session); deleteDocument(session.get_id()); - LOGGER.debug("Deleted session document {} and related data.", session.get_id()); + logger.debug("Deleted session document {} and related data.", session.get_id()); log("delete", "type", "session", "id", session.get_id()); } catch (final IOException e) { - LOGGER.error("Could not delete session {}", session); + logger.error("Could not delete session {}", session); } return count; @@ -1746,7 +1746,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware } if (results.size() > 0) { - LOGGER.info("Deleted {} inactive guest sessions.", results.size()); + logger.info("Deleted {} inactive guest sessions.", results.size()); log("cleanup", "type", "session", "sessionCount", results.size(), "questionCount", count[1], "answerCount", count[2]); } count[0] = results.size(); @@ -1771,7 +1771,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware newDoc.setRev(oldDoc.getJSONObject("value").getString("_rev")); newDoc.put("_deleted", true); newDocs.add(newDoc); - LOGGER.debug("Marked logged_in document {} for deletion.", oldDoc.getId()); + logger.debug("Marked logged_in document {} for deletion.", oldDoc.getId()); /* Use log type 'user' since effectively the user is deleted in case of guests */ log("delete", "type", "user", "id", oldDoc.getId()); } @@ -1780,19 +1780,19 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware if (getDatabase().bulkSaveDocuments(newDocs.toArray(new Document[newDocs.size()]))) { count += newDocs.size(); } else { - LOGGER.error("Could not bulk delete visited session lists"); + logger.error("Could not bulk delete visited session lists"); } } } if (count > 0) { - LOGGER.info("Deleted {} visited session lists of inactive users.", count); + logger.info("Deleted {} visited session lists of inactive users.", count); log("cleanup", "type", "visitedsessions", "count", count); } return count; } catch (IOException e) { - LOGGER.error("Could not delete visited session lists of inactive users."); + logger.error("Could not delete visited session lists of inactive users."); } return 0; @@ -2053,7 +2053,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware try { deleteDocument(document.getId()); } catch (final IOException e) { - LOGGER.error("Could not delete all interposed questions {}", session); + logger.error("Could not delete all interposed questions {}", session); } } @@ -2090,7 +2090,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware try { database.bulkSaveDocuments(documents.toArray(new Document[documents.size()])); } catch (final IOException e) { - LOGGER.error("Could not bulk publish all questions: {}", e.getMessage()); + logger.error("Could not bulk publish all questions: {}", e.getMessage()); } } @@ -2124,7 +2124,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware try { database.bulkSaveDocuments(documents.toArray(new Document[documents.size()])); } catch (final IOException e) { - LOGGER.error("Could not bulk set voting admission for all questions: {}", e.getMessage()); + logger.error("Could not bulk set voting admission for all questions: {}", e.getMessage()); } } @@ -2178,7 +2178,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware try { database.bulkSaveDocuments(documents.toArray(new Document[documents.size()])); } catch (final IOException e) { - LOGGER.error("Could not bulk reset all questions round state: {}", e.getMessage()); + logger.error("Could not bulk reset all questions round state: {}", e.getMessage()); } } @@ -2202,7 +2202,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware return allAnswers.size(); } catch (IOException e) { - LOGGER.error("Could not bulk delete answers: {}", e.getMessage()); + logger.error("Could not bulk delete answers: {}", e.getMessage()); } return 0; @@ -2238,7 +2238,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware return new int[] {deleteList.size(), result.size()}; } catch (IOException e) { - LOGGER.error("Could not bulk delete questions and answers: {}", e.getMessage()); + logger.error("Could not bulk delete questions and answers: {}", e.getMessage()); } return new int[] {0, 0}; @@ -2311,7 +2311,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware return user; } catch (IOException e) { - LOGGER.error("Could not save user {}", user); + logger.error("Could not save user {}", user); } return null; @@ -2341,7 +2341,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware return true; } catch (IOException e) { - LOGGER.error("Could not delete user {}", dbUser.getId()); + logger.error("Could not delete user {}", dbUser.getId()); } return false; @@ -2364,7 +2364,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware newDoc.setRev(oldDoc.getJSONObject("value").getString("_rev")); newDoc.put("_deleted", true); newDocs.add(newDoc); - LOGGER.debug("Marked user document {} for deletion.", oldDoc.getId()); + logger.debug("Marked user document {} for deletion.", oldDoc.getId()); } if (newDocs.size() > 0) { @@ -2375,13 +2375,13 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware } if (count > 0) { - LOGGER.info("Deleted {} inactive users.", count); + logger.info("Deleted {} inactive users.", count); log("cleanup", "type", "user", "count", count); } return count; } catch (IOException e) { - LOGGER.error("Could not delete inactive users."); + logger.error("Could not delete inactive users."); } return 0; @@ -2466,7 +2466,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware database.bulkSaveDocuments(motds.toArray(new Document[motds.size()])); database.bulkSaveDocuments(documents.toArray(new Document[documents.size()])); } catch (IOException e) { - LOGGER.error("Could not import this session: {}", e.getMessage()); + logger.error("Could not import this session: {}", e.getMessage()); // Something went wrong, delete this session since we do not want a partial import this.deleteSession(session); return null; @@ -2752,7 +2752,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware return motd; } catch (IOException e) { - LOGGER.error("Could not save motd {}", motd); + logger.error("Could not save motd {}", motd); } return null; @@ -2764,7 +2764,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware try { this.deleteDocument(motd.get_id()); } catch (IOException e) { - LOGGER.error("Could not delete Motd {}", motd.get_id()); + logger.error("Could not delete Motd {}", motd.get_id()); } } @@ -2807,7 +2807,7 @@ public class CouchDBDao implements IDatabaseDao, ApplicationEventPublisherAware return motdlist; } catch (IOException e) { - LOGGER.error("Could not save motdlist {}", motdlist); + logger.error("Could not save motdlist {}", motdlist); } return null; diff --git a/src/main/java/de/thm/arsnova/security/ApplicationPermissionEvaluator.java b/src/main/java/de/thm/arsnova/security/ApplicationPermissionEvaluator.java index fef4edb33b41064fb2dd86de6f742e122dfe734f..d60ca18ab8fc62fa278623954d054694c0041f2d 100644 --- a/src/main/java/de/thm/arsnova/security/ApplicationPermissionEvaluator.java +++ b/src/main/java/de/thm/arsnova/security/ApplicationPermissionEvaluator.java @@ -27,8 +27,6 @@ import de.thm.arsnova.exceptions.UnauthorizedException; import org.scribe.up.profile.facebook.FacebookProfile; import org.scribe.up.profile.google.Google2Profile; import org.scribe.up.profile.twitter.TwitterProfile; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.access.PermissionEvaluator; @@ -43,8 +41,6 @@ import java.util.Arrays; */ public class ApplicationPermissionEvaluator implements PermissionEvaluator { - private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationPermissionEvaluator.class); - @Value("${security.admin-accounts}") private String adminAccounts; diff --git a/src/main/java/de/thm/arsnova/security/CustomLdapUserDetailsMapper.java b/src/main/java/de/thm/arsnova/security/CustomLdapUserDetailsMapper.java index b2ab7c991164fcb9b96b1b387956d3da5c0c8db8..9697c07a91dc4f74d7ef50cd1d0a38f641625d39 100644 --- a/src/main/java/de/thm/arsnova/security/CustomLdapUserDetailsMapper.java +++ b/src/main/java/de/thm/arsnova/security/CustomLdapUserDetailsMapper.java @@ -31,7 +31,7 @@ import java.util.Collection; * to get a consistent ID despite case insensitivity. */ public class CustomLdapUserDetailsMapper extends LdapUserDetailsMapper { - public static final Logger LOGGER = LoggerFactory.getLogger(CustomLdapUserDetailsMapper.class); + public static final Logger logger = LoggerFactory.getLogger(CustomLdapUserDetailsMapper.class); private String userIdAttr; @@ -43,7 +43,7 @@ public class CustomLdapUserDetailsMapper extends LdapUserDetailsMapper { Collection<? extends GrantedAuthority> authorities) { String ldapUsername = ctx.getStringAttribute(userIdAttr); if (ldapUsername == null) { - LOGGER.warn("LDAP attribute {} not set. Falling back to lowercased user provided username.", userIdAttr); + logger.warn("LDAP attribute {} not set. Falling back to lowercased user provided username.", userIdAttr); ldapUsername = username.toLowerCase(); } diff --git a/src/main/java/de/thm/arsnova/security/DbUserDetailsService.java b/src/main/java/de/thm/arsnova/security/DbUserDetailsService.java index d7fe14a6217b8db0c3935d19d6a03583658032ff..6023bd1fa246bb831c223b30a71af32c010164af 100644 --- a/src/main/java/de/thm/arsnova/security/DbUserDetailsService.java +++ b/src/main/java/de/thm/arsnova/security/DbUserDetailsService.java @@ -41,13 +41,13 @@ public class DbUserDetailsService implements UserDetailsService { @Autowired private IDatabaseDao dao; - public static final Logger LOGGER = LoggerFactory + public static final Logger logger = LoggerFactory .getLogger(DbUserDetailsService.class); @Override public UserDetails loadUserByUsername(String username) { String uid = username.toLowerCase(); - LOGGER.debug("Load user: " + uid); + logger.debug("Load user: " + uid); DbUser dbUser = dao.getUser(uid); if (null == dbUser) { throw new UsernameNotFoundException("User does not exist."); diff --git a/src/main/java/de/thm/arsnova/services/QuestionService.java b/src/main/java/de/thm/arsnova/services/QuestionService.java index 014539fd6a4725772bdf0261b5ada27bffed22ba..2c257e882e27481350f456bee86f2df668a7a6d9 100644 --- a/src/main/java/de/thm/arsnova/services/QuestionService.java +++ b/src/main/java/de/thm/arsnova/services/QuestionService.java @@ -67,7 +67,7 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis private ApplicationEventPublisher publisher; - public static final Logger LOGGER = LoggerFactory.getLogger(QuestionService.class); + public static final Logger logger = LoggerFactory.getLogger(QuestionService.class); private HashMap<String, Timer> timerList = new HashMap<>(); @@ -112,7 +112,7 @@ public class QuestionService implements IQuestionService, ApplicationEventPublis // base64 adds offset to filesize, formula taken from: http://en.wikipedia.org/wiki/Base64#MIME final int fileSize = (int) ((question.getImage().length() - 814) / 1.37); if (fileSize > uploadFileSizeByte) { - LOGGER.error("Could not save file. File is too large with " + fileSize + " Byte."); + logger.error("Could not save file. File is too large with " + fileSize + " Byte."); throw new BadRequestException(); } } diff --git a/src/main/java/de/thm/arsnova/services/SessionService.java b/src/main/java/de/thm/arsnova/services/SessionService.java index f6507520741a29c7ebc86083b1fbfad86cf5782a..242351d670bb8ec9c966e46da51c74539328f6a9 100644 --- a/src/main/java/de/thm/arsnova/services/SessionService.java +++ b/src/main/java/de/thm/arsnova/services/SessionService.java @@ -126,12 +126,12 @@ public class SessionService implements ISessionService, ApplicationEventPublishe private ApplicationEventPublisher publisher; - public static final Logger LOGGER = LoggerFactory.getLogger(SessionService.class); + public static final Logger logger = LoggerFactory.getLogger(SessionService.class); @Scheduled(fixedDelay = SESSION_INACTIVITY_CHECK_INTERVAL_MS) public void deleteInactiveSessions() { if (guestSessionInactivityThresholdDays > 0) { - LOGGER.info("Delete inactive sessions."); + logger.info("Delete inactive sessions."); long unixTime = System.currentTimeMillis(); long lastActivityBefore = unixTime - guestSessionInactivityThresholdDays * 24 * 60 * 60 * 1000L; databaseDao.deleteInactiveGuestSessions(lastActivityBefore); @@ -141,7 +141,7 @@ public class SessionService implements ISessionService, ApplicationEventPublishe @Scheduled(fixedDelay = SESSION_INACTIVITY_CHECK_INTERVAL_MS) public void deleteInactiveVisitedSessionLists() { if (guestSessionInactivityThresholdDays > 0) { - LOGGER.info("Delete lists of visited session for inactive users."); + logger.info("Delete lists of visited session for inactive users."); long unixTime = System.currentTimeMillis(); long lastActivityBefore = unixTime - guestSessionInactivityThresholdDays * 24 * 60 * 60 * 1000L; databaseDao.deleteInactiveGuestVisitedSessionLists(lastActivityBefore); @@ -508,7 +508,7 @@ public class SessionService implements ISessionService, ApplicationEventPublishe // base64 adds offset to filesize, formula taken from: http://en.wikipedia.org/wiki/Base64#MIME final int fileSize = (int) ((session.getPpLogo().length() - 814) / 1.37); if (fileSize > uploadFileSizeByte) { - LOGGER.error("Could not save file. File is too large with " + fileSize + " Byte."); + logger.error("Could not save file. File is too large with " + fileSize + " Byte."); throw new PayloadTooLargeException(); } } diff --git a/src/main/java/de/thm/arsnova/services/UserService.java b/src/main/java/de/thm/arsnova/services/UserService.java index e68d0e6a728428b47057f41c1f2324402c027182..0952c6aed3700742dd388c8299c044810117d967 100644 --- a/src/main/java/de/thm/arsnova/services/UserService.java +++ b/src/main/java/de/thm/arsnova/services/UserService.java @@ -88,7 +88,7 @@ public class UserService implements IUserService { private static final long ACTIVATION_KEY_CHECK_INTERVAL_MS = 30 * 60 * 1000L; private static final long ACTIVATION_KEY_DURABILITY_MS = 6 * 60 * 60 * 1000L; - public static final Logger LOGGER = LoggerFactory.getLogger(UserService.class); + public static final Logger logger = LoggerFactory.getLogger(UserService.class); private static final ConcurrentHashMap<UUID, User> socketid2user = new ConcurrentHashMap<>(); @@ -154,7 +154,7 @@ public class UserService implements IUserService { @Scheduled(fixedDelay = LOGIN_TRY_RESET_DELAY_MS) public void resetLoginTries() { if (loginTries.size() > 0) { - LOGGER.debug("Reset failed login counters."); + logger.debug("Reset failed login counters."); loginTries.clear(); } } @@ -162,14 +162,14 @@ public class UserService implements IUserService { @Scheduled(fixedDelay = LOGIN_BAN_RESET_DELAY_MS) public void resetLoginBans() { if (loginBans.size() > 0) { - LOGGER.info("Reset temporary login bans."); + logger.info("Reset temporary login bans."); loginBans.clear(); } } @Scheduled(fixedDelay = ACTIVATION_KEY_CHECK_INTERVAL_MS) public void deleteInactiveUsers() { - LOGGER.info("Delete inactive users."); + logger.info("Delete inactive users."); long unixTime = System.currentTimeMillis(); long lastActivityBefore = unixTime - ACTIVATION_KEY_DURABILITY_MS; databaseDao.deleteInactiveUsers(lastActivityBefore); @@ -241,7 +241,7 @@ public class UserService implements IUserService { if (tries < loginTryLimit) { loginTries.put(addr, ++tries); if (loginTryLimit == tries) { - LOGGER.info("Temporarily banned {} from login.", new Object[] {addr}); + logger.info("Temporarily banned {} from login.", new Object[] {addr}); loginBans.add(addr); } } @@ -301,7 +301,7 @@ public class UserService implements IUserService { public void removeUserFromSessionBySocketId(final UUID socketId) { final User user = socketid2user.get(socketId); if (null == user) { - LOGGER.warn("null == user for socket {}", socketId); + logger.warn("null == user for socket {}", socketId); return; } @@ -321,7 +321,7 @@ public class UserService implements IUserService { @PreDestroy public void destroy() { - LOGGER.error("Destroy UserService"); + logger.error("Destroy UserService"); } @Override @@ -355,13 +355,13 @@ public class UserService implements IUserService { } if (null == mailPattern || !mailPattern.matcher(lcUsername).matches()) { - LOGGER.info("User registration failed. {} does not match pattern.", lcUsername); + logger.info("User registration failed. {} does not match pattern.", lcUsername); return null; } if (null != databaseDao.getUser(lcUsername)) { - LOGGER.info("User registration failed. {} already exists.", lcUsername); + logger.info("User registration failed. {} already exists.", lcUsername); return null; } @@ -376,7 +376,7 @@ public class UserService implements IUserService { if (null != result) { sendActivationEmail(result); } else { - LOGGER.error("User registration failed. {} could not be created.", lcUsername); + logger.error("User registration failed. {} could not be created.", lcUsername); } return result; @@ -402,7 +402,7 @@ public class UserService implements IUserService { dbUser.getActivationKey() ); } catch (UnsupportedEncodingException e1) { - LOGGER.error(e1.getMessage()); + logger.error(e1.getMessage()); return; } @@ -429,7 +429,7 @@ public class UserService implements IUserService { } mailPattern = Pattern.compile("[a-z0-9._-]+?@(" + StringUtils.join(patterns, "|") + ")", Pattern.CASE_INSENSITIVE); - LOGGER.info("Allowed e-mail addresses (pattern) for registration: " + mailPattern.pattern()); + logger.info("Allowed e-mail addresses (pattern) for registration: " + mailPattern.pattern()); } } @@ -465,12 +465,12 @@ public class UserService implements IUserService { public void initiatePasswordReset(String username) { DbUser dbUser = getDbUser(username); if (null == dbUser) { - LOGGER.info("Password reset failed. User {} does not exist.", username); + logger.info("Password reset failed. User {} does not exist.", username); throw new NotFoundException(); } if (System.currentTimeMillis() < dbUser.getPasswordResetTime() + REPEATED_PASSWORD_RESET_DELAY_MS) { - LOGGER.info("Password reset failed. The reset delay for User {} is still active.", username); + logger.info("Password reset failed. The reset delay for User {} is still active.", username); throw new BadRequestException(); } @@ -479,7 +479,7 @@ public class UserService implements IUserService { dbUser.setPasswordResetTime(System.currentTimeMillis()); if (null == databaseDao.createOrUpdateUser(dbUser)) { - LOGGER.error("Password reset failed. {} could not be updated.", username); + logger.error("Password reset failed. {} could not be updated.", username); } String resetPasswordUrl; @@ -493,7 +493,7 @@ public class UserService implements IUserService { dbUser.getPasswordResetKey() ); } catch (UnsupportedEncodingException e1) { - LOGGER.error(e1.getMessage()); + logger.error(e1.getMessage()); return; } @@ -504,12 +504,12 @@ public class UserService implements IUserService { @Override public boolean resetPassword(DbUser dbUser, String key, String password) { if (null == key || "".equals(key) || !key.equals(dbUser.getPasswordResetKey())) { - LOGGER.info("Password reset failed. Invalid key provided for User {}.", dbUser.getUsername()); + logger.info("Password reset failed. Invalid key provided for User {}.", dbUser.getUsername()); return false; } if (System.currentTimeMillis() > dbUser.getPasswordResetTime() + PASSWORD_RESET_KEY_DURABILITY_MS) { - LOGGER.info("Password reset failed. Key provided for User {} is no longer valid.", dbUser.getUsername()); + logger.info("Password reset failed. Key provided for User {} is no longer valid.", dbUser.getUsername()); dbUser.setPasswordResetKey(null); dbUser.setPasswordResetTime(0); @@ -521,7 +521,7 @@ public class UserService implements IUserService { dbUser.setPassword(encodePassword(password)); dbUser.setPasswordResetKey(null); if (null == updateDbUser(dbUser)) { - LOGGER.error("Password reset failed. {} could not be updated.", dbUser.getUsername()); + logger.error("Password reset failed. {} could not be updated.", dbUser.getUsername()); } return true; @@ -536,10 +536,10 @@ public class UserService implements IUserService { helper.setSubject(subject); helper.setText(body); - LOGGER.info("Sending mail \"{}\" from \"{}\" to \"{}\"", subject, msg.getFrom(), dbUser.getUsername()); + logger.info("Sending mail \"{}\" from \"{}\" to \"{}\"", subject, msg.getFrom(), dbUser.getUsername()); mailSender.send(msg); } catch (MailException | MessagingException e) { - LOGGER.warn("Mail \"{}\" could not be sent: {}", subject, e); + logger.warn("Mail \"{}\" could not be sent: {}", subject, e); } } } diff --git a/src/main/java/de/thm/arsnova/socket/ARSnovaSocketIOServer.java b/src/main/java/de/thm/arsnova/socket/ARSnovaSocketIOServer.java index 8df42e0895c0d5f049fb4bedbc5b0c52d6bf8269..a328cae2f1edf44ea393fd7d5d43400cdfeda48e 100644 --- a/src/main/java/de/thm/arsnova/socket/ARSnovaSocketIOServer.java +++ b/src/main/java/de/thm/arsnova/socket/ARSnovaSocketIOServer.java @@ -78,7 +78,7 @@ public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor { @Autowired private IQuestionService questionService; - private static final Logger LOGGER = LoggerFactory.getLogger(ARSnovaSocketIOServer.class); + private static final Logger logger = LoggerFactory.getLogger(ARSnovaSocketIOServer.class); private int portNumber; private String hostIp; @@ -94,7 +94,7 @@ public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor { @PreDestroy public void closeAllSessions() { - LOGGER.info("Close all websockets due to @PreDestroy"); + logger.info("Close all websockets due to @PreDestroy"); for (final SocketIOClient c : server.getAllClients()) { c.disconnect(); } @@ -104,7 +104,7 @@ public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor { c.send(new Packet(PacketType.DISCONNECT)); clientCount++; } - LOGGER.info("Pending websockets at @PreDestroy: {}", clientCount); + logger.info("Pending websockets at @PreDestroy: {}", clientCount); server.stop(); } @@ -123,7 +123,7 @@ public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor { config.setKeyStore(stream); config.setKeyStorePassword(storepass); } catch (final FileNotFoundException e) { - LOGGER.error("Keystore {} not found on filesystem", keystore); + logger.error("Keystore {} not found on filesystem", keystore); } } server = new SocketIOServer(config); @@ -134,7 +134,7 @@ public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor { public void onData(final SocketIOClient client, final Feedback data, final AckRequest ackSender) { final User u = userService.getUser2SocketId(client.getSessionId()); if (u == null) { - LOGGER.info("Client {} tried to send feedback but is not mapped to a user", client.getSessionId()); + logger.info("Client {} tried to send feedback but is not mapped to a user", client.getSessionId()); return; } @@ -142,9 +142,9 @@ public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor { final de.thm.arsnova.entities.Session session = sessionService.getSessionInternal(sessionKey, u); if (session.getFeedbackLock()) { - LOGGER.debug("Feedback save blocked: {}", u, sessionKey, data.getValue()); + logger.debug("Feedback save blocked: {}", u, sessionKey, data.getValue()); } else { - LOGGER.debug("Feedback recieved: {}", u, sessionKey, data.getValue()); + logger.debug("Feedback recieved: {}", u, sessionKey, data.getValue()); if (null != sessionKey) { feedbackService.saveFeedback(sessionKey, data.getValue(), u); } @@ -158,7 +158,7 @@ public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor { public void onData(final SocketIOClient client, final Session session, final AckRequest ackSender) { final User u = userService.getUser2SocketId(client.getSessionId()); if (null == u) { - LOGGER.info("Client {} requested to join session but is not mapped to a user", client.getSessionId()); + logger.info("Client {} requested to join session but is not mapped to a user", client.getSessionId()); return; } @@ -193,7 +193,7 @@ public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor { try { questionService.readInterposedQuestionInternal(question.getId(), user); } catch (NotFoundException | UnauthorizedException e) { - LOGGER.error("Loading of question {} failed for user {} with exception {}", question.getId(), user, e.getMessage()); + logger.error("Loading of question {} failed for user {} with exception {}", question.getId(), user, e.getMessage()); } } }); @@ -205,7 +205,7 @@ public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor { try { questionService.readFreetextAnswer(answerId, user); } catch (NotFoundException | UnauthorizedException e) { - LOGGER.error("Marking answer {} as read failed for user {} with exception {}", answerId, user, e.getMessage()); + logger.error("Marking answer {} as read failed for user {} with exception {}", answerId, user, e.getMessage()); } } }); @@ -259,14 +259,14 @@ public class ARSnovaSocketIOServer implements ARSnovaSocket, NovaEventVisitor { } public void stopServer() { - LOGGER.trace("In stopServer method of class: {}", getClass().getName()); + logger.trace("In stopServer method of class: {}", getClass().getName()); try { for (final SocketIOClient client : server.getAllClients()) { client.disconnect(); } } catch (final Exception e) { /* If exceptions are not caught they could prevent the Socket.IO server from shutting down. */ - LOGGER.error("Exception caught on Socket.IO shutdown: {}", e.getMessage()); + logger.error("Exception caught on Socket.IO shutdown: {}", e.getMessage()); } server.stop();