Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
Paul-Christian Volkmer
ARSnova Backend
Commits
baea0341
Commit
baea0341
authored
11 years ago
by
Paul-Christian Volkmer
Browse files
Options
Downloads
Patches
Plain Diff
Added SessionRegistry bean to count active HTTP session principals
parent
8c3ea2f3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/thm/arsnova/services/StatisticsService.java
+5
-1
5 additions, 1 deletion
src/main/java/de/thm/arsnova/services/StatisticsService.java
src/main/webapp/WEB-INF/spring/spring-security.xml
+3
-1
3 additions, 1 deletion
src/main/webapp/WEB-INF/spring/spring-security.xml
with
8 additions
and
2 deletions
src/main/java/de/thm/arsnova/services/StatisticsService.java
+
5
−
1
View file @
baea0341
package
de.thm.arsnova.services
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.session.SessionRegistry
;
import
org.springframework.stereotype.Service
;
import
de.thm.arsnova.dao.IDatabaseDao
;
...
...
@@ -17,6 +18,9 @@ public class StatisticsService implements IStatisticsService {
@Autowired
private
IUserService
userService
;
@Autowired
private
SessionRegistry
sessionRegistry
;
@Override
public
final
int
countActiveUsers
()
{
long
since
=
System
.
currentTimeMillis
()
-
DURATION_IN_MILLIS
;
...
...
@@ -25,7 +29,7 @@ public class StatisticsService implements IStatisticsService {
@Override
public
int
countLoggedInUsers
()
{
return
u
se
rService
.
loggedInUsers
();
return
se
ssionRegistry
.
getAllPrincipals
().
size
();
}
@Override
...
...
This diff is collapsed.
Click to expand it.
src/main/webapp/WEB-INF/spring/spring-security.xml
+
3
−
1
View file @
baea0341
...
...
@@ -128,5 +128,7 @@
<bean
id=
"failureHandler"
class=
"de.thm.arsnova.LoginAuthenticationFailureHandler"
p:defaultFailureUrl=
"/index.html"
/>
<!-- Session Registry -->
<bean
id=
"sessionRegistry"
class=
"org.springframework.security.core.session.SessionRegistryImpl"
/>
</beans>
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment