1 13 14 package se.anatom.ejbca.common; 15 16 import java.io.Serializable ; 17 import java.util.Date ; 18 19 import org.ejbca.core.model.SecConst; 20 import org.ejbca.core.model.ra.ExtendedInformation; 21 import org.ejbca.util.StringTools; 22 23 24 31 public class UserDataVO implements Serializable { 32 33 public static final int NO_ENDENTITYPROFILE = 0; 35 public static final int NO_CERTIFICATEPROFILE = 0; 36 37 38 private String username; 39 private String subjectDN; 40 private int caid; 41 private String subjectAltName; 42 private String subjectEmail; 43 private String password; 44 private int status; 45 46 private int type; 47 private int endentityprofileid; 48 private int certificateprofileid; 49 private Date timecreated; 50 private Date timemodified; 51 private int tokentype; 52 private int hardtokenissuerid; 53 private ExtendedInformation extendedinformation; 54 55 56 public UserDataVO() { 57 } 58 59 76 public UserDataVO(String user, String dn, int caid, String subjectaltname, String email, int status, int type, int endentityprofileid, int certificateprofileid, 77 Date timecreated, Date timemodified, int tokentype, int hardtokenissuerid, ExtendedInformation extendedinfo) { 78 this.username=StringTools.strip(user); 79 this.password=null; 80 this.subjectDN=dn; 81 this.caid=caid; 82 this.subjectAltName=subjectaltname; 83 this.subjectEmail=email; 84 this.status=status; 85 this.type=type; 86 this.endentityprofileid=endentityprofileid; 87 this.certificateprofileid=certificateprofileid; 88 this.timecreated=timecreated; 89 this.timemodified=timemodified; 90 this.tokentype = tokentype; 91 this.hardtokenissuerid = hardtokenissuerid; 92 this.extendedinformation = extendedinfo; 93 } 94 public void setUsername(String user) { this.username=StringTools.strip(user);} 95 public String getUsername() {return username;} 96 public void setDN(String dn) {this.subjectDN=dn;} 97 public String getDN() {return subjectDN;} 98 public int getCAId(){return this.caid;} 99 public void setCAId(int caid){this.caid=caid;} 100 public void setSubjectAltName( String subjectaltname) { this.subjectAltName=subjectaltname; } 101 public String getSubjectAltName() {return this.subjectAltName;} 102 public void setEmail(String email) {this.subjectEmail = email;} 103 public String getEmail() {return subjectEmail;} 104 public void setPassword(String pwd) {this.password = pwd;} 105 public String getPassword() {return password;} 106 public void setStatus(int status) {this.status=status;} 107 public int getStatus() {return status;} 108 public void setType(int type) {this.type=type;} 109 public int getType() {return type;} 110 public void setEndEntityProfileId(int endentityprofileid) { this.endentityprofileid=endentityprofileid; } 111 public int getEndEntityProfileId(){ return this.endentityprofileid; } 112 public void setCertificateProfileId(int certificateprofileid) { this.certificateprofileid=certificateprofileid; } 113 public int getCertificateProfileId() {return this.certificateprofileid;} 114 public void setTimeCreated(Date timecreated) { this.timecreated=timecreated; } 115 public Date getTimeCreated() {return this.timecreated;} 116 public void setTimeModified(Date timemodified) { this.timemodified=timemodified; } 117 public Date getTimeModified() {return this.timemodified;} 118 public int getTokenType(){ return this.tokentype;} 119 public void setTokenType(int tokentype) {this.tokentype=tokentype;} 120 public int getHardTokenIssuerId() {return this.hardtokenissuerid;} 121 public void setHardTokenIssuerId(int hardtokenissuerid) { this.hardtokenissuerid=hardtokenissuerid;} 122 123 public boolean getAdministrator(){ 124 return (type & SecConst.USER_ADMINISTRATOR) == SecConst.USER_ADMINISTRATOR; 125 } 126 127 public void setAdministrator(boolean administrator){ 128 if(administrator) 129 type = type | SecConst.USER_ADMINISTRATOR; 130 else 131 type = type & (~SecConst.USER_ADMINISTRATOR); 132 } 133 134 public boolean getKeyRecoverable(){ 135 return (type & SecConst.USER_KEYRECOVERABLE) == SecConst.USER_KEYRECOVERABLE; 136 } 137 138 public void setKeyRecoverable(boolean keyrecoverable){ 139 if(keyrecoverable) 140 type = type | SecConst.USER_KEYRECOVERABLE; 141 else 142 type = type & (~SecConst.USER_KEYRECOVERABLE); 143 } 144 145 public boolean getSendNotification(){ 146 return (type & SecConst.USER_SENDNOTIFICATION) == SecConst.USER_SENDNOTIFICATION; 147 } 148 149 public void setSendNotification(boolean sendnotification){ 150 if(sendnotification) 151 type = type | SecConst.USER_SENDNOTIFICATION; 152 else 153 type = type & (~SecConst.USER_SENDNOTIFICATION); 154 } 155 156 159 public ExtendedInformation getExtendedinformation() { 160 return extendedinformation; 161 } 162 165 public void setExtendedinformation(ExtendedInformation extendedinformation) { 166 this.extendedinformation = extendedinformation; 167 } 168 } 169 | Popular Tags |