1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package com.hack23.cia.web.impl.ui.application.web.listener;
20
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
23 import org.springframework.context.ApplicationListener;
24 import org.springframework.security.web.session.HttpSessionCreatedEvent;
25 import org.springframework.stereotype.Service;
26
27
28
29
30 @Service
31 public final class HttpSessionCreatedEventListener implements ApplicationListener<HttpSessionCreatedEvent> {
32
33
34 private static final String LOG_MSG_SESSION_CREATED_SESSION_ID = "Session created SESSION_ID :{}";
35
36
37 private static final Logger LOGGER = LoggerFactory.getLogger(HttpSessionCreatedEventListener.class);
38
39
40
41
42 public HttpSessionCreatedEventListener() {
43 super();
44 }
45
46 @Override
47 public void onApplicationEvent(final HttpSessionCreatedEvent event) {
48 LOGGER.info(LOG_MSG_SESSION_CREATED_SESSION_ID, event.getSession().getId());
49 }
50
51 }