001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/user/tags/sakai_2-4-1/user-api/api/src/java/org/sakaiproject/user/cover/UserDirectoryService.java $
003: * $Id: UserDirectoryService.java 9195 2006-05-09 19:52:44Z ggolden@umich.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.user.cover;
021:
022: import org.sakaiproject.component.cover.ComponentManager;
023:
024: /**
025: * <p>
026: * UserDirectoryService is a static Cover for the {@link org.sakaiproject.user.api.UserDirectoryService UserDirectoryService}; see that interface for usage details.
027: * </p>
028: *
029: * @author University of Michigan, Sakai Software Development Team
030: * @version $Revision: 9195 $
031: */
032: public class UserDirectoryService {
033: /**
034: * Access the component instance: special cover only method.
035: *
036: * @return the component instance.
037: */
038: public static org.sakaiproject.user.api.UserDirectoryService getInstance() {
039: if (ComponentManager.CACHE_COMPONENTS) {
040: if (m_instance == null)
041: m_instance = (org.sakaiproject.user.api.UserDirectoryService) ComponentManager
042: .get(org.sakaiproject.user.api.UserDirectoryService.class);
043: return m_instance;
044: } else {
045: return (org.sakaiproject.user.api.UserDirectoryService) ComponentManager
046: .get(org.sakaiproject.user.api.UserDirectoryService.class);
047: }
048: }
049:
050: private static org.sakaiproject.user.api.UserDirectoryService m_instance = null;
051:
052: public static java.lang.String APPLICATION_ID = org.sakaiproject.user.api.UserDirectoryService.APPLICATION_ID;
053:
054: public static java.lang.String REFERENCE_ROOT = org.sakaiproject.user.api.UserDirectoryService.REFERENCE_ROOT;
055:
056: public static java.lang.String SECURE_ADD_USER = org.sakaiproject.user.api.UserDirectoryService.SECURE_ADD_USER;
057:
058: public static java.lang.String SECURE_REMOVE_USER = org.sakaiproject.user.api.UserDirectoryService.SECURE_REMOVE_USER;
059:
060: public static java.lang.String SECURE_UPDATE_USER_OWN = org.sakaiproject.user.api.UserDirectoryService.SECURE_UPDATE_USER_OWN;
061:
062: public static java.lang.String SECURE_UPDATE_USER_ANY = org.sakaiproject.user.api.UserDirectoryService.SECURE_UPDATE_USER_ANY;
063:
064: public static java.lang.String ADMIN_ID = org.sakaiproject.user.api.UserDirectoryService.ADMIN_ID;
065:
066: public static java.lang.String ADMIN_EID = org.sakaiproject.user.api.UserDirectoryService.ADMIN_EID;
067:
068: public static org.sakaiproject.user.api.User getUser(
069: java.lang.String param0)
070: throws org.sakaiproject.user.api.UserNotDefinedException {
071: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
072: if (service == null)
073: return null;
074:
075: return service.getUser(param0);
076: }
077:
078: public static org.sakaiproject.user.api.User getUserByEid(
079: java.lang.String param0)
080: throws org.sakaiproject.user.api.UserNotDefinedException {
081: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
082: if (service == null)
083: return null;
084:
085: return service.getUserByEid(param0);
086: }
087:
088: public static java.util.List getUsers(java.util.Collection param0) {
089: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
090: if (service == null)
091: return null;
092:
093: return service.getUsers(param0);
094: }
095:
096: public static java.util.List getUsers() {
097: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
098: if (service == null)
099: return null;
100:
101: return service.getUsers();
102: }
103:
104: public static java.util.List getUsers(int param0, int param1) {
105: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
106: if (service == null)
107: return null;
108:
109: return service.getUsers(param0, param1);
110: }
111:
112: public static org.sakaiproject.user.api.User getCurrentUser() {
113: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
114: if (service == null)
115: return null;
116:
117: return service.getCurrentUser();
118: }
119:
120: public static java.util.Collection findUsersByEmail(
121: java.lang.String param0) {
122: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
123: if (service == null)
124: return null;
125:
126: return service.findUsersByEmail(param0);
127: }
128:
129: public static boolean allowUpdateUser(java.lang.String param0) {
130: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
131: if (service == null)
132: return false;
133:
134: return service.allowUpdateUser(param0);
135: }
136:
137: public static org.sakaiproject.user.api.UserEdit editUser(
138: java.lang.String param0)
139: throws org.sakaiproject.user.api.UserNotDefinedException,
140: org.sakaiproject.user.api.UserPermissionException,
141: org.sakaiproject.user.api.UserLockedException {
142: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
143: if (service == null)
144: return null;
145:
146: return service.editUser(param0);
147: }
148:
149: public static void commitEdit(
150: org.sakaiproject.user.api.UserEdit param0)
151: throws org.sakaiproject.user.api.UserAlreadyDefinedException {
152: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
153: if (service == null)
154: return;
155:
156: service.commitEdit(param0);
157: }
158:
159: public static void cancelEdit(
160: org.sakaiproject.user.api.UserEdit param0) {
161: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
162: if (service == null)
163: return;
164:
165: service.cancelEdit(param0);
166: }
167:
168: public static org.sakaiproject.user.api.User getAnonymousUser() {
169: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
170: if (service == null)
171: return null;
172:
173: return service.getAnonymousUser();
174: }
175:
176: public static int countUsers() {
177: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
178: if (service == null)
179: return 0;
180:
181: return service.countUsers();
182: }
183:
184: public static java.util.List searchUsers(java.lang.String param0,
185: int param1, int param2) {
186: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
187: if (service == null)
188: return null;
189:
190: return service.searchUsers(param0, param1, param2);
191: }
192:
193: public static int countSearchUsers(java.lang.String param0) {
194: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
195: if (service == null)
196: return 0;
197:
198: return service.countSearchUsers(param0);
199: }
200:
201: public static boolean allowAddUser() {
202: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
203: if (service == null)
204: return false;
205:
206: return service.allowAddUser();
207: }
208:
209: public static org.sakaiproject.user.api.UserEdit addUser(
210: java.lang.String param0, java.lang.String param1)
211: throws org.sakaiproject.user.api.UserIdInvalidException,
212: org.sakaiproject.user.api.UserAlreadyDefinedException,
213: org.sakaiproject.user.api.UserPermissionException {
214: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
215: if (service == null)
216: return null;
217:
218: return service.addUser(param0, param1);
219: }
220:
221: public static org.sakaiproject.user.api.User addUser(
222: java.lang.String param0, java.lang.String param1,
223: java.lang.String param2, java.lang.String param3,
224: java.lang.String param4, java.lang.String param5,
225: java.lang.String param6,
226: org.sakaiproject.entity.api.ResourceProperties param7)
227: throws org.sakaiproject.user.api.UserIdInvalidException,
228: org.sakaiproject.user.api.UserAlreadyDefinedException,
229: org.sakaiproject.user.api.UserPermissionException {
230: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
231: if (service == null)
232: return null;
233:
234: return service.addUser(param0, param1, param2, param3, param4,
235: param5, param6, param7);
236: }
237:
238: public static org.sakaiproject.user.api.UserEdit mergeUser(
239: org.w3c.dom.Element param0)
240: throws org.sakaiproject.user.api.UserIdInvalidException,
241: org.sakaiproject.user.api.UserAlreadyDefinedException,
242: org.sakaiproject.user.api.UserPermissionException {
243: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
244: if (service == null)
245: return null;
246:
247: return service.mergeUser(param0);
248: }
249:
250: public static boolean allowRemoveUser(java.lang.String param0) {
251: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
252: if (service == null)
253: return false;
254:
255: return service.allowRemoveUser(param0);
256: }
257:
258: public static void removeUser(
259: org.sakaiproject.user.api.UserEdit param0)
260: throws org.sakaiproject.user.api.UserPermissionException {
261: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
262: if (service == null)
263: return;
264:
265: service.removeUser(param0);
266: }
267:
268: public static org.sakaiproject.user.api.User authenticate(
269: java.lang.String param0, java.lang.String param1) {
270: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
271: if (service == null)
272: return null;
273:
274: return service.authenticate(param0, param1);
275: }
276:
277: public static void destroyAuthentication() {
278: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
279: if (service == null)
280: return;
281:
282: service.destroyAuthentication();
283: }
284:
285: public static java.lang.String userReference(java.lang.String param0) {
286: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
287: if (service == null)
288: return null;
289:
290: return service.userReference(param0);
291: }
292:
293: public static java.lang.String getUserEid(java.lang.String param0)
294: throws org.sakaiproject.user.api.UserNotDefinedException {
295: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
296: if (service == null)
297: return null;
298:
299: return service.getUserEid(param0);
300: }
301:
302: public static java.lang.String getUserId(java.lang.String param0)
303: throws org.sakaiproject.user.api.UserNotDefinedException {
304: org.sakaiproject.user.api.UserDirectoryService service = getInstance();
305: if (service == null)
306: return null;
307:
308: return service.getUserId(param0);
309: }
310: }
|