source: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/vistalink/VistaUser.java@ 1227

Last change on this file since 1227 was 1227, checked in by George Lilly, 13 years ago

initial load of EDIS 1.0

File size: 5.0 KB
Line 
1package gov.va.med.edp.springframework.security.userdetails.vistalink;
2
3import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails;
4import org.springframework.security.GrantedAuthority;
5
6public class VistaUser implements VistaUserDetails {
7
8 private String loginStationNumber;
9 private String signonLogInternalEntryNumber;
10 private String duz;
11 private String accessCode;
12 private String verifyCode;
13 private String personName;
14 private String displayName;
15 private String givenName;
16 private String middleName;
17 private String familyName;
18 private String prefix;
19 private String suffix;
20 private String degree;
21 private GrantedAuthority[] authorities;
22
23// private SortedMap<String, VistaDivision> permittedDivisions;
24
25 public VistaUser(String signonLogInternalEntryNumber, String loginStationNumber, String duz, String accessCode, String verifyCode, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, GrantedAuthority[] authorities) {
26 this(signonLogInternalEntryNumber, loginStationNumber, duz, accessCode, verifyCode, null, null,null,null,null,null,null,null,enabled, accountNonExpired, accountNonLocked, credentialsNonExpired, authorities);
27 }
28
29 public VistaUser(String signonLogInternalEntryNumber, String loginStationNumber, String duz, String accessCode, String verifyCode, String personName, String displayName, String givenName, String middleName, String familyName, String prefix, String suffix, String degree, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, GrantedAuthority[] authorities) {
30 if (duz == null) throw new IllegalArgumentException();
31 if (loginStationNumber == null) throw new IllegalArgumentException();
32 if (signonLogInternalEntryNumber == null) throw new IllegalArgumentException();
33 if (authorities == null) throw new IllegalArgumentException();
34 this.duz = duz;
35 this.accessCode = accessCode;
36 this.verifyCode = verifyCode;
37 this.personName = personName;
38 this.displayName = displayName;
39 this.givenName = givenName;
40 this.middleName = middleName;
41 this.familyName = familyName;
42 this.prefix = prefix;
43 this.suffix = suffix;
44 this.degree = degree;
45 this.loginStationNumber = loginStationNumber;
46 this.signonLogInternalEntryNumber = signonLogInternalEntryNumber;
47 this.authorities = authorities;
48 }
49
50 public GrantedAuthority[] getAuthorities() {
51 return authorities;
52 }
53
54 public String getPassword() {
55 return this.accessCode + ";" + this.verifyCode;
56 }
57
58 public String getUsername() {
59 return getDuz() + "@" + getLoginStationNumber();
60 }
61
62 public boolean isAccountNonExpired() {
63 return true; //To change body of implemented methods use File | Settings | File Templates.
64 }
65
66 public boolean isAccountNonLocked() {
67 return true; //To change body of implemented methods use File | Settings | File Templates.
68 }
69
70 public boolean isCredentialsNonExpired() {
71 return true; //To change body of implemented methods use File | Settings | File Templates.
72 }
73
74 public boolean isEnabled() {
75 return true; //To change body of implemented methods use File | Settings | File Templates.
76 }
77
78 public String getDuz() {
79 return duz;
80 }
81
82 public String getGivenName() {
83 return givenName;
84 }
85
86 public String getMiddleName() {
87 return middleName;
88 }
89
90 public String getFamilyName() {
91 return familyName;
92 }
93
94 public String getPrefix() {
95 return prefix;
96 }
97
98 public String getSuffix() {
99 return suffix;
100 }
101
102 public String getDegree() {
103 return degree;
104 }
105
106 public String getLoginStationNumber() {
107 return loginStationNumber;
108 }
109
110 public String getSignonLogInternalEntryNumber() {
111 return signonLogInternalEntryNumber;
112 }
113
114 public String getDisplayName() {
115 return displayName;
116 }
117
118 public String getPersonName() {
119 return personName;
120 }
121
122 public void setPersonName(String personName) {
123 this.personName = personName;
124 }
125
126 public void setDisplayName(String displayName) {
127 this.displayName = displayName;
128 }
129
130 public void setGivenName(String givenName) {
131 this.givenName = givenName;
132 }
133
134 public void setMiddleName(String middleName) {
135 this.middleName = middleName;
136 }
137
138 public void setFamilyName(String familyName) {
139 this.familyName = familyName;
140 }
141
142 public void setPrefix(String prefix) {
143 this.prefix = prefix;
144 }
145
146 public void setSuffix(String suffix) {
147 this.suffix = suffix;
148 }
149
150 public void setDegree(String degree) {
151 this.degree = degree;
152 }
153}
Note: See TracBrowser for help on using the repository browser.