1 16 17 package org.apache.jetspeed.services; 18 19 import java.util.Iterator ; 20 import java.security.Principal ; 21 22 import org.apache.turbine.services.TurbineServices; 24 25 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 38 public abstract class JetspeedUserManagement 39 { 40 41 47 protected static UserManagement getService() 48 { 49 return (UserManagement)TurbineServices 50 .getInstance().getService(UserManagement.SERVICE_NAME); 51 } 52 53 56 public static JetspeedUser getUser(Principal principal) 57 throws JetspeedSecurityException 58 { 59 return getService().getUser(principal); 60 } 61 62 65 public static Iterator getUsers() 66 throws JetspeedSecurityException 67 { 68 return getService().getUsers(); 69 } 70 71 74 public static Iterator getUsers(String filter) 75 throws JetspeedSecurityException 76 { 77 return getService().getUsers(filter); 78 } 79 80 83 public static void saveUser(JetspeedUser user) 84 throws JetspeedSecurityException 85 { 86 getService().saveUser(user); 87 } 88 89 92 public static void addUser(JetspeedUser user) 93 throws JetspeedSecurityException 94 { 95 getService().addUser(user); 96 } 97 98 101 public static void removeUser(Principal principal) 102 throws JetspeedSecurityException 103 { 104 getService().removeUser(principal); 105 } 106 107 111 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 125 public static void forcePassword( JetspeedUser user, String password ) 126 throws JetspeedSecurityException 127 { 128 getService().forcePassword(user, password); 129 } 130 131 132 135 public static String encryptPassword( String password ) 136 throws JetspeedSecurityException 137 { 138 return getService().encryptPassword(password); 139 } 140 141 } 142 143 | Popular Tags |