View Javadoc

1   /**
2    * Copyright 2005-2011 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.dao;
17  
18  import java.util.List;
19  import java.util.Map;
20  
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.name.EntityName;
24  import org.kuali.rice.kim.api.identity.principal.EntityNamePrincipalName;
25  import org.kuali.rice.kim.api.identity.principal.Principal;
26  import org.kuali.rice.kim.api.identity.privacy.EntityPrivacyPreferences;
27  
28  import org.springframework.ldap.core.ContextMapper;
29  import org.springframework.ldap.core.DirContextOperations;
30  import org.springframework.ldap.core.LdapTemplate;
31  
32  
33  /**
34   * Interface class with public methods for accessing LDAP data store for entity information
35   *
36   * @author Kuali Rice Team (rice.collab@kuali.org)
37   */
38  public interface LdapPrincipalDao {
39      LdapTemplate getLdapTemplate();
40  
41      void setLdapTemplate(LdapTemplate template);
42  
43      /**
44       * In EDS, the principalId, principalName, and entityId will all be the same.
45       */
46      Principal getPrincipal(String principalId);
47  
48      /**
49       * In EDS, the principalId, principalName, and entityId will all be the same.
50       */
51      Principal getPrincipalByName(String principalName);
52  
53      <T> List<T> search(Class<T> type, Map<String, Object> criteria);
54  
55  	/** Find entity objects based on the given criteria. */
56  	EntityDefault getEntityDefault(String entityId);
57  
58  	Entity getEntity(String entityId);
59  	
60  	/**
61       * Fetches full entity info, populated from EDS, based on the Entity's principal id
62       * @param principalId the principal id to look the entity up for
63       * @return the corresponding entity info
64       */
65      Entity getEntityByPrincipalId(String principalId);
66  
67  	Entity getEntityByPrincipalName(String principalName);
68  
69      /**
70       * entityid and principalId are treated as the same.
71       * 
72       * @see #getEntityDefault(String)
73       */
74  	EntityDefault getEntityDefaultByPrincipalId(String principalId);
75  
76  	EntityDefault getEntityDefaultByPrincipalName(String principalName);
77  
78  	List<String> lookupEntityIds(Map<String,String> searchCriteria);
79  
80  	EntityPrivacyPreferences getEntityPrivacyPreferences(String entityId);
81  	
82      Map<String, EntityNamePrincipalName> getDefaultNamesForPrincipalIds(List<String> principalIds);
83  
84      Map<String, EntityNamePrincipalName> getDefaultNamesForEntityIds(List<String> entityIds);
85  
86      Map<String, ContextMapper> getContextMappers();
87  }