diff --git a/src/main/java/de/metas/ui/web/login/LoginRestController.java b/src/main/java/de/metas/ui/web/login/LoginRestController.java index 2d6210732..c00d068fc 100644 --- a/src/main/java/de/metas/ui/web/login/LoginRestController.java +++ b/src/main/java/de/metas/ui/web/login/LoginRestController.java @@ -15,9 +15,6 @@ import org.compiere.util.Login; import org.compiere.util.LoginContext; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationListener; -import org.springframework.session.events.SessionDestroyedEvent; -import org.springframework.stereotype.Component; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -312,24 +309,4 @@ public void logout(final HttpServletRequest request) destroyMFSession(loginService); } - @Component - public static class SessionDestroyedListener implements ApplicationListener - { - @Autowired - private UserNotificationsService userNotificationsService; - - public SessionDestroyedListener() - { - super(); - } - - @Override - public void onApplicationEvent(final SessionDestroyedEvent event) - { - final String sessionId = event.getSessionId(); - userNotificationsService.disableForSession(sessionId); - } - - } - } diff --git a/src/main/java/de/metas/ui/web/session/SessionDestroyedListener.java b/src/main/java/de/metas/ui/web/session/SessionDestroyedListener.java new file mode 100644 index 000000000..792ccb555 --- /dev/null +++ b/src/main/java/de/metas/ui/web/session/SessionDestroyedListener.java @@ -0,0 +1,45 @@ +package de.metas.ui.web.session; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ApplicationListener; +import org.springframework.session.events.SessionDestroyedEvent; +import org.springframework.stereotype.Component; + +import de.metas.ui.web.notification.UserNotificationsService; + +/* + * #%L + * metasfresh-webui-api + * %% + * Copyright (C) 2018 metas GmbH + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * . + * #L% + */ + +@Component +public class SessionDestroyedListener implements ApplicationListener +{ + @Autowired + private UserNotificationsService userNotificationsService; + + @Override + public void onApplicationEvent(final SessionDestroyedEvent event) + { + final String sessionId = event.getSessionId(); + userNotificationsService.disableForSession(sessionId); + } + +}