KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > outerj > daisy > repository > commonimpl > user > UserManagerImpl


1 /*
2  * Copyright 2004 Outerthought bvba and Schaubroeck nv
3  *
4  * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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.outerj.daisy.repository.commonimpl.user;
17
18 import org.outerj.daisy.repository.user.*;
19 import org.outerj.daisy.repository.RepositoryException;
20 import org.outerj.daisy.repository.commonimpl.AuthenticatedUser;
21 import org.outerx.daisy.x10.PublicUserInfosDocument;
22 import org.outerx.daisy.x10.PublicUserInfoDocument;
23
24 public class UserManagerImpl implements UserManager {
25     private CommonUserManager delegate;
26     /* Mind the fully qualified name of this user!
27      * This needs to happen because we clearly need
28      * a distinction between an Authenticated User
29      * and a User meant for User Management!
30      */

31     private org.outerj.daisy.repository.commonimpl.AuthenticatedUser user;
32     
33     public UserManagerImpl(CommonUserManager commonUserManager, AuthenticatedUser user) {
34         delegate = commonUserManager;
35         this.user = user;
36     }
37
38     public Users getUsers() throws RepositoryException {
39         return delegate.getUsers(user);
40     }
41
42     public long[] getUserIds() throws RepositoryException {
43         return delegate.getUserIds(user);
44     }
45
46     public PublicUserInfoDocument getPublicUserInfo(long userId) throws RepositoryException {
47         return delegate.getPublicUserInfo(userId);
48     }
49
50     public PublicUserInfosDocument getPublicUserInfos() throws RepositoryException {
51         return delegate.getPublicUserInfos(user);
52     }
53
54     public Roles getRoles() throws RepositoryException {
55         return delegate.getRoles(user);
56     }
57
58     public User createUser(String JavaDoc login) {
59         return delegate.createUser(login, user);
60     }
61
62     public void deleteUser(long userId) throws RepositoryException {
63         delegate.deleteUser(userId, user);
64     }
65
66     public Role createRole(String JavaDoc roleName) {
67         return delegate.createRole(roleName, user);
68     }
69
70     public User getUser(String JavaDoc login, boolean updateable) throws RepositoryException {
71         return delegate.getUser(login, updateable, user);
72     }
73
74     public Role getRole(String JavaDoc name, boolean updateable) throws RepositoryException {
75         return delegate.getRole(name, updateable, user);
76     }
77
78     public void deleteRole(long roleId) throws RepositoryException {
79         delegate.deleteRole(roleId, user);
80     }
81
82     public User getUser(long userId, boolean updateable) throws RepositoryException {
83         return delegate.getUser(userId, updateable, user);
84     }
85
86     public Role getRole(long roleId, boolean updateable) throws RepositoryException {
87         return delegate.getRole(roleId, updateable, user);
88     }
89
90     public String JavaDoc getUserDisplayName(long userId) throws RepositoryException {
91         return delegate.getUserDisplayName(userId);
92     }
93
94     public String JavaDoc getUserLogin(long userId) throws RepositoryException {
95         return delegate.getUserLogin(userId);
96     }
97
98     public long getUserId(String JavaDoc login) throws RepositoryException {
99         return delegate.getUserId(login);
100     }
101
102     public String JavaDoc getRoleDisplayName(long roleId) throws RepositoryException {
103         return delegate.getRoleDisplayName(roleId);
104     }
105
106     public Users getUsersByEmail(String JavaDoc email) throws RepositoryException {
107         return delegate.getUsersByEmail(email, user);
108     }
109
110     public AuthenticationSchemeInfos getAuthenticationSchemes() throws RepositoryException {
111         return delegate.getAuthenticationSchemes(user);
112     }
113 }
114
Popular Tags