KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > protocol > ws > objects > UserDataVOWS


1 package org.ejbca.core.protocol.ws.objects;
2
3 import java.io.Serializable JavaDoc;
4
5 import org.ejbca.core.model.SecConst;
6 import org.ejbca.core.model.ra.UserDataConstants;
7
8 /**
9  * Class used to represent userdata in the WebService API.
10  * Is used instead of UserDataVO because of profilenames is used instead of id's.
11  *
12  * @author Philip Vendil
13  * $id$
14  */

15
16 public class UserDataVOWS implements Serializable JavaDoc{
17     
18     public static final java.lang.String JavaDoc TOKEN_TYPE_USERGENERATED = "USERGENERATED";
19     public static final java.lang.String JavaDoc TOKEN_TYPE_JKS = "JKS";
20     public static final java.lang.String JavaDoc TOKEN_TYPE_PEM = "PEM";
21     public static final java.lang.String JavaDoc TOKEN_TYPE_P12 = "P12";
22     
23     public static final int STATUS_NEW = UserDataConstants.STATUS_NEW; // New user
24
public static final int STATUS_FAILED = UserDataConstants.STATUS_FAILED; // Generation of user certificate failed
25
public static final int STATUS_INITIALIZED = UserDataConstants.STATUS_INITIALIZED;// User has been initialized
26
public static final int STATUS_INPROCESS = UserDataConstants.STATUS_INPROCESS; // Generation of user certificate in process
27
public static final int STATUS_GENERATED = UserDataConstants.STATUS_GENERATED; // A certificate has been generated for the user
28
public static final int STATUS_REVOKED = UserDataConstants.STATUS_REVOKED; // The user has been revoked and should not have any more certificates issued
29
public static final int STATUS_HISTORICAL = UserDataConstants.STATUS_HISTORICAL; // The user is old and archived
30
public static final int STATUS_KEYRECOVERY = UserDataConstants.STATUS_KEYRECOVERY; // The user is should use key recovery functions in next certificate generation.
31

32     private java.lang.String JavaDoc username = null;
33     private java.lang.String JavaDoc password = null;
34     private boolean clearPwd = false;
35     private java.lang.String JavaDoc subjectDN = null;
36     private java.lang.String JavaDoc caName = null;
37     private java.lang.String JavaDoc subjectAltName = null;
38     private java.lang.String JavaDoc email = null;
39     private int status = 0;
40     private java.lang.String JavaDoc tokenType = null;
41     private boolean sendNotification = false;
42     private boolean keyRecoverable = false;
43     private java.lang.String JavaDoc endEntityProfileName = null;
44     private java.lang.String JavaDoc certificateProfileName = null;
45     private java.lang.String JavaDoc hardTokenIssuerName = null;
46
47
48     /**
49      * Emtpy constructor used by internally by web services
50      */

51     public UserDataVOWS(){}
52     
53     /**
54      * Constructor used when creating a new UserDataVOWS.
55      *
56      * @param username the unique username if the user, used internally in EJBCA
57      * @param password, password used to lock the keystore
58      * @param subjectDN of
59      * @param caName the name of the CA used in the EJBCA web gui.
60      * @param subjectAltName
61      * @param email
62      * @param status one of the STATUS_ constants
63      * @param tokenType type of token, one of TOKEN_TYPE constants for soft tokens, for hard ones use hardtokenprofilename
64      * @param endEntityProfileName
65      * @param certificateProfileName
66      * @param hardTokenIssuerName if no hardTokenIssuer should be used then use null.
67      */

68     public UserDataVOWS(java.lang.String JavaDoc username, java.lang.String JavaDoc password, boolean clearPwd, java.lang.String JavaDoc subjectDN, java.lang.String JavaDoc caName, java.lang.String JavaDoc subjectAltName, java.lang.String JavaDoc email, int status, java.lang.String JavaDoc tokenType, java.lang.String JavaDoc endEntityProfileName, java.lang.String JavaDoc certificateProfileName, java.lang.String JavaDoc hardTokenIssuerName) {
69         super();
70         this.username = username;
71         this.password = password;
72         this.clearPwd = clearPwd;
73         this.subjectDN = subjectDN;
74         this.caName = caName;
75         this.subjectAltName = subjectAltName;
76         this.email = email;
77         this.status = status;
78         this.tokenType = tokenType;
79         this.endEntityProfileName = endEntityProfileName;
80         this.certificateProfileName = certificateProfileName;
81         this.hardTokenIssuerName = hardTokenIssuerName;
82     }
83
84     
85     /**
86      *
87      * @return true if the user is keyrecoverable
88      */

89     public boolean getKeyRecoverable(){
90         return this.keyRecoverable;
91     }
92     
93     /**
94      * indicates if the users keys should be keyrecoverable
95      * @param keyrecoverable
96      */

97     public void setKeyRecoverable(boolean keyrecoverable){
98       this.keyRecoverable = keyrecoverable;
99     }
100     
101     /**
102      * If true notifications will be sent to the user
103      */

104     public boolean getSendNotification(){
105         return sendNotification;
106     }
107     
108     /**
109      * set to true if notifications should be sent to the user.
110      */

111     public void setSendNotification(boolean sendnotification){
112         this.sendNotification = sendnotification;
113     }
114     
115     /**
116      * @return Returns the cAName.
117      */

118     public java.lang.String JavaDoc getCaName() {
119         return caName;
120     }
121
122
123     /**
124      * @return Returns the certificateProfileName.
125      */

126     public java.lang.String JavaDoc getCertificateProfileName() {
127         return certificateProfileName;
128     }
129
130
131     /**
132      * @return Returns the email.
133      */

134     public java.lang.String JavaDoc getEmail() {
135         return email;
136     }
137
138
139     /**
140      * @return Returns the endEntityProfileName.
141      */

142     public java.lang.String JavaDoc getEndEntityProfileName() {
143         return endEntityProfileName;
144     }
145
146
147     /**
148      * @return Returns the hardTokenIssuerName.
149      */

150     public java.lang.String JavaDoc getHardTokenIssuerName() {
151         return hardTokenIssuerName;
152     }
153
154
155     /**
156      * Observe when sending userdata to clients outside EJBCA will the password
157      * always be null.
158      *
159      * @return Returns the password.
160      */

161     public java.lang.String JavaDoc getPassword() {
162         return password;
163     }
164
165     /**
166      * Observe sending usedata to clients outside EJBCA will always return false
167      * @return Returns the clearpwd.
168      */

169     public boolean getClearPwd() {
170         return clearPwd;
171     }
172
173     /**
174      * @return Returns the status.
175      */

176     public int getStatus() {
177         return status;
178     }
179
180
181     /**
182      * @return Returns the subjecDN.
183      */

184     public java.lang.String JavaDoc getSubjectDN() {
185         return subjectDN;
186     }
187
188
189     /**
190      * @return Returns the subjectAltName.
191      */

192     public java.lang.String JavaDoc getSubjectAltName() {
193         return subjectAltName;
194     }
195
196
197     /**
198      * @return Returns the tokenType. One of TOKEN_TYPE constants for soft tokens, for hard ones use hardtokenprofilename
199      */

200     public java.lang.String JavaDoc getTokenType() {
201         return tokenType;
202     }
203
204
205     /**
206      * @return Returns the type.
207      */

208     public int getType() {
209         int type = 1;
210         
211         if(sendNotification)
212             type = type | SecConst.USER_SENDNOTIFICATION;
213         else
214             type = type & (~SecConst.USER_SENDNOTIFICATION);
215         
216         if(keyRecoverable)
217             type = type | SecConst.USER_KEYRECOVERABLE;
218         else
219             type = type & (~SecConst.USER_KEYRECOVERABLE);
220                 
221         return type;
222     }
223
224
225     /**
226      * @return Returns the username.
227      */

228     public java.lang.String JavaDoc getUsername() {
229         return username;
230     }
231
232     /**
233      * @param name The cAName to set.
234      */

235     public void setCaName(java.lang.String JavaDoc name) {
236         caName = name;
237     }
238
239     /**
240      * @param certificateProfileName The certificateProfileName to set.
241      */

242     public void setCertificateProfileName(java.lang.String JavaDoc certificateProfileName) {
243         this.certificateProfileName = certificateProfileName;
244     }
245
246     /**
247      * @param clearpwd The clearpwd to set.
248      */

249     public void setClearPwd(boolean clearPwd) {
250         this.clearPwd = clearPwd;
251     }
252
253     /**
254      * @param email The email to set.
255      */

256     public void setEmail(java.lang.String JavaDoc email) {
257         this.email = email;
258     }
259
260     /**
261      * @param endEntityProfileName The endEntityProfileName to set.
262      */

263     public void setEndEntityProfileName(java.lang.String JavaDoc endEntityProfileName) {
264         this.endEntityProfileName = endEntityProfileName;
265     }
266
267     /**
268      * @param hardTokenIssuerName The hardTokenIssuerName to set.
269      */

270     public void setHardTokenIssuerName(java.lang.String JavaDoc hardTokenIssuerName) {
271         this.hardTokenIssuerName = hardTokenIssuerName;
272     }
273
274     /**
275      * @param password The password to set.
276      */

277     public void setPassword(java.lang.String JavaDoc password) {
278         this.password = password;
279     }
280
281     /**
282      * @param status The status to set.
283      */

284     public void setStatus(int status) {
285         this.status = status;
286     }
287
288     /**
289      * @param subjectAltName The subjectAltName to set.
290      */

291     public void setSubjectAltName(java.lang.String JavaDoc subjectAltName) {
292         this.subjectAltName = subjectAltName;
293     }
294
295     /**
296      * @param subjectDN The subjectDN to set.
297      */

298     public void setSubjectDN(java.lang.String JavaDoc subjectDN) {
299         this.subjectDN = subjectDN;
300     }
301
302     /**
303      * @param tokenType The tokenType to set.
304      */

305     public void setTokenType(java.lang.String JavaDoc tokenType) {
306         this.tokenType = tokenType;
307     }
308
309
310
311     /**
312      * @param username The username to set.
313      */

314     public void setUsername(java.lang.String JavaDoc username) {
315         this.username = username;
316     }
317     
318
319     
320     
321
322         
323
324 }
325
Popular Tags