Commit 642fccae authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

19: Make ExtendedUserProfile fields Externalizable (OPENED)

Task-Url: #19
parent d18f9952
Pipeline #23338 passed with stage
in 33 seconds
......@@ -5,7 +5,7 @@ plugins {
allprojects {
group = 'eu.dariah.de'
version = '2.1.5-SNAPSHOT'
version = '2.1.6-RELEASE'
apply plugin: 'eclipse'
......
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;
......@@ -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