1 16 17 package org.apache.jetspeed.services.security; 18 19 import java.util.Iterator ; 20 21 import org.apache.jetspeed.om.security.Group; 22 import org.apache.turbine.services.TurbineServices; 23 24 33 34 public abstract class JetspeedGroupManagement 35 { 36 public String SERVICE_NAME = "GroupManagement"; 37 38 44 protected static GroupManagement getService() 45 { 46 return (GroupManagement)TurbineServices 47 .getInstance().getService(GroupManagement.SERVICE_NAME); 48 } 49 50 61 public static Iterator getGroups(String username) 62 throws JetspeedSecurityException 63 { 64 return getService().getGroups(username); 65 } 66 67 77 public static Iterator getGroups() 78 throws JetspeedSecurityException 79 { 80 return getService().getGroups(); 81 } 82 83 90 public static void addGroup(Group group) 91 throws JetspeedSecurityException 92 { 93 getService().addGroup(group); 94 } 95 96 103 public static void saveGroup(Group group) 104 throws JetspeedSecurityException 105 { 106 getService().saveGroup(group); 107 } 108 109 119 public static void removeGroup(String groupname) 120 throws JetspeedSecurityException 121 { 122 getService().removeGroup(groupname); 123 } 124 125 134 public static void joinGroup(String username, String groupname) 135 throws JetspeedSecurityException 136 { 137 getService().joinGroup(username,groupname); 138 } 139 140 149 public static void joinGroup(String username, String groupname, String rolename) 150 throws JetspeedSecurityException 151 { 152 getService().joinGroup(username,groupname, rolename); 153 } 154 155 156 165 public static void unjoinGroup(String username, String groupname) 166 throws JetspeedSecurityException 167 { 168 getService().unjoinGroup(username,groupname); 169 } 170 171 180 public static void unjoinGroup(String username, String groupname, String rolename) 181 throws JetspeedSecurityException 182 { 183 getService().unjoinGroup(username,groupname,rolename); 184 } 185 186 187 196 public static boolean inGroup(String username, String groupname) 197 throws JetspeedSecurityException 198 { 199 return getService().inGroup(username,groupname); 200 } 201 202 213 public static Group getGroup(String groupname) 214 throws JetspeedSecurityException 215 { 216 return getService().getGroup(groupname); 217 } 218 } 219 220 221 222 223 224 225 226 227 228 229 230 | Popular Tags |