1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.services;
18
19 import java.util.Iterator;
20 import java.security.Principal;
21
22
23 import org.apache.turbine.services.TurbineServices;
24
25
26 import org.apache.jetspeed.om.security.JetspeedUser;
27 import org.apache.jetspeed.services.security.UserManagement;
28 import org.apache.jetspeed.services.security.JetspeedSecurityException;
29
30
31
32 /***
33 * Static accessor for the PortalAccessController service
34 *
35 * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
36 * @version $Id: JetspeedUserManagement.java,v 1.4 2004/02/23 04:00:57 jford Exp $
37 */
38 public abstract class JetspeedUserManagement
39 {
40
41
42
43
44
45
46
47 protected static UserManagement getService()
48 {
49 return (UserManagement)TurbineServices
50 .getInstance().getService(UserManagement.SERVICE_NAME);
51 }
52
53 /***
54 * @see org.apache.jetspeed.services.security.UserManagement#getUser
55 */
56 public static JetspeedUser getUser(Principal principal)
57 throws JetspeedSecurityException
58 {
59 return getService().getUser(principal);
60 }
61
62 /***
63 * @see org.apache.jetspeed.services.security.UserManagement#getUsers
64 */
65 public static Iterator getUsers()
66 throws JetspeedSecurityException
67 {
68 return getService().getUsers();
69 }
70
71 /***
72 * @see org.apache.jetspeed.services.security.UserManagement#getUsers
73 */
74 public static Iterator getUsers(String filter)
75 throws JetspeedSecurityException
76 {
77 return getService().getUsers(filter);
78 }
79
80 /***
81 * @see org.apache.jetspeed.services.security.UserManagement#saveUser
82 */
83 public static void saveUser(JetspeedUser user)
84 throws JetspeedSecurityException
85 {
86 getService().saveUser(user);
87 }
88
89 /***
90 * @see org.apache.jetspeed.services.security.UserManagement#addUser
91 */
92 public static void addUser(JetspeedUser user)
93 throws JetspeedSecurityException
94 {
95 getService().addUser(user);
96 }
97
98 /***
99 * @see org.apache.jetspeed.services.security.UserManagement#removeUser
100 */
101 public static void removeUser(Principal principal)
102 throws JetspeedSecurityException
103 {
104 getService().removeUser(principal);
105 }
106
107
108
109
110
111 /***
112 * @see org.apache.jetspeed.services.security.UserManagement#changePassword
113 */
114 public static void changePassword( JetspeedUser user,
115 String oldPassword,
116 String newPassword )
117 throws JetspeedSecurityException
118 {
119 getService().changePassword(user, oldPassword, newPassword);
120 }
121
122 /***
123 * @see org.apache.jetspeed.services.security.UserManagement#forcePassword
124 */
125 public static void forcePassword( JetspeedUser user, String password )
126 throws JetspeedSecurityException
127 {
128 getService().forcePassword(user, password);
129 }
130
131
132 /***
133 * @see org.apache.jetspeed.services.security.UserManagement#encryptPassword
134 */
135 public static String encryptPassword( String password )
136 throws JetspeedSecurityException
137 {
138 return getService().encryptPassword(password);
139 }
140
141 }
142