Commit 11d893ba authored by Gradl, Tobias's avatar 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
......@@ -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"
......
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment