Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ARSnova Backend
Manage
Activity
Members
Labels
Plan
Issues
27
Issue boards
Milestones
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
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
ARSnova
ARSnova Backend
Commits
a12ba1e9
There was an error fetching the commit references. Please try again later.
Commit
a12ba1e9
authored
12 years ago
by
Daniel Gerhardt
Browse files
Options
Downloads
Patches
Plain Diff
Throw NotFoundException in joinSession in SessionService if keyword is
not valid.
parent
069d5c01
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/thm/arsnova/services/SessionService.java
+11
-3
11 additions, 3 deletions
src/main/java/de/thm/arsnova/services/SessionService.java
with
11 additions
and
3 deletions
src/main/java/de/thm/arsnova/services/SessionService.java
+
11
−
3
View file @
a12ba1e9
...
...
@@ -39,6 +39,7 @@ import de.thm.arsnova.entities.LoggedIn;
import
de.thm.arsnova.entities.Session
;
import
de.thm.arsnova.entities.User
;
import
de.thm.arsnova.exceptions.ForbiddenException
;
import
de.thm.arsnova.exceptions.NotFoundException
;
import
de.thm.arsnova.socket.ARSnovaSocketIOServer
;
@Service
...
...
@@ -64,10 +65,13 @@ public class SessionService implements ISessionService {
@Override
@Authenticated
public
final
Session
joinSession
(
final
String
keyword
,
UUID
socketId
)
{
public
final
Session
joinSession
(
final
String
keyword
,
final
UUID
socketId
)
{
/* Socket.IO solution */
Session
session
=
databaseDao
.
getSession
(
keyword
);
if
(
null
==
session
)
{
throw
new
NotFoundException
();
}
User
user
=
userService
.
getUser2SocketId
(
socketId
);
userService
.
addUserToSessionBySocketId
(
socketId
,
keyword
);
...
...
@@ -92,10 +96,14 @@ public class SessionService implements ISessionService {
public
final
Session
joinSession
(
final
String
keyword
)
{
/* HTTP polling solution (legacy) */
Session
session
=
databaseDao
.
getSession
(
keyword
);
if
(
null
==
session
)
{
throw
new
NotFoundException
();
}
userService
.
addCurrentUserToSessionMap
(
keyword
);
socketIoServer
.
reportActiveUserCountForSession
(
keyword
);
Session
session
=
databaseDao
.
getSession
(
keyword
);
if
(
connectorClient
!=
null
&&
session
.
isCourseSession
())
{
String
courseid
=
session
.
getCourseId
();
if
(!
connectorClient
.
getMembership
(
userService
.
getCurrentUser
().
getUsername
(),
courseid
).
isMember
())
{
...
...
@@ -173,7 +181,7 @@ public class SessionService implements ISessionService {
@Authenticated
public
final
LoggedIn
registerAsOnlineUser
(
final
User
user
,
final
String
sessionkey
)
{
/* HTTP polling solution (legacy) */
Session
session
=
this
.
joinSession
(
sessionkey
);
if
(
session
==
null
)
{
return
null
;
...
...
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