1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kim.service.impl; |
17 | |
|
18 | |
import org.kuali.rice.kim.api.entity.Type; |
19 | |
import org.kuali.rice.kim.api.entity.principal.Principal; |
20 | |
import org.kuali.rice.kim.api.entity.privacy.EntityPrivacyPreferences; |
21 | |
import org.kuali.rice.kim.api.entity.services.IdentityArchiveService; |
22 | |
import org.kuali.rice.kim.api.entity.services.IdentityService; |
23 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityDefaultInfo; |
24 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityInfo; |
25 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityNameInfo; |
26 | |
import org.kuali.rice.kim.bo.entity.dto.KimEntityNamePrincipalNameInfo; |
27 | |
import org.kuali.rice.kim.bo.reference.dto.AffiliationTypeInfo; |
28 | |
import org.kuali.rice.kim.bo.reference.dto.EmploymentStatusInfo; |
29 | |
import org.kuali.rice.kim.bo.reference.dto.EmploymentTypeInfo; |
30 | |
import org.kuali.rice.kim.bo.reference.dto.EntityNameTypeInfo; |
31 | |
import org.kuali.rice.kim.bo.reference.dto.ExternalIdentifierTypeInfo; |
32 | |
import org.kuali.rice.kim.service.IdentityUpdateService; |
33 | |
import org.kuali.rice.kim.util.KIMWebServiceConstants; |
34 | |
|
35 | |
import javax.jws.WebService; |
36 | |
import java.util.List; |
37 | |
import java.util.Map; |
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | |
|
47 | |
@WebService(endpointInterface = KIMWebServiceConstants.IdentityService.INTERFACE_CLASS, serviceName = KIMWebServiceConstants.IdentityService.WEB_SERVICE_NAME, portName = KIMWebServiceConstants.IdentityService.WEB_SERVICE_PORT, targetNamespace = KIMWebServiceConstants.MODULE_TARGET_NAMESPACE) |
48 | |
public class IdentityCurrentAndArchivedServiceImpl implements IdentityService, IdentityUpdateService { |
49 | |
|
50 | |
private final IdentityArchiveService identityArchiveService; |
51 | |
private final IdentityService innerIdentityService; |
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
public IdentityCurrentAndArchivedServiceImpl(IdentityService innerIdentityService, |
58 | 0 | IdentityArchiveService identityArchiveService) { |
59 | 0 | this.innerIdentityService = innerIdentityService; |
60 | 0 | this.identityArchiveService = identityArchiveService; |
61 | 0 | } |
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
public Type getAddressType(String code) { |
67 | 0 | return getInnerIdentityService().getAddressType(code); |
68 | |
} |
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
public AffiliationTypeInfo getAffiliationType(String code) { |
74 | 0 | return getInnerIdentityService().getAffiliationType(code); |
75 | |
} |
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
public Type getCitizenshipStatus(String code) { |
81 | 0 | return Type.Builder.create(getInnerIdentityService().getCitizenshipStatus(code)).build(); |
82 | |
} |
83 | |
|
84 | |
|
85 | |
|
86 | |
|
87 | |
public Map<String, KimEntityNameInfo> getDefaultNamesForEntityIds( |
88 | |
List<String> entityIds) { |
89 | 0 | return getInnerIdentityService().getDefaultNamesForEntityIds(entityIds); |
90 | |
} |
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
public Map<String, KimEntityNamePrincipalNameInfo> getDefaultNamesForPrincipalIds( |
96 | |
List<String> principalIds) { |
97 | 0 | return getInnerIdentityService().getDefaultNamesForPrincipalIds(principalIds); |
98 | |
} |
99 | |
|
100 | |
|
101 | |
|
102 | |
|
103 | |
public Type getEmailType(String code) { |
104 | 0 | return Type.Builder.create(getInnerIdentityService().getEmailType(code)).build(); |
105 | |
} |
106 | |
|
107 | |
|
108 | |
|
109 | |
|
110 | |
public EmploymentStatusInfo getEmploymentStatus(String code) { |
111 | 0 | return getInnerIdentityService().getEmploymentStatus(code); |
112 | |
} |
113 | |
|
114 | |
|
115 | |
|
116 | |
|
117 | |
public EmploymentTypeInfo getEmploymentType(String code) { |
118 | 0 | return getInnerIdentityService().getEmploymentType(code); |
119 | |
} |
120 | |
|
121 | |
|
122 | |
|
123 | |
|
124 | |
|
125 | |
|
126 | |
|
127 | |
public KimEntityDefaultInfo getEntityDefaultInfo(String entityId) { |
128 | 0 | KimEntityDefaultInfo entity = getInnerIdentityService().getEntityDefaultInfo(entityId); |
129 | 0 | if ( entity == null ) { |
130 | 0 | entity = getIdentityArchiveService().getEntityDefaultInfoFromArchive( entityId ); |
131 | |
} else { |
132 | 0 | getIdentityArchiveService().saveDefaultInfoToArchive(entity); |
133 | |
} |
134 | 0 | return entity; |
135 | |
} |
136 | |
|
137 | |
|
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | |
|
143 | |
public KimEntityDefaultInfo getEntityDefaultInfoByPrincipalId( |
144 | |
String principalId) { |
145 | 0 | KimEntityDefaultInfo entity = getInnerIdentityService().getEntityDefaultInfoByPrincipalId(principalId); |
146 | 0 | if ( entity == null ) { |
147 | 0 | entity = getIdentityArchiveService().getEntityDefaultInfoFromArchiveByPrincipalId( principalId ); |
148 | |
} else { |
149 | 0 | getIdentityArchiveService().saveDefaultInfoToArchive(entity); |
150 | |
} |
151 | 0 | return entity; |
152 | |
} |
153 | |
|
154 | |
|
155 | |
|
156 | |
|
157 | |
|
158 | |
|
159 | |
|
160 | |
public KimEntityDefaultInfo getEntityDefaultInfoByPrincipalName( |
161 | |
String principalName) { |
162 | 0 | KimEntityDefaultInfo entity = getInnerIdentityService().getEntityDefaultInfoByPrincipalName(principalName); |
163 | 0 | if ( entity == null ) { |
164 | 0 | entity = getIdentityArchiveService().getEntityDefaultInfoFromArchiveByPrincipalName( principalName ); |
165 | |
} else { |
166 | 0 | getIdentityArchiveService().saveDefaultInfoToArchive(entity); |
167 | |
} |
168 | 0 | return entity; |
169 | |
} |
170 | |
|
171 | |
|
172 | |
|
173 | |
|
174 | |
public KimEntityInfo getEntityInfo(String entityId) { |
175 | 0 | return getInnerIdentityService().getEntityInfo(entityId); |
176 | |
} |
177 | |
|
178 | |
|
179 | |
|
180 | |
|
181 | |
public KimEntityInfo getEntityInfoByPrincipalId(String principalId) { |
182 | 0 | return getInnerIdentityService().getEntityInfoByPrincipalId(principalId); |
183 | |
} |
184 | |
|
185 | |
|
186 | |
|
187 | |
|
188 | |
public KimEntityInfo getEntityInfoByPrincipalName(String principalName) { |
189 | 0 | return getInnerIdentityService().getEntityInfoByPrincipalName(principalName); |
190 | |
} |
191 | |
|
192 | |
|
193 | |
|
194 | |
|
195 | |
public EntityNameTypeInfo getEntityNameType(String code) { |
196 | 0 | return getInnerIdentityService().getEntityNameType(code); |
197 | |
} |
198 | |
|
199 | |
|
200 | |
|
201 | |
|
202 | |
public EntityPrivacyPreferences getEntityPrivacyPreferences( |
203 | |
String entityId) { |
204 | 0 | return getInnerIdentityService().getEntityPrivacyPreferences(entityId); |
205 | |
} |
206 | |
|
207 | |
|
208 | |
|
209 | |
|
210 | |
public Type getEntityType(String code) { |
211 | 0 | return Type.Builder.create(getInnerIdentityService().getEntityType(code)).build(); |
212 | |
} |
213 | |
|
214 | |
|
215 | |
|
216 | |
|
217 | |
public ExternalIdentifierTypeInfo getExternalIdentifierType(String code) { |
218 | 0 | return getInnerIdentityService().getExternalIdentifierType(code); |
219 | |
} |
220 | |
|
221 | |
|
222 | |
|
223 | |
|
224 | |
public int getMatchingEntityCount(Map<String, String> searchCriteria) { |
225 | 0 | return getInnerIdentityService().getMatchingEntityCount(searchCriteria); |
226 | |
} |
227 | |
|
228 | |
|
229 | |
|
230 | |
|
231 | |
public Type getPhoneType(String code) { |
232 | 0 | return Type.Builder.create(getInnerIdentityService().getPhoneType(code)).build(); |
233 | |
} |
234 | |
|
235 | |
|
236 | |
|
237 | |
|
238 | |
public Principal getPrincipal(String principalId) { |
239 | 0 | return getInnerIdentityService().getPrincipal(principalId); |
240 | |
} |
241 | |
|
242 | |
|
243 | |
|
244 | |
|
245 | |
public Principal getPrincipalByPrincipalName(String principalName) { |
246 | 0 | return getInnerIdentityService().getPrincipalByPrincipalName(principalName); |
247 | |
} |
248 | |
|
249 | |
|
250 | |
|
251 | |
|
252 | |
public Principal getPrincipalByPrincipalNameAndPassword( |
253 | |
String principalName, String password) { |
254 | 0 | return getInnerIdentityService().getPrincipalByPrincipalNameAndPassword( |
255 | |
principalName, password); |
256 | |
} |
257 | |
|
258 | |
|
259 | |
|
260 | |
|
261 | |
public List<KimEntityDefaultInfo> lookupEntityDefaultInfo( |
262 | |
Map<String, String> searchCriteria, boolean unbounded) { |
263 | 0 | return getInnerIdentityService().lookupEntityDefaultInfo(searchCriteria, |
264 | |
unbounded); |
265 | |
} |
266 | |
|
267 | |
|
268 | |
|
269 | |
|
270 | |
public List<KimEntityInfo> lookupEntityInfo( |
271 | |
Map<String, String> searchCriteria, boolean unbounded) { |
272 | 0 | return getInnerIdentityService().lookupEntityInfo(searchCriteria, unbounded); |
273 | |
} |
274 | |
|
275 | |
private IdentityService getInnerIdentityService() { |
276 | 0 | return innerIdentityService; |
277 | |
} |
278 | |
|
279 | |
private IdentityArchiveService getIdentityArchiveService() { |
280 | 0 | return identityArchiveService; |
281 | |
} |
282 | |
|
283 | |
} |