-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
49 lines (38 loc) · 1.42 KB
/
Copy pathUser.java
File metadata and controls
49 lines (38 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package javaxt.demo.express;
import java.util.concurrent.atomic.AtomicLong;
//******************************************************************************
//** User Class
//******************************************************************************
/**
* Simple implementation of a User class
*
******************************************************************************/
public class User implements java.security.Principal, javaxt.express.User {
public static AtomicLong userIDs = new AtomicLong(0);
private long id;
protected String username;
protected String password;
public User(String username, String password){
this.id = userIDs.incrementAndGet();
this.username = username;
this.password = password;
}
//**************************************************************************
//** getID
//**************************************************************************
/** Returns a user ID - required for implementations of the
* javaxt.express.User interface
*/
public Long getID(){
return id;
}
//**************************************************************************
//** getName
//**************************************************************************
/** Returns a username/email - required for implementations of the
* java.security.Principal interface.
*/
public String getName(){
return username;
}
}