Revision 9:16125cca68e4 src/my/com/upass/Constants.java
src/my/com/upass/Constants.java | ||
---|---|---|
5 | 5 |
*/ |
6 | 6 |
package my.com.upass; |
7 | 7 |
|
8 |
import java.text.SimpleDateFormat; |
|
9 | 8 |
import java.util.HashMap; |
10 | 9 |
|
11 | 10 |
/** |
12 | 11 |
* @author Administrator |
13 | 12 |
* |
14 | 13 |
*/ |
15 |
public class Constants { |
|
16 |
// object query mode |
|
17 |
public static final int MODE_QUSERBEAN = 0; |
|
18 |
public static final int MODE_QTACBEAN = 1; |
|
19 |
public static final int MODE_QVASCOBEAN = 2; |
|
20 |
|
|
14 |
public class Constants extends MinimalConstants { |
|
21 | 15 |
public static final int MODE_QNEXTVAL = 0; |
22 | 16 |
public static final int MODE_QCURRVAL = 1; |
23 | 17 |
|
24 |
// user ID state |
|
25 |
public static final int UID_STATE_ACTIVE = 0; |
|
26 |
public static final int UID_STATE_TMP_LOCKED = 1; |
|
27 | 18 |
public static final int UID_STATE_LOCKED = 2; |
28 | 19 |
public static final int UID_STATE_INACTIVE = 3; |
29 | 20 |
public static final int UID_STATE_DELETED = 4; |
... | ... | |
35 | 26 |
public static final int TKN_STATE_LOCKED = 3; |
36 | 27 |
public static final int TKN_STATE_DELETED = 4; |
37 | 28 |
|
38 |
// user Type |
|
39 |
public static final int UTYPE_STATE_ROOT = 0; |
|
40 |
public static final int UTYPE_STATE_ADMIN = 1; |
|
41 |
public static final int UTYPE_STATE_USER = 2; |
|
42 |
|
|
43 |
// password status |
|
44 |
public static final int PASSWD_STATUS_ENABLE = 0; |
|
45 | 29 |
public static final int PASSWD_STATUS_DISABLE = 1; |
46 | 30 |
public static final int PASSWD_STATUS_ONETIMEUSED = 2; |
47 | 31 |
public static final int PASSWD_LIFE_SPAN = 30; |
48 |
public static final int PASSWD_NEVER_EXPIRE = 1; |
|
49 |
public static final int PASSWD_WILL_EXPIRE = 0; |
|
50 |
|
|
51 | 32 |
// general status |
52 | 33 |
public static final int YES = 0; |
53 | 34 |
public static final int NO = 1; |
54 | 35 |
public static final int NEVER = 9; |
55 | 36 |
|
56 |
// application Error Code |
|
57 |
public static final int ERR_SUCCESS = 0; |
|
58 |
public static final int ERR_INVALID_CREDENTIAL = 1; |
|
59 |
public static final int ERR_EXCEED_MAX_TRIES = 2; |
|
60 |
public static final int ERR_REUSED_PASSWD = 3; |
|
61 |
public static final int ERR_PASSWD_EXPIRED = 4; |
|
62 |
public static final int ERR_INVALID_STATE = 5; |
|
63 |
public static final int ERR_USERALIAS_NOT_FOUND = 6; |
|
64 |
public static final int ERR_TOKEN_NOT_ASSIGNED = 7; |
|
65 | 37 |
public static final int ERR_TOKEN_ALREADY_ASSIGNED = 8; |
66 | 38 |
public static final int ERR_TOKEN_NOT_EXIST = 9; |
67 |
public static final int ERR_APP_SERV_NOT_PERMITTED = 10; |
|
68 |
public static final int ERR_ALREADY_EXIST = 11; |
|
69 | 39 |
public static final int ERR_TAC_ALREADY_EXIST = 12; |
70 | 40 |
public static final int ERR_EXCEED_MAX_USE = 13; |
71 | 41 |
public static final int ERR_INVALID_SESSION = 14; |
72 | 42 |
public static final int ERR_USER_DORMANT = 15; |
73 |
public static final int ERR_INVALID_USERALIAS = 16; |
|
74 |
public static final int ERR_PASSWORD_SAMEAS_USERALIAS = 17; |
|
75 |
|
|
76 |
public static final int ERR_PASSWD_EXPIRED_NOTIFICATION = 27; |
|
77 |
public static final int ERR_PASSWD_CHANGE_INTERVAL = 28; |
|
78 |
|
|
79 | 43 |
//Additional error code for gemalto application (from code 18 to code 26) |
80 | 44 |
public static final int ERR_BLOBINVALID = 18; |
81 | 45 |
public static final int ERR_BUFFER = 19; |
... | ... | |
88 | 52 |
public static final int ERR_AUTH_MODE = 26; |
89 | 53 |
|
90 | 54 |
|
91 |
public static final int ERR_PASSWD_WEAK = 96; |
|
92 |
public static final int ERR_INVALID_INPUT = 97; |
|
93 |
public static final int ERR_SYSTEM_NOT_READY = 98; |
|
94 | 55 |
public static final int ERR_UNKNOWN = 99; |
95 | 56 |
public static final int ERR_SECURITY_CODE_ALREADY_EXIST = 32; |
96 | 57 |
|
... | ... | |
225 | 186 |
public static final String OCRASUITE = "OCRA-1:HOTP-SHA1-8:QH64-T30S"; |
226 | 187 |
public static final int TIMESTEPUSED = 30; //default is 30 due to S'pore regulation |
227 | 188 |
|
228 |
// application Error Text |
|
229 |
public static HashMap<String,String> getErrText(String code) { |
|
230 |
HashMap<String,String> map = new HashMap<String,String>(); |
|
231 |
|
|
232 |
// begin text |
|
233 |
map.put("0", "ERR_SUCCESS" ); |
|
234 |
map.put("1", "ERR_INVALID_CREDENTIAL" ); |
|
235 |
map.put("2", "ERR_EXCEED_MAX_TRIES" ); |
|
236 |
map.put("3", "ERR_REUSED_PASSWD" ); |
|
237 |
map.put("4", "ERR_PASSWD_EXPIRED" ); |
|
238 |
map.put("5", "ERR_INVALID_STATE" ); |
|
239 |
map.put("6", "ERR_USERALIAS_NOT_FOUND" ); |
|
240 |
map.put("7", "ERR_TOKEN_NOT_ASSIGNED" ); |
|
241 |
map.put("8", "ERR_TOKEN_ALREADY_ASSIGNED" ); |
|
242 |
map.put("9", "ERR_TOKEN_NOT_EXIST" ); |
|
243 |
map.put("10", "ERR_APP_SERV_NOT_PERMITTED" ); |
|
244 |
map.put("11", "ERR_ALREADY_EXIST" ); |
|
245 |
map.put("12", "ERR_TAC_ALREADY_EXIST" ); |
|
246 |
map.put("13", "ERR_EXCEED_MAX_USE" ); |
|
247 |
map.put("14", "ERR_INVALID_SESSION" ); |
|
248 |
map.put("15", "ERR_EXCEED_MAX_USE" ); |
|
249 |
map.put("16", "ERR_USER_DORMANT" ); |
|
250 |
map.put("17", "ERR_PASSWORD_SAMEAS_USERALIAS" ); |
|
251 |
|
|
252 |
//Additional error text for gemalto application (from text 18 to text 26) |
|
253 |
map.put("18", "ERR_BLOBINVALID" ); |
|
254 |
map.put("19", "ERR_BUFFER" ); |
|
255 |
map.put("20", "ERR_PARAM" ); |
|
256 |
map.put("21", "ERR_SNOINVALID" ); |
|
257 |
map.put("22", "ERR_OTPINVALID" ); |
|
258 |
map.put("23", "ERR_BLOBOTINIT" ); |
|
259 |
map.put("24", "ERR_FAILED" ); |
|
260 |
map.put("25", "ERR_REQINVALID" ); |
|
261 |
map.put("26", "ERR_AUTH_MODE" ); |
|
262 |
|
|
263 |
map.put("96", "ERR_PASSWD_WEAK" ); |
|
264 |
map.put("97", "ERR_INVALID_INPUT" ); |
|
265 |
map.put("98", "ERR_SYSTEM_NOT_READY" ); |
|
266 |
map.put("99", "ERR_UNKNOWN" ); |
|
267 |
|
|
268 |
//Additional error code for secure metric application (from code 102 to code 225) |
|
269 |
map.put("101", "Execution failure" ); |
|
270 |
map.put("102", "Invalid parameter" ); |
|
271 |
map.put("103", "Incorrect license file" ); |
|
272 |
map.put("104", "License file expired" ); |
|
273 |
map.put("105", "Successful authentication" ); |
|
274 |
map.put("106", "No username found" ); |
|
275 |
map.put("107", "No dynamic password found" ); |
|
276 |
map.put("108", "No user PIN found" ); |
|
277 |
map.put("109", "No token number found" ); |
|
278 |
map.put("110", "Invalid username" ); |
|
279 |
map.put("111", "Invalid OTP" ); |
|
280 |
map.put("112", "Invalid token seed" ); |
|
281 |
map.put("113", "Invalid authentication base number" ); |
|
282 |
map.put("114", "The token should be synchronized" ); |
|
283 |
map.put("115", "Invalid clock offset" ); |
|
284 |
map.put("116", "Invalid user PIN" ); |
|
285 |
map.put("117", "Invalid database user PIN" ); |
|
286 |
map.put("118", "Failed to get userinformation" ); |
|
287 |
map.put("119", "Failed to get token information" ); |
|
288 |
map.put("120", "The token has been reported as lost" ); |
|
289 |
map.put("121", "The token has beenlocked" ); |
|
290 |
map.put("122", "No PIN in database" ); |
|
291 |
map.put("123", "Invalid token type" ); |
|
292 |
map.put("124", "Invalid token number" ); |
|
293 |
map.put("125", "Failed to get token assignment status" ); |
|
294 |
map.put("126", "Failed to get the number of the tokens assigned to the user" ); |
|
295 |
map.put("127", "The token has been assigned" ); |
|
296 |
map.put("128", "The number of the tokens that are bound is the maximum already" ); |
|
297 |
map.put("129", "Need to verify PIN" ); |
|
298 |
map.put("130", "The user is inactive" ); |
|
299 |
map.put("131", "No authentication agent found" ); |
|
300 |
map.put("132", "No authentication server found" ); |
|
301 |
map.put("133", "No shared key found" ); |
|
302 |
map.put("134", "Configuration file error" ); |
|
303 |
map.put("135", "Database type error" ); |
|
304 |
map.put("136", "Connection error" ); |
|
305 |
map.put("137", "No data source found or driver error" ); |
|
306 |
map.put("138", "No database found" ); |
|
307 |
map.put("139", "No server found or access denied" ); |
|
308 |
map.put("140", "Username/password error, logon failure" ); |
|
309 |
map.put("141", "No connection available" ); |
|
310 |
map.put("142", "The number of connections is the maximum already" ); |
|
311 |
map.put("143", "The operation is restricted by user source settings" ); |
|
312 |
map.put("144", "The user already exists" ); |
|
313 |
map.put("145", "The user does not exist" ); |
|
314 |
map.put("146", "The record does not exist" ); |
|
315 |
map.put("147", "The token already exists" ); |
|
316 |
map.put("148", "The token does not exist" ); |
|
317 |
map.put("149", "The agent already exists" ); |
|
318 |
map.put("150", "The agent does not exist" ); |
|
319 |
map.put("151", "The authentication server already exists" ); |
|
320 |
map.put("152", "The authentication server does not exist" ); |
|
321 |
map.put("153", "User source type error" ); |
|
322 |
map.put("154", "The buffer is not long enough" ); |
|
323 |
map.put("155", "Failed to execute a query" ); |
|
324 |
map.put("156", "Failed to add user information" ); |
|
325 |
map.put("157", "Failed to delete user information" ); |
|
326 |
map.put("158", "Failed to search for user information" ); |
|
327 |
map.put("159", "Failed to change user information" ); |
|
328 |
map.put("160", "Failed to add token information" ); |
|
329 |
map.put("161", "Failed to delete token information" ); |
|
330 |
map.put("162", "Failed to search for token information" ); |
|
331 |
map.put("163", "Failed to change token information" ); |
|
332 |
map.put("164", "Failed to bind token" ); |
|
333 |
map.put("165", "Failed to unbind token" ); |
|
334 |
map.put("166", "The token has not been bound" ); |
|
335 |
map.put("167", "Failed to add authentication agent" ); |
|
336 |
map.put("168", "Failed to delete authentication agent" ); |
|
337 |
map.put("169", "Failed to update authentication agent" ); |
|
338 |
map.put("170", "Failed to get authentication agent" ); |
|
339 |
map.put("171", "Failed to add authentication server" ); |
|
340 |
map.put("172", "Failed to delete authentication server" ); |
|
341 |
map.put("173", "Failed to update authentication server" ); |
|
342 |
map.put("174", "Failed to get authentication server" ); |
|
343 |
map.put("175", "Failed to add mapping to authentication agent" ); |
|
344 |
map.put("176", "Failed to delete mapping to authentication agent" ); |
|
345 |
map.put("177", "Failed to update mapping to authentication agent" ); |
|
346 |
map.put("178", "Failed to get mapping to authentication agent" ); |
|
347 |
map.put("179", "Failed to add log" ); |
|
348 |
map.put("180", "Failed to delete log" ); |
|
349 |
map.put("181", "Failed to update log" ); |
|
350 |
map.put("182", "Failed to get log" ); |
|
351 |
map.put("183", "Failed to add configuration" ); |
|
352 |
map.put("184", "Failed to delete configuration" ); |
|
353 |
map.put("185", "Failed to update configuration" ); |
|
354 |
map.put("186", "Failed to get configuration" ); |
|
355 |
map.put("187", "Failed to add administrator group" ); |
|
356 |
map.put("188", "Failed to delete administrator group" ); |
|
357 |
map.put("189", "Failed to update administrator group" ); |
|
358 |
map.put("190", "Failed to get administrator group" ); |
|
359 |
map.put("191", "Failed to add administration log" ); |
|
360 |
map.put("192", "Failed to delete administration log" ); |
|
361 |
map.put("193", "Failed to update administration log" ); |
|
362 |
map.put("194", "Failed to get administration log" ); |
|
363 |
map.put("195", "Failed to add administrator" ); |
|
364 |
map.put("196", "Failed to delete administrator" ); |
|
365 |
map.put("197", "Failed to update administrator" ); |
|
366 |
map.put("198", "Failed to get administrator" ); |
|
367 |
map.put("199", "Failed to add domain" ); |
|
368 |
map.put("200", "Failed to delete domain" ); |
|
369 |
map.put("201", "Failed to update domain" ); |
|
370 |
map.put("202", "Failed to get domain" ); |
|
371 |
map.put("203", "Failed to add temporary user" ); |
|
372 |
map.put("204", "Failed to delete temporary user" ); |
|
373 |
map.put("205", "Failed to update temporary user" ); |
|
374 |
map.put("206", "Failed to get temporary user" ); |
|
375 |
map.put("207", "Failed to reload database connection" ); |
|
376 |
map.put("208", "Failed to load LOG4J configuration file" ); |
|
377 |
map.put("209", "Failed to add application group" ); |
|
378 |
map.put("210", "Failed to delete application group" ); |
|
379 |
map.put("211", "Failed to update application group" ); |
|
380 |
map.put("212", "Failed to get application group" ); |
|
381 |
map.put("213", "Failed to add user and application group" ); |
|
382 |
map.put("214", "Failed to delete user and application group" ); |
|
383 |
map.put("215", "Failed to update user and application group" ); |
|
384 |
map.put("216", "Failed to get user and application group" ); |
|
385 |
map.put("217", "Failed to add zone" ); |
|
386 |
map.put("218", "Failed to delete zone" ); |
|
387 |
map.put("219", "Failed to update zone" ); |
|
388 |
map.put("220", "Failed to get zone" ); |
|
389 |
map.put("221", "Failed to add license" ); |
|
390 |
map.put("222", "Failed to delete license" ); |
|
391 |
map.put("223", "Failed to update license" ); |
|
392 |
map.put("224", "Failed to get license" ); |
|
393 |
map.put("225", "Failed to initialize LDAP" ); |
|
394 |
// end text here |
|
395 |
|
|
396 |
return map; |
|
397 |
} |
|
398 |
|
|
399 | 189 |
//Gemalto authentication mode |
400 | 190 |
public static HashMap <String,Integer> authModeMapInstance = null; |
401 | 191 |
|
... | ... | |
419 | 209 |
return getAuthInstance().get(authMode); |
420 | 210 |
} |
421 | 211 |
|
422 |
/** |
|
423 |
* defaultDateFormat = "dd-MM-yyyy HH:mm:ss"; |
|
424 |
*/ |
|
425 |
public static final SimpleDateFormat defaultDateFormat = new SimpleDateFormat( |
|
426 |
"dd-MM-yyyy HH:mm:ss"); |
|
427 |
|
|
428 | 212 |
public static final String TYPE_SYSTEM = "SYSTEM"; |
429 | 213 |
public static final int SYSTEM_ID = 0; |
430 | 214 |
|
Also available in: Unified diff