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