| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 1 | package de.ids_mannheim.korap.user; |
| 2 | |
| 3 | import lombok.Data; |
| 4 | |
| 5 | /** |
| 6 | * User: hanl |
| 7 | * Date: 10/16/13 |
| 8 | * Time: 2:02 PM |
| 9 | */ |
| 10 | @Data |
| 11 | public class ShibUser extends User { |
| 12 | |
| 13 | private String mail; |
| 14 | private String affiliation; |
| 15 | private String cn; |
| 16 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 17 | |
| 18 | protected ShibUser () { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 19 | super(1); |
| 20 | } |
| 21 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 22 | |
| 23 | private ShibUser (String eduPersonID, String mail, String cn, |
| 24 | String affiliation) { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 25 | this(eduPersonID); |
| 26 | this.setUsername(eduPersonID); |
| 27 | this.mail = mail; |
| 28 | this.affiliation = affiliation; |
| 29 | this.cn = cn; |
| 30 | } |
| 31 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 32 | |
| 33 | public ShibUser (String username) { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 34 | super(username, 1); |
| 35 | |
| 36 | } |
| 37 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 38 | |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 39 | @Override |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 40 | public String toString () { |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 41 | final StringBuffer sb = new StringBuffer("ShibUser{"); |
| 42 | sb.append(", mail='").append(mail).append('\''); |
| 43 | sb.append(", affiliation='").append(affiliation).append('\''); |
| 44 | sb.append(", cn='").append(cn).append('\''); |
| 45 | sb.append('}'); |
| 46 | return sb.toString(); |
| 47 | } |
| 48 | |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 49 | |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 50 | @Override |
| Michael Hanl | 8abaf9e | 2016-05-23 16:46:35 +0200 | [diff] [blame] | 51 | protected User clone () { |
| 52 | return new ShibUser(this.getUsername(), this.getMail(), this.getCn(), |
| 53 | this.getAffiliation()); |
| Michael Hanl | ca740d7 | 2015-06-16 10:04:58 +0200 | [diff] [blame] | 54 | } |
| 55 | } |