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.Entity;
22  import org.kuali.rice.kim.api.identity.entity.EntityDefault;
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.DirContextOperations;
29  import org.springframework.ldap.core.LdapTemplate;
30  
31  
32  /**
33   *
34   * @author Kuali Rice Team (rice.collab@kuali.org)
35   */
36  public interface PrincipalDao {
37      LdapTemplate getLdapTemplate();
38  
39      void setLdapTemplate(LdapTemplate template);
40  
41      /**
42       * In EDS, the principalId, principalName, and entityId will all be the same.
43       */
44      Principal getPrincipal(String principalId);
45  
46      /**
47       * In EDS, the principalId, principalName, and entityId will all be the same.
48       */
49      Principal getPrincipalByName(String principalName);
50  
51      <T> List<T> search(Class<T> type, Map<String, Object> criteria);
52  
53  	/** Find entity objects based on the given criteria. */
54  	EntityDefault getEntityDefaultInfo(String entityId);
55  
56  	Entity getEntityInfo(String entityId);
57  	
58  	/**
59       * Fetches full entity info, populated from EDS, based on the Entity's principal id
60       * @param principalId the principal id to look the entity up for
61       * @return the corresponding entity info
62       */
63      public abstract Entity getEntityInfoByPrincipalId(String principalId);
64  
65      /**
66       * entityid and principalId are treated as the same.
67       * 
68       * @see #getEntityDefaultInfo(String)
69       */
70  	EntityDefault getEntityDefaultInfoByPrincipalId(String principalId);
71  
72  	EntityDefault getEntityDefaultInfoByPrincipalName(String principalName);
73  
74  	List<EntityDefault> lookupEntityDefaultInfo(Map<String,String> searchCriteria, boolean unbounded);
75  
76  	List<Entity> lookupEntityInfo(Map<String,String> searchCriteria, boolean unbounded);
77  
78  	EntityPrivacyPreferences getEntityPrivacyPreferences(String entityId);
79  	
80      Map<String, EntityNamePrincipalName> getDefaultNamesForPrincipalIds(List<String> principalIds);
81  
82      Map<String, EntityName> getDefaultNamesForEntityIds(List<String> entityIds);
83  }