Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
IdentityService |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2008-2009 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.kim.api.identity.services; | |
17 | ||
18 | import org.kuali.rice.core.util.jaxb.MapStringStringAdapter; | |
19 | import org.kuali.rice.kim.api.identity.Type; | |
20 | import org.kuali.rice.kim.api.identity.affiliation.EntityAffiliationType; | |
21 | import org.kuali.rice.kim.api.identity.name.EntityName; | |
22 | import org.kuali.rice.kim.api.identity.principal.Principal; | |
23 | import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences; | |
24 | import org.kuali.rice.kim.api.jaxb.StringToKimEntityNameInfoMapAdapter; | |
25 | import org.kuali.rice.kim.api.jaxb.StringToKimEntityNamePrincipalInfoMapAdapter; | |
26 | import org.kuali.rice.kim.bo.entity.dto.KimEntityDefaultInfo; | |
27 | import org.kuali.rice.kim.bo.entity.dto.KimEntityInfo; | |
28 | import org.kuali.rice.kim.bo.entity.dto.KimEntityNamePrincipalNameInfo; | |
29 | import org.kuali.rice.kim.bo.reference.dto.EmploymentStatusInfo; | |
30 | import org.kuali.rice.kim.bo.reference.dto.EmploymentTypeInfo; | |
31 | import org.kuali.rice.kim.bo.reference.dto.ExternalIdentifierTypeInfo; | |
32 | import org.kuali.rice.kim.util.KIMWebServiceConstants; | |
33 | ||
34 | import javax.jws.WebParam; | |
35 | import javax.jws.WebService; | |
36 | import javax.jws.soap.SOAPBinding; | |
37 | import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; | |
38 | import java.util.List; | |
39 | import java.util.Map; | |
40 | ||
41 | /** | |
42 | * This service provides operations to query for principal and identity data. | |
43 | * | |
44 | * <p>A principal represents an identity that can authenticate. In essence, a principal can be | |
45 | * thought of as an "account" or as an identity's authentication credentials. A principal has | |
46 | * an id which is used to uniquely identify it. It also has a name which represents the | |
47 | * principal's username and is typically what is entered when authenticating. All principals | |
48 | * are associated with one and only one identity. | |
49 | * | |
50 | * <p>An identity represents a person or system. Additionally, other "types" of entities can | |
51 | * be defined in KIM. Information like name, phone number, etc. is associated with an identity. | |
52 | * It is the representation of a concrete person or system. While an identity will typically | |
53 | * have a single principal associated with it, it is possible for an identity to have more than | |
54 | * one principal or even no principals at all (in the case where the identity does not actually | |
55 | * authenticate). | |
56 | * | |
57 | * <p>This service also provides operations for querying various pieces of reference data, such as | |
58 | * address types, affiliation types, phone types, etc. | |
59 | * | |
60 | * <p>This service provides read-only operations. For write operations, see | |
61 | * {@link org.kuali.rice.kim.service.IdentityUpdateService}. | |
62 | * | |
63 | * @see org.kuali.rice.kim.service.IdentityUpdateService | |
64 | * | |
65 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
66 | * | |
67 | */ | |
68 | @WebService(name = KIMWebServiceConstants.IdentityService.WEB_SERVICE_NAME, targetNamespace = KIMWebServiceConstants.MODULE_TARGET_NAMESPACE) | |
69 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
70 | public interface IdentityService { | |
71 | ||
72 | /** | |
73 | * Get the principal with the given unique principal ID. Returns null if not found. | |
74 | */ | |
75 | Principal getPrincipal( @WebParam(name="principalId") String principalId ); | |
76 | ||
77 | /** | |
78 | * Get the principal with the given principalName. | |
79 | */ | |
80 | Principal getPrincipalByPrincipalName( @WebParam(name="principalName") String principalName ); | |
81 | ||
82 | /** | |
83 | * Get the principal with the given name and password. | |
84 | */ | |
85 | Principal getPrincipalByPrincipalNameAndPassword( @WebParam(name="principalName") String principalName, @WebParam(name="password") String password ); | |
86 | ||
87 | /** | |
88 | * Get the identity default info for the identity with the given id. | |
89 | */ | |
90 | KimEntityDefaultInfo getEntityDefaultInfo( @WebParam(name="entityId") String entityId ); | |
91 | ||
92 | /** | |
93 | * Get the identity default info for the identity of the principal with the given principal id. | |
94 | */ | |
95 | KimEntityDefaultInfo getEntityDefaultInfoByPrincipalId( @WebParam(name="principalId") String principalId ); | |
96 | ||
97 | /** | |
98 | * Get the identity default info for the identity of the principal with the given principal name. | |
99 | */ | |
100 | KimEntityDefaultInfo getEntityDefaultInfoByPrincipalName( @WebParam(name="principalName") String principalName ); | |
101 | ||
102 | /** | |
103 | * Get the identity info for the identity with the given id. | |
104 | */ | |
105 | KimEntityInfo getEntityInfo( @WebParam(name="entityId") String entityId ); | |
106 | ||
107 | /** | |
108 | * Get the identity info for the identity of the principal with the given principal id. | |
109 | */ | |
110 | KimEntityInfo getEntityInfoByPrincipalId( @WebParam(name="principalId") String principalId ); | |
111 | ||
112 | /** | |
113 | * Get the identity info for the identity of the principal with the given principal name. | |
114 | */ | |
115 | KimEntityInfo getEntityInfoByPrincipalName( @WebParam(name="principalName") String principalName ); | |
116 | ||
117 | /** | |
118 | * Gets a List of identity default info for entities based on the given search criteria. | |
119 | * | |
120 | * <p>If unbounded is set to false, then this method will return all results. If unbounded is set to | |
121 | * true then the number of search results will be bounded based on default configuration for number | |
122 | * of search results returned in a a bounded search. | |
123 | * | |
124 | * <p>The searchCriteria Map is a map of identity field names to search values. | |
125 | */ | |
126 | List<KimEntityDefaultInfo> lookupEntityDefaultInfo( @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(name = "searchCriteria") Map<String,String> searchCriteria, @WebParam(name="unbounded") boolean unbounded ); | |
127 | ||
128 | List<KimEntityInfo> lookupEntityInfo( @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(name = "searchCriteria") Map<String,String> searchCriteria, @WebParam(name="unbounded") boolean unbounded ); | |
129 | ||
130 | /** | |
131 | * Returns a count of the number of entities that match the given search criteria. | |
132 | */ | |
133 | int getMatchingEntityCount( @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(name = "searchCriteria") Map<String,String> searchCriteria ); | |
134 | ||
135 | /** | |
136 | * Gets the privacy preferences for the identity with the given identity id. | |
137 | */ | |
138 | EntityPrivacyPreferences getEntityPrivacyPreferences( @WebParam(name="entityId") String entityId ); | |
139 | ||
140 | /** | |
141 | * Gets the name for the principals with ids in the given List. | |
142 | * | |
143 | * <p>The resulting Map contains the principalId as the key and the name information as the value. | |
144 | * When fetching names by principal id, the resulting name info contains the identity's name info | |
145 | * as well as the principal's name info. | |
146 | */ | |
147 | @XmlJavaTypeAdapter(value = StringToKimEntityNamePrincipalInfoMapAdapter.class) | |
148 | Map<String, KimEntityNamePrincipalNameInfo> getDefaultNamesForPrincipalIds(@WebParam(name="principalIds") List<String> principalIds); | |
149 | ||
150 | /** | |
151 | * Gets the names for the entities with ids in the given list. | |
152 | */ | |
153 | @XmlJavaTypeAdapter(value = StringToKimEntityNameInfoMapAdapter.class) | |
154 | Map<String, EntityName> getDefaultNamesForEntityIds(@WebParam(name="entityIds") List<String> entityIds); | |
155 | ||
156 | /** | |
157 | * Gets the address type for the given address type code. | |
158 | */ | |
159 | public Type getAddressType( @WebParam(name="code") String code ); | |
160 | ||
161 | /** | |
162 | * Gets the affiliation type for the given affiliation type code. | |
163 | */ | |
164 | public EntityAffiliationType getAffiliationType( @WebParam(name="code") String code ); | |
165 | ||
166 | /** | |
167 | * Gets the citizenship status for the given citizenship status code. | |
168 | */ | |
169 | public Type getCitizenshipStatus( @WebParam(name="code") String code ); | |
170 | ||
171 | /** | |
172 | * Gets the email type for the given email type code. | |
173 | */ | |
174 | public Type getEmailType( @WebParam(name="code") String code ); | |
175 | ||
176 | /** | |
177 | * Gets the employment status for the given employment status code. | |
178 | */ | |
179 | public EmploymentStatusInfo getEmploymentStatus( @WebParam(name="code") String code ); | |
180 | ||
181 | /** | |
182 | * Gets the employment type for the given employment type code. | |
183 | */ | |
184 | public EmploymentTypeInfo getEmploymentType( @WebParam(name="code") String code ); | |
185 | ||
186 | /** | |
187 | * Gets the identity name type for the given identity name type code. | |
188 | */ | |
189 | public Type getEntityNameType( @WebParam(name="code") String code ); | |
190 | ||
191 | /** | |
192 | * Gets the identity type for the given identity type code. | |
193 | */ | |
194 | public Type getEntityType( @WebParam(name="code") String code ); | |
195 | ||
196 | /** | |
197 | * Gets the external identifier type for the given external identifier type code. | |
198 | */ | |
199 | public ExternalIdentifierTypeInfo getExternalIdentifierType( @WebParam(name="code") String code ); | |
200 | ||
201 | /** | |
202 | * Gets the phone type for the given phone type code. | |
203 | */ | |
204 | public Type getPhoneType( @WebParam(name="code") String code ); | |
205 | ||
206 | } |