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