Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dariah
dariahsp
Commits
642fccae
Commit
642fccae
authored
May 04, 2021
by
Gradl, Tobias
Browse files
19: Make ExtendedUserProfile fields Externalizable (OPENED)
Task-Url:
#19
parent
d18f9952
Pipeline
#23338
passed with stage
in 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
build.gradle
View file @
642fccae
...
...
@@ -5,7 +5,7 @@ plugins {
allprojects
{
group
=
'eu.dariah.de'
version
=
'2.1.
5-SNAPSHOT
'
version
=
'2.1.
6-RELEASE
'
apply
plugin:
'eclipse'
...
...
dariahsp-core/src/main/java/eu/dariah/de/dariahsp/model/ExtendedUserProfile.java
View file @
642fccae
package
eu.dariah.de.dariahsp.model
;
import
java.io.IOException
;
import
java.io.ObjectInput
;
import
java.io.ObjectOutput
;
import
java.util.ArrayList
;
import
java.util.Set
;
...
...
@@ -18,7 +21,7 @@ public class ExtendedUserProfile extends CommonProfile {
private
String
issuerId
;
private
Set
<
String
>
externalRoles
;
private
int
level
;
public
ExtendedUserProfile
(
CommonProfile
profile
)
{
this
.
setId
(
profile
.
getId
());
...
...
@@ -37,11 +40,30 @@ public class ExtendedUserProfile extends CommonProfile {
@Override
public
String
toString
()
{
return
CommonHelper
.
toNiceString
(
this
.
getClass
(),
"id"
,
this
.
getId
(),
"level"
,
this
.
getLevel
(),
return
CommonHelper
.
toNiceString
(
this
.
getClass
(),
"id"
,
this
.
getId
(),
"level"
,
this
.
getLevel
(),
"attributes"
,
this
.
getAttributes
(),
"roles"
,
this
.
getRoles
(),
"externalRoles"
,
this
.
getExternalRoles
(),
"isRemembered"
,
this
.
isRemembered
(),
"clientName"
,
this
.
getClientName
());
}
@Override
public
void
writeExternal
(
final
ObjectOutput
out
)
throws
IOException
{
super
.
writeExternal
(
out
);
out
.
writeBoolean
(
this
.
transientId
);
out
.
writeObject
(
this
.
issuerId
);
out
.
writeObject
(
this
.
externalRoles
);
out
.
writeInt
(
level
);
}
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
@Override
public
void
readExternal
(
final
ObjectInput
in
)
throws
IOException
,
ClassNotFoundException
{
super
.
readExternal
(
in
);
this
.
transientId
=
in
.
readBoolean
();
this
.
issuerId
=
(
String
)
in
.
readObject
();
this
.
externalRoles
=
(
Set
)
in
.
readObject
();
this
.
level
=
in
.
readInt
();
}
/**
* Facilitates work with extension of UserPojo
* @param <T> extension of UserPojo
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment