59ff3e4a42dd6c54065ef89cf5e54c9e7d806602
[JavaForFun] /
1 package de.spring.stomp.listeners;
2
3 import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory;
5 import org.springframework.context.ApplicationListener;
6 import org.springframework.web.socket.messaging.SessionDisconnectEvent;
7
8 public class SessionDisconnectListener implements ApplicationListener<SessionDisconnectEvent> {
9         private static final Logger LOGGER = LoggerFactory.getLogger(SessionUnsubscribeListener.class);
10
11         @Override
12         public void onApplicationEvent(SessionDisconnectEvent event) {
13                 LOGGER.info("SessionDisconnectEvent timestamp: " + event.getTimestamp());
14                 LOGGER.info("SessionDisconnectEvent user: " + event.getUser());
15                 LOGGER.info("SessionDisconnectEvent sessionId: " + event.getSessionId());
16                 LOGGER.info("SessionDisconnectEvent close status: " + event.getCloseStatus());
17                 LOGGER.info("SessionDisconnectEvent: " + event.toString());
18         }
19
20 }