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
d7bf7518
Commit
d7bf7518
authored
11 years ago
by
Paul-Christian Volkmer
Browse files
Options
Downloads
Patches
Plain Diff
Remove user serialization from UserService
parent
c1ff00da
Branches
Branches containing commit
Tags
Tags containing commit
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/UserService.java
+1
-47
1 addition, 47 deletions
src/main/java/de/thm/arsnova/services/UserService.java
with
1 addition
and
47 deletions
src/main/java/de/thm/arsnova/services/UserService.java
+
1
−
47
View file @
d7bf7518
...
...
@@ -222,55 +222,9 @@ public class UserService implements IUserService, InitializingBean, DisposableBe
return
null
;
}
@Override
public
void
afterPropertiesSet
()
{
try
{
File
tmpDir
=
new
File
(
System
.
getProperty
(
"java.io.tmpdir"
));
File
store
=
new
File
(
tmpDir
,
"arsnova.bin"
);
if
(!
store
.
exists
())
{
return
;
}
ObjectInputStream
ois
=
new
ObjectInputStream
(
new
FileInputStream
(
store
));
Hashtable
<
String
,
Map
<?,
?>>
map
=
(
Hashtable
<
String
,
Map
<?,
?>>)
ois
.
readObject
();
ois
.
close
();
Map
<
UUID
,
User
>
s2u
=
(
Map
<
UUID
,
User
>)
map
.
get
(
"socketid2user"
);
Map
<
User
,
String
>
u2s
=
(
Map
<
User
,
String
>)
map
.
get
(
"user2session"
);
LOGGER
.
info
(
"load from store: {}"
,
map
);
socketid2user
.
putAll
(
s2u
);
user2sessionLegacy
.
putAll
(
u2s
);
}
catch
(
IOException
e
)
{
LOGGER
.
error
(
"IOException during restoring UserService"
,
e
);
}
catch
(
ClassNotFoundException
e
)
{
LOGGER
.
error
(
"ClassNotFoundException during restoring UserService"
,
e
);
}
}
@Override
public
void
destroy
()
{
Hashtable
<
String
,
Map
<?,
?>>
map
=
new
Hashtable
<
String
,
Map
<?,
?>>();
map
.
put
(
"socketid2user"
,
socketid2user
);
map
.
put
(
"user2session"
,
user2sessionLegacy
);
try
{
File
tmpDir
=
new
File
(
System
.
getProperty
(
"java.io.tmpdir"
));
File
store
=
new
File
(
tmpDir
,
"arsnova.bin"
);
if
(!
store
.
exists
())
{
if
(!
store
.
createNewFile
())
{
LOGGER
.
info
(
"Could not create store file"
);
}
}
OutputStream
file
=
new
FileOutputStream
(
store
);
ObjectOutputStream
objOut
=
new
ObjectOutputStream
(
file
);
objOut
.
writeObject
(
map
);
objOut
.
close
();
file
.
close
();
LOGGER
.
info
(
"saved to store: {}"
,
map
);
}
catch
(
IOException
e
)
{
LOGGER
.
error
(
"IOException while saving UserService"
,
e
);
}
LOGGER
.
error
(
"Destroy UserService"
);
}
@Override
...
...
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