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
11d893ba
Commit
11d893ba
authored
May 04, 2021
by
Gradl, Tobias
Browse files
Merge branch 'v2.1-dev' into 'v2.x-master'
19: Make ExtendedUserProfile fields Externalizable (OPENED) See merge request
!9
parents
dbc0b398
642fccae
Pipeline
#23339
passed with stages
in 2 minutes and 34 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
build.gradle
View file @
11d893ba
...
...
@@ -5,7 +5,7 @@ plugins {
allprojects
{
group
=
'eu.dariah.de'
version
=
'2.1.
4-SNAPSHOT
'
version
=
'2.1.
6-RELEASE
'
apply
plugin:
'eclipse'
...
...
@@ -16,7 +16,7 @@ allprojects {
}
ext
{
coreVersion
=
"6.
0.0
-SNAPSHOT"
coreVersion
=
"6.
1
-SNAPSHOT"
springPac4jVersion
=
"5.1.0"
webmvcPac4jVersion
=
"4.0.1"
pac4jVersion
=
"4.1.0"
...
...
dariahsp-core/src/main/java/eu/dariah/de/dariahsp/model/ExtendedUserProfile.java
View file @
11d893ba
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