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