001: /*
002: * Copyright 2005-2006 The Kuali Foundation.
003: *
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package edu.iu.uis.eden.user;
018:
019: import java.util.List;
020:
021: import edu.iu.uis.eden.XmlLoader;
022: import edu.iu.uis.eden.clientapp.vo.UserIdVO;
023: import edu.iu.uis.eden.exception.EdenUserNotFoundException;
024:
025: /**
026: * The UserService provides retrieval and search capibilities for WorkflowUsers.
027: * It also provides the a factory method for creating blank users.
028: *
029: * The UserService extends XmlLoader so it is possible to import users from XML
030: * if the implementing class provides an xml loading implementation.
031: *
032: * @author bmcgough
033: * @author rkirkend
034: * @author ewestfal
035: */
036: public interface UserService extends XmlLoader {
037:
038: /**
039: * Retrieves the capabilities of this user service. This essentially provides the core with information
040: * on the kinds of activities which the User service can perform such as reporting, editing, etc. This
041: * is primarily used by the web-tier of the application to aid in delivery of web-based user services.
042: *
043: * @since 2.2
044: */
045: public UserCapabilities getCapabilities();
046:
047: /**
048: * Retrieve the WorkflowUser who has the supplied UserId. If the user does
049: * not have a WorkflowId assigned, assign the user a WorkflowId before
050: * returning the WorkflowUser object
051: *
052: * @param the UserId of the user to lookup
053: * @return the user which matches the given id if no user could be found
054: * @throws EdenUserNotFoundException if no user could be located for the given id or if
055: * the given UserId is of an invalid type
056: */
057: public WorkflowUser getWorkflowUser(UserId userId)
058: throws EdenUserNotFoundException;
059:
060: /**
061: * Similar to getWorkflowUser(UserId) except that the id is represented as a UserIdVO
062: * instead of a UserId.
063: *
064: * @param the UserIdVO of the user to lookup
065: * @return the user which matches the given id or null if no user could be found
066: * @throws EdenUserNotFoundException if no user could be located for the given id or if
067: * the given UserId is of an invalid type
068: */
069: public WorkflowUser getWorkflowUser(UserIdVO userId)
070: throws EdenUserNotFoundException;
071:
072: /**
073: * Invokes a search for WorkflowUsers using an example user object as the search criteria.
074: *
075: * @param user a WorkflowUser object containing an example user to search for, this will usually
076: * consist of a user object with some of the fields filled in
077: * @param useWildCards if true then wildcards should be used on the various WorkflowUser fields
078: * @return a List of WorkflowUsers which match the given criteria
079: */
080: public List<WorkflowUser> search(WorkflowUser user,
081: boolean useWildCards);
082:
083: /**
084: * Returns an empty WorkflowUser object. Since the WorkflowUser implementation is institution-specific
085: * this method allows for the creation of a new WorkflowUser instance. This will typically be used
086: * in conjuction with the search method.
087: *
088: * @return an empty WorkflowUser object
089: */
090: public WorkflowUser getBlankUser();
091:
092: /**
093: * Saves the given WorkflowUser to the underlying data store. If this service does not support persistence
094: * then an UnsupportedOperationException will be thrown.
095: *
096: * @since 2.2
097: */
098: public void save(WorkflowUser user);
099:
100: /**
101: * Make a copy of the given WorkflowUser. If preserveKeys is true then the keys need to be preserved,
102: * otherwise they should be set to null on the copy.
103: *
104: * This code can assume that the user being passed in was produced by this service. Therefore, the user
105: * instance passed in can be safely cast to the appropriate implementation class if necessary.
106: *
107: * @since 2.2
108: */
109: public WorkflowUser copy(WorkflowUser user, boolean preserveKeys);
110: }
|