001: /*
002: * Copyright 2006-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.core.service;
017:
018: import java.util.Collection;
019: import java.util.List;
020: import java.util.Map;
021:
022: import org.kuali.core.bo.PersistableBusinessObject;
023: import org.kuali.core.bo.user.KualiGroup;
024: import org.kuali.core.bo.user.KualiModuleUser;
025: import org.kuali.core.bo.user.UniversalUser;
026: import org.kuali.core.bo.user.UserId;
027: import org.kuali.core.exceptions.UserNotFoundException;
028:
029: import edu.iu.uis.eden.user.UserService;
030:
031: /**
032: * This interface defines methods that a KualiUser Service must provide.
033: *
034: *
035: */
036: public interface UniversalUserService extends UserService {
037:
038: /**
039: * Return the UniversalUser according to the UserId supplied.
040: *
041: * @param userId Accepts any UserID object that meets the UserId interface
042: * @return Returns a populated UniversalUser object if the User is found, otherwise throws a UserNotFoundException
043: * @throws UserNotFoundException
044: */
045: public UniversalUser getUniversalUser(UserId userId)
046: throws UserNotFoundException;
047:
048: public UniversalUser getUniversalUserByAuthenticationUserId(
049: String authenticationUserId) throws UserNotFoundException;
050:
051: /**
052: * Return the UniversalUser according to the universal user ID supplied.
053: *
054: * @param personUniversalIdentifier
055: * @return Returns a populated UniversalUser object if the User is found, otherwise throws a UserNotFoundException
056: * @throws UserNotFoundException
057: */
058: public UniversalUser getUniversalUser(
059: String personUniversalIdentifier)
060: throws UserNotFoundException;
061:
062: /**
063: * Compares the universal user ID passed in with that in the UniversalUser object. If they are the same, it returns the
064: * original object. Otherwise, it pulls the UniversalUser from persistent storage based on the sourcePersonUniversalIdentifier.
065: */
066: public UniversalUser updateUniversalUserIfNecessary(
067: String sourcePersonUniversalIdentifier,
068: UniversalUser currentSourceUniversalUser);
069:
070: /**
071: * Finds UniversalUser objects based upon a Map with propertyName->value.
072: */
073: public Collection findUniversalUsers(Map fieldValues);
074:
075: /**
076: * Finds UniversalUser objects based upon a Map with propertyName->value where the propertyNames are relative
077: * to the original business object, this does a back-end join with the universal user data.
078: */
079: public Collection findWithUniversalUserJoin(
080: Class businessObjectClass, Map fieldValues,
081: boolean unbounded);
082:
083: /**
084: * Returns if any of the propertyNames in the Map keys represent properties on a child UniversalUser object
085: * on the passed in business object class.
086: */
087: public boolean hasUniversalUserProperty(Class businessObjectClass,
088: Map fieldValues);
089:
090: /**
091: *
092: * This method takes a map on its way to populate a business object and replaces all user identifiers with their corresponding universal users
093: * @param businessObject
094: * @param fieldValues
095: * @return
096: */
097: public Map resolveUserIdentifiersToUniversalIdentifiers(
098: PersistableBusinessObject businessObject, Map fieldValues);
099:
100: public Map<String, KualiModuleUser> getModuleUsers(
101: UniversalUser user);
102:
103: /**
104: * Checks if the user is a member of a given KualiGroup (workgroup)
105: */
106: public boolean isMember(UniversalUser user, String groupName);
107:
108: /**
109: * Checks if the user is a member of a given KualiGroup (workgroup)
110: */
111: public boolean isMember(UniversalUser user, KualiGroup kualiGroup);
112:
113: /**
114: * Gets all groups to which a user belongs.
115: */
116: public List<KualiGroup> getUsersGroups(UniversalUser user);
117:
118: /**
119: * Checks if the user belongs to the established supervisor workgroup.
120: */
121: public boolean isSupervisorUser(UniversalUser user);
122:
123: /**
124: * Checks if the user belongs to the established workflow exception workgroup.
125: */
126: public boolean isWorkflowExceptionUser(UniversalUser user);
127:
128: /**
129: * Loads a map of all the user's KualiModuleUser properties.
130: */
131: public Map<String, Map<String, String>> loadModuleUserProperties(
132: UniversalUser user);
133:
134: }
|