001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/profile/tags/sakai_2-4-1/edu-person-api/src/java/org/sakaiproject/api/common/edu/person/SakaiPersonManager.java $
003: * $Id: SakaiPersonManager.java 20879 2007-02-01 21:07:25Z jholtzman@berkeley.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the "License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.api.common.edu.person;
021:
022: import java.util.Collection;
023: import java.util.List;
024: import java.util.Map;
025: import java.util.Set;
026:
027: import org.sakaiproject.api.common.type.Type;
028:
029: /**
030: * @author <a href="mailto:lance@indiana.edu">Lance Speelmon </a>
031: */
032: public interface SakaiPersonManager {
033: /**
034: * Creates a persistent SakaiPerson record.
035: *
036: * @param agentUuid
037: * @param recordType
038: * {@link #getSystemMutableType()} or {@link #getUserMutableType()}
039: * @return
040: */
041: public SakaiPerson create(String agentUuid, Type recordType);
042:
043: /**
044: * Get a new instantiation of an empty SakaiPerson object (has no persistent state). For example, useful if you query-by-example finder method.
045: *
046: * @return
047: */
048: public SakaiPerson getPrototype();
049:
050: /**
051: * Retrieve SakaiPerson by uid (username).
052: *
053: * @param uid
054: * username
055: * @return List of SakaiPerson objects incuding both system and user mutable Types.
056: */
057: public List findSakaiPersonByUid(String uid);
058:
059: /**
060: * Query-by-Example finder signature.
061: *
062: * @param queryByExample
063: * A SakaiPerson protoype. All non-null preoperties will be searched using a logical AND.
064: * @return
065: */
066: public List findSakaiPerson(SakaiPerson queryByExample);
067:
068: /**
069: * Assumes current user. If you would like to specify the user, see {@link #findSakaiPerson(String, Type)}.
070: *
071: * @param recordType
072: * See {@link #getSystemMutableType()} or {@link #getUserMutableType()}.
073: * @return
074: */
075: public SakaiPerson getSakaiPerson(Type recordType);
076:
077: /**
078: * Find all SakaiPerson objects with specified type. Types should be obtained through the Type constant getter methods.
079: *
080: * @param agent
081: * @param recordType
082: * See {@link #getSystemMutableType()} or {@link #getUserMutableType()}.
083: * @return
084: */
085: public SakaiPerson getSakaiPerson(String agentUuid, Type recordType);
086:
087: /**
088: * Finds all SakaiPerson objects with the specified type, whos IDs are contained
089: * in the userIds collection.
090: *
091: * @param userIds
092: * @param userMutableType
093: * @return
094: */
095: public Map<String, SakaiPerson> getSakaiPersons(
096: Set<String> userIds, Type userMutableType);
097:
098: /**
099: * Returns the userMutableType constant. SakaiPerson's of this Type allow the user to modify all attributes.
100: *
101: * @return
102: */
103: public Type getUserMutableType();
104:
105: /**
106: * Returns the systemMutableType constant. SakaiPerson's of this Type can only be modified by the "system", i.e. not the end user, and would normally consist of enterprise data (e.g. LDAP, etc).
107: *
108: * @return
109: */
110: public Type getSystemMutableType();
111:
112: /**
113: * Save or update the SakaiPerson bean.
114: *
115: * @param sakaiPerson
116: */
117: public void save(SakaiPerson sakaiPerson);
118:
119: /**
120: * Removes SakaiPerson from persistent state.
121: *
122: * @param sakaiPerson
123: */
124: public void delete(SakaiPerson sakaiPerson);
125:
126: /**
127: * Search the "common" SakaPerson fields for a given String.
128: *
129: * @param simpleSearchCriteria
130: * String used to search for SakaiPerson objects where the following properties are like this String: uid, givenName, surname.
131: * @return
132: */
133: public List findSakaiPerson(String simpleSearchCriteria);
134:
135: /**
136: * Composite call to determine if a Set of Agents have the FERPA flag enabled.
137: *
138: * @param agentUuids
139: * @return A List of agentUuid Strings where FERPA is enabled.
140: */
141: public List isFerpaEnabled(Collection agentUuids);
142:
143: /**
144: * Find all SakaiPerson objects where ferpaEnabled == TRUE.
145: *
146: * @return A List of SakaiPerson objects where ferpaEnabled == TRUE.
147: */
148: public List findAllFerpaEnabled();
149:
150: }
|