| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 1 | package de.ids_mannheim.korap.user; |
| 2 | |
| margaretha | 4566792 | 2018-01-25 21:23:03 +0100 | [diff] [blame] | 3 | import java.io.Serializable; |
| 4 | import java.util.ArrayList; |
| 5 | import java.util.HashMap; |
| 6 | import java.util.List; |
| 7 | import java.util.Map; |
| 8 | |
| 9 | import org.joda.time.DateTime; |
| 10 | |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 11 | import com.fasterxml.jackson.databind.JsonNode; |
| margaretha | 4566792 | 2018-01-25 21:23:03 +0100 | [diff] [blame] | 12 | |
| Michael Hanl | 00b64e0 | 2016-05-24 20:24:27 +0200 | [diff] [blame] | 13 | import de.ids_mannheim.korap.config.Attributes; |
| Michael Hanl | 1e18cb4 | 2015-08-06 20:57:35 +0200 | [diff] [blame] | 14 | import de.ids_mannheim.korap.config.ParamFields; |
| margaretha | 894a7d7 | 2017-11-08 19:24:20 +0100 | [diff] [blame] | 15 | import de.ids_mannheim.korap.exceptions.KustvaktException; |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 16 | import de.ids_mannheim.korap.utils.JsonUtils; |
| 17 | import de.ids_mannheim.korap.utils.TimeUtils; |
| Michael Hanl | e17eaa5 | 2016-01-22 20:55:05 +0100 | [diff] [blame] | 18 | import de.ids_mannheim.korap.web.utils.KustvaktMap; |
| Michael Hanl | 5fac8ab | 2016-01-29 16:33:04 +0100 | [diff] [blame] | 19 | import lombok.AccessLevel; |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 20 | import lombok.Data; |
| Michael Hanl | 5fac8ab | 2016-01-29 16:33:04 +0100 | [diff] [blame] | 21 | import lombok.Getter; |
| 22 | import lombok.Setter; |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 23 | |
| 24 | @Data |
| 25 | public abstract class User implements Serializable { |
| 26 | |
| margaretha | 58e1863 | 2018-02-15 13:04:42 +0100 | [diff] [blame] | 27 | //EM: add |
| 28 | private String email; |
| 29 | //EM: finish |
| 30 | |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 31 | private Integer id; |
| 32 | // in local its username, in shib it's edupersonPrincipalName |
| 33 | private String username; |
| 34 | private Long accountCreation; |
| 35 | private boolean isAccountLocked; |
| 36 | private int type; |
| Michael Hanl | 1e18cb4 | 2015-08-06 20:57:35 +0200 | [diff] [blame] | 37 | private ParamFields fields; |
| Michael Hanl | 5fac8ab | 2016-01-29 16:33:04 +0100 | [diff] [blame] | 38 | @Getter(AccessLevel.PRIVATE) |
| 39 | @Setter(AccessLevel.PRIVATE) |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 40 | private UserSettings settings; |
| Michael Hanl | dd729d7 | 2016-01-27 23:22:28 +0100 | [diff] [blame] | 41 | //todo: remove! |
| Michael Hanl | 5fac8ab | 2016-01-29 16:33:04 +0100 | [diff] [blame] | 42 | @Getter(AccessLevel.PRIVATE) |
| 43 | @Setter(AccessLevel.PRIVATE) |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 44 | private UserDetails details; |
| Michael Hanl | 5fac8ab | 2016-01-29 16:33:04 +0100 | [diff] [blame] | 45 | @Getter(AccessLevel.PRIVATE) |
| 46 | @Setter(AccessLevel.PRIVATE) |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 47 | private List<UserQuery> queries; |
| 48 | |
| Michael Hanl | c2a9f62 | 2016-01-28 16:40:06 +0100 | [diff] [blame] | 49 | private List<Userdata> userdata; |
| Michael Hanl | 4f9002d | 2016-01-27 23:21:45 +0100 | [diff] [blame] | 50 | |
| margaretha | 4edc70e | 2018-03-14 22:34:29 +0100 | [diff] [blame] | 51 | // private boolean isSystemAdmin; |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 52 | |
| Bodmo | ca3dcfb | 2017-05-24 16:36:00 +0200 | [diff] [blame] | 53 | // Values for corpusAccess: |
| 54 | public enum CorpusAccess { |
| 55 | FREE, // Access to licence free corpora only, without login |
| 56 | PUB, // Access to public (= öffentliche Korpora) only, externes Login. |
| 57 | ALL // Access to all corpora, internes Login. |
| 58 | }; |
| 59 | |
| 60 | @Getter |
| 61 | @Setter |
| 62 | private CorpusAccess corpusAccess = CorpusAccess.FREE; |
| 63 | |
| 64 | // values for location (set using the X-forwarded-for Header): |
| 65 | public enum Location { |
| 66 | INTERN, // KorAP accessed by internal Client (inside intranet). |
| 67 | EXTERN // KorAP accessed by external Client (outside intranet). |
| 68 | }; |
| 69 | |
| 70 | @Getter |
| 71 | @Setter |
| 72 | private Location location = Location.EXTERN; |
| Bodmo | 946832f | 2017-05-24 17:42:17 +0200 | [diff] [blame] | 73 | |
| Bodmo | ca3dcfb | 2017-05-24 16:36:00 +0200 | [diff] [blame] | 74 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 75 | protected User () { |
| Michael Hanl | 0f6ffd7 | 2015-08-27 19:23:15 +0200 | [diff] [blame] | 76 | this.fields = new ParamFields(); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 77 | this.accountCreation = TimeUtils.getNow().getMillis(); |
| 78 | this.isAccountLocked = false; |
| 79 | this.username = ""; |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 80 | this.id = -1; |
| Michael Hanl | 5fac8ab | 2016-01-29 16:33:04 +0100 | [diff] [blame] | 81 | this.userdata = new ArrayList<>(); |
| Bodmo | ca3dcfb | 2017-05-24 16:36:00 +0200 | [diff] [blame] | 82 | this.location = Location.EXTERN; |
| 83 | this.corpusAccess = CorpusAccess.FREE; |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 84 | } |
| 85 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 86 | |
| 87 | protected User (int type) { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 88 | this(); |
| 89 | this.type = type; |
| 90 | } |
| 91 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 92 | |
| 93 | protected User (String username, int type) { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 94 | this(type); |
| 95 | this.username = username; |
| 96 | } |
| 97 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 98 | |
| 99 | public void addField (ParamFields.Param param) { |
| Michael Hanl | 1e18cb4 | 2015-08-06 20:57:35 +0200 | [diff] [blame] | 100 | this.fields.add(param); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 101 | } |
| 102 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 103 | |
| 104 | public <T extends ParamFields.Param> T getField (Class<T> cl) { |
| Michael Hanl | 1e18cb4 | 2015-08-06 20:57:35 +0200 | [diff] [blame] | 105 | return this.fields.get(cl); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 106 | } |
| 107 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 108 | |
| 109 | public void addUserData (Userdata data) { |
| Michael Hanl | c2a9f62 | 2016-01-28 16:40:06 +0100 | [diff] [blame] | 110 | if (data != null) { |
| 111 | for (Userdata d : this.userdata) { |
| 112 | // already has an object of that type! |
| 113 | if (d.getClass().equals(data.getClass())) |
| 114 | return; |
| 115 | } |
| 116 | userdata.add(data); |
| 117 | } |
| 118 | } |
| 119 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 120 | |
| 121 | public void setId (Integer id) { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 122 | this.id = id; |
| Michael Hanl | 4f9002d | 2016-01-27 23:21:45 +0100 | [diff] [blame] | 123 | // if (this.settings != null) |
| 124 | // this.settings.setUserID(this.id); |
| 125 | // if (this.details != null) |
| 126 | // this.details.setUserID(this.id); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 127 | } |
| 128 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 129 | |
| 130 | public Map<String, Object> toMap () { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 131 | Map map = new HashMap(); |
| 132 | map.put(Attributes.USERNAME, this.username); |
| 133 | //TimeUtils.format(new DateTime(this.accountCreation)) |
| 134 | map.put(Attributes.ACCOUNT_CREATION, this.accountCreation); |
| 135 | |
| Michael Hanl | 4f9002d | 2016-01-27 23:21:45 +0100 | [diff] [blame] | 136 | // if (this.getDetails() != null) |
| 137 | // map.putAll(this.getDetails().toMap()); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 138 | return map; |
| 139 | } |
| 140 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 141 | |
| 142 | public Map toCache () { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 143 | Map map = new HashMap(); |
| Michael Hanl | 1939065 | 2016-01-16 11:01:24 +0100 | [diff] [blame] | 144 | map.put(Attributes.ID, this.id); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 145 | map.put(Attributes.USERNAME, this.username); |
| 146 | map.put(Attributes.ACCOUNT_CREATION, |
| 147 | TimeUtils.format(new DateTime(this.accountCreation))); |
| 148 | map.put(Attributes.ACCOUNTLOCK, this.isAccountLocked); |
| 149 | map.put(Attributes.TYPE, this.type); |
| 150 | return map; |
| 151 | } |
| 152 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 153 | |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 154 | @Override |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 155 | public boolean equals (Object o) { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 156 | if (this == o) |
| 157 | return true; |
| 158 | if (!(o instanceof User)) |
| 159 | return false; |
| 160 | User user = (User) o; |
| 161 | if (!username.equals(user.username)) |
| 162 | return false; |
| 163 | return true; |
| 164 | } |
| 165 | |
| margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 166 | // public boolean isAdmin () { |
| 167 | // return this.getUsername().equals(ADMINISTRATOR_ID); |
| 168 | // } |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 169 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 170 | |
| 171 | protected abstract User clone (); |
| 172 | |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 173 | |
| 174 | @Override |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 175 | public String toString () { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 176 | final StringBuffer sb = new StringBuffer(); |
| 177 | sb.append("id='").append(id).append('\''); |
| 178 | sb.append(", username='").append(username).append('\''); |
| 179 | return sb.toString(); |
| 180 | } |
| 181 | |
| Bodmo | c125bf1 | 2017-06-01 16:23:59 +0200 | [diff] [blame] | 182 | public String locationtoString() |
| 183 | |
| 184 | { |
| 185 | if( this.location == Location.INTERN) |
| 186 | return "INTERN"; |
| 187 | else if( this.location == Location.EXTERN ) |
| 188 | return "EXTERN"; |
| 189 | else |
| 190 | return "???"; |
| 191 | } |
| 192 | |
| 193 | public String accesstoString() |
| 194 | |
| 195 | { |
| 196 | if( this.corpusAccess == CorpusAccess.ALL ) |
| 197 | return "ALL"; |
| 198 | else if( this.corpusAccess == CorpusAccess.PUB ) |
| 199 | return "PUB"; |
| 200 | else if( this.corpusAccess == CorpusAccess.FREE ) |
| 201 | return "FREE"; |
| 202 | else |
| 203 | return "???"; |
| 204 | } |
| 205 | |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 206 | public static class UserFactory { |
| 207 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 208 | public static KorAPUser getUser (String username) { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 209 | return new KorAPUser(username); |
| 210 | } |
| 211 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 212 | |
| 213 | public static KorAPUser getUser (String username, String password) { |
| Michael Hanl | f21773f | 2015-10-16 23:02:31 +0200 | [diff] [blame] | 214 | KorAPUser user = new KorAPUser(username); |
| 215 | user.setPassword(password); |
| 216 | return user; |
| 217 | } |
| 218 | |
| margaretha | 62055f7 | 2017-04-11 19:17:43 +0200 | [diff] [blame] | 219 | // public static KorAPUser getAdmin () { |
| 220 | // return new KorAPUser(ADMINISTRATOR_ID, ADMINISTRATOR_NAME); |
| 221 | // } |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 222 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 223 | |
| 224 | public static DemoUser getDemoUser () { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 225 | return new DemoUser(); |
| 226 | } |
| 227 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 228 | |
| 229 | public static DemoUser getDemoUser (Integer id) { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 230 | DemoUser demo = new DemoUser(); |
| 231 | demo.setId(id); |
| 232 | return demo; |
| 233 | } |
| 234 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 235 | |
| 236 | public static boolean isDemo (String username) { |
| Michael Hanl | c444602 | 2016-02-12 18:03:17 +0100 | [diff] [blame] | 237 | return new DemoUser().getUsername().equalsIgnoreCase(username); |
| 238 | } |
| 239 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 240 | |
| 241 | public static ShibUser getShibInstance (String eduPersonID, |
| 242 | String mail, String cn) { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 243 | ShibUser u = new ShibUser(eduPersonID); |
| 244 | u.setAffiliation(""); |
| 245 | u.setMail(mail); |
| 246 | u.setUsername(eduPersonID); |
| 247 | u.setCn(cn); |
| 248 | return u; |
| 249 | } |
| 250 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 251 | |
| 252 | public static KorAPUser toKorAPUser (Map<String, Object> map) { |
| 253 | KorAPUser user = UserFactory.getUser((String) map |
| 254 | .get(Attributes.USERNAME)); |
| Michael Hanl | 7368aa4 | 2016-02-05 18:15:47 +0100 | [diff] [blame] | 255 | user.setPassword((String) map.get(Attributes.PASSWORD)); |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 256 | int id = map.get(Attributes.ID) == null ? -1 : (int) map |
| 257 | .get(Attributes.ID); |
| Michael Hanl | 7368aa4 | 2016-02-05 18:15:47 +0100 | [diff] [blame] | 258 | if (id != -1) |
| 259 | user.setId(id); |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 260 | long cr = map.get(Attributes.ACCOUNT_CREATION) == null ? -1 |
| 261 | : (long) map.get(Attributes.ACCOUNT_CREATION); |
| Michael Hanl | 7368aa4 | 2016-02-05 18:15:47 +0100 | [diff] [blame] | 262 | if (cr != -1) |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 263 | user.setAccountCreation((Long) map |
| 264 | .get(Attributes.ACCOUNT_CREATION)); |
| Michael Hanl | 7368aa4 | 2016-02-05 18:15:47 +0100 | [diff] [blame] | 265 | return user; |
| 266 | } |
| 267 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 268 | |
| 269 | public static User toUser (Map<String, Object> map) { |
| Michael Hanl | e17eaa5 | 2016-01-22 20:55:05 +0100 | [diff] [blame] | 270 | KustvaktMap kmap = new KustvaktMap(map); |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 271 | int type = map.get(Attributes.TYPE) == null ? 0 : (Integer) kmap |
| 272 | .get(Attributes.TYPE, Integer.class); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 273 | User user; |
| Michael Hanl | 1939065 | 2016-01-16 11:01:24 +0100 | [diff] [blame] | 274 | long created = -1; |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 275 | int id = kmap.get(Attributes.ID, Integer.class) == null ? -1 |
| 276 | : (Integer) kmap.get(Attributes.ID, Integer.class); |
| Michael Hanl | 7368aa4 | 2016-02-05 18:15:47 +0100 | [diff] [blame] | 277 | |
| Michael Hanl | 1939065 | 2016-01-16 11:01:24 +0100 | [diff] [blame] | 278 | if (map.get(Attributes.ACCOUNT_CREATION) != null) |
| Michael Hanl | c0ed00f | 2016-06-23 14:33:10 +0200 | [diff] [blame] | 279 | created = TimeUtils.getTime(kmap.get(Attributes.ACCOUNT_CREATION)) |
| Michael Hanl | 1939065 | 2016-01-16 11:01:24 +0100 | [diff] [blame] | 280 | .getMillis(); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 281 | switch (type) { |
| 282 | case 0: |
| Michael Hanl | e17eaa5 | 2016-01-22 20:55:05 +0100 | [diff] [blame] | 283 | user = UserFactory.getUser(kmap.get(Attributes.USERNAME)); |
| Michael Hanl | 7368aa4 | 2016-02-05 18:15:47 +0100 | [diff] [blame] | 284 | if (id != -1) |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 285 | user.setId((Integer) kmap.get(Attributes.ID, |
| 286 | Integer.class)); |
| 287 | user.setAccountLocked(map.get(Attributes.ACCOUNTLOCK) == null ? false |
| 288 | : (Boolean) kmap.get(Attributes.ACCOUNTLOCK, |
| 289 | Boolean.class)); |
| Michael Hanl | 1939065 | 2016-01-16 11:01:24 +0100 | [diff] [blame] | 290 | user.setAccountCreation(created); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 291 | break; |
| 292 | default: |
| Michael Hanl | 7368aa4 | 2016-02-05 18:15:47 +0100 | [diff] [blame] | 293 | user = UserFactory.getDemoUser(); |
| Michael Hanl | 1939065 | 2016-01-16 11:01:24 +0100 | [diff] [blame] | 294 | user.setAccountCreation(created); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 295 | } |
| 296 | return user; |
| 297 | } |
| 298 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 299 | |
| margaretha | 894a7d7 | 2017-11-08 19:24:20 +0100 | [diff] [blame] | 300 | public static KorAPUser toUser (String value) throws KustvaktException { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 301 | JsonNode node = JsonUtils.readTree(value); |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 302 | KorAPUser user = UserFactory.getUser(node.path(Attributes.USERNAME) |
| 303 | .asText()); |
| 304 | user.setAccountLocked(node.path(Attributes.ACCOUNTLOCK).asBoolean()); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 305 | user.setAccountLink(node.path(Attributes.ACCOUNTLINK).asText()); |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 306 | user.setAccountCreation(node.path(Attributes.ACCOUNT_CREATION) |
| 307 | .asLong()); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 308 | user.setPassword(node.path(Attributes.PASSWORD).asText()); |
| 309 | return user; |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | } |