01: /**********************************************************************************
02: *
03: * $Id: UserDirectoryServiceSakai2Impl.java 9271 2006-05-10 21:52:49Z ray@media.berkeley.edu $
04: *
05: ***********************************************************************************
06: *
07: * Copyright (c) 2005 The Regents of the University of California, The MIT Corporation
08: *
09: * Licensed under the Educational Community License, Version 1.0 (the "License");
10: * you may not use this file except in compliance with the License.
11: * You may obtain a copy of the License at
12: *
13: * http://www.opensource.org/licenses/ecl1.php
14: *
15: * Unless required by applicable law or agreed to in writing, software
16: * distributed under the License is distributed on an "AS IS" BASIS,
17: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18: * See the License for the specific language governing permissions and
19: * limitations under the License.
20: *
21: **********************************************************************************/package org.sakaiproject.tool.gradebook.facades.sakai2impl;
22:
23: import org.apache.commons.logging.Log;
24: import org.apache.commons.logging.LogFactory;
25:
26: import org.sakaiproject.user.api.UserNotDefinedException;
27:
28: import org.sakaiproject.service.gradebook.shared.UnknownUserException;
29: import org.sakaiproject.tool.gradebook.facades.UserDirectoryService;
30:
31: /**
32: * Sakai2 implementation of the gradebook UserDirectoryService API.
33: */
34: public class UserDirectoryServiceSakai2Impl implements
35: UserDirectoryService {
36: private static final Log log = LogFactory
37: .getLog(UserDirectoryServiceSakai2Impl.class);
38:
39: public String getUserDisplayName(String userUid)
40: throws UnknownUserException {
41: try {
42: org.sakaiproject.user.api.User sakaiUser = org.sakaiproject.user.cover.UserDirectoryService
43: .getUser(userUid);
44: return sakaiUser.getDisplayName();
45: } catch (UserNotDefinedException e) {
46: throw new UnknownUserException("Unknown uid: " + userUid);
47: }
48: }
49: }
|