001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/authz/tags/sakai_2-4-1/authz-api/api/src/java/org/sakaiproject/authz/cover/AuthzGroupService.java $
003: * $Id: AuthzGroupService.java 13785 2006-08-16 18:42:22Z jholtzman@berkeley.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.authz.cover;
021:
022: import java.util.HashSet;
023: import java.util.Set;
024:
025: import org.sakaiproject.component.cover.ComponentManager;
026:
027: /**
028: * <p>
029: * AuthzGroupService is a static Cover for the {@link org.sakaiproject.authz.api.AuthzGroupService AuthzGroupService}; see that interface for usage details.
030: * </p>
031: */
032: public class AuthzGroupService {
033: /**
034: * Access the component instance: special cover only method.
035: *
036: * @return the component instance.
037: */
038: public static org.sakaiproject.authz.api.AuthzGroupService getInstance() {
039: if (ComponentManager.CACHE_COMPONENTS) {
040: if (m_instance == null)
041: m_instance = (org.sakaiproject.authz.api.AuthzGroupService) ComponentManager
042: .get(org.sakaiproject.authz.api.AuthzGroupService.class);
043: return m_instance;
044: } else {
045: return (org.sakaiproject.authz.api.AuthzGroupService) ComponentManager
046: .get(org.sakaiproject.authz.api.AuthzGroupService.class);
047: }
048: }
049:
050: private static org.sakaiproject.authz.api.AuthzGroupService m_instance = null;
051:
052: public static java.lang.String APPLICATION_ID = org.sakaiproject.authz.api.AuthzGroupService.APPLICATION_ID;
053:
054: public static java.lang.String REFERENCE_ROOT = org.sakaiproject.authz.api.AuthzGroupService.REFERENCE_ROOT;
055:
056: public static java.lang.String SECURE_ADD_AUTHZ_GROUP = org.sakaiproject.authz.api.AuthzGroupService.SECURE_ADD_AUTHZ_GROUP;
057:
058: public static java.lang.String SECURE_REMOVE_AUTHZ_GROUP = org.sakaiproject.authz.api.AuthzGroupService.SECURE_REMOVE_AUTHZ_GROUP;
059:
060: public static java.lang.String SECURE_UPDATE_AUTHZ_GROUP = org.sakaiproject.authz.api.AuthzGroupService.SECURE_UPDATE_AUTHZ_GROUP;
061:
062: public static java.lang.String SECURE_UPDATE_OWN_AUTHZ_GROUP = org.sakaiproject.authz.api.AuthzGroupService.SECURE_UPDATE_OWN_AUTHZ_GROUP;
063:
064: public static java.lang.String ANON_ROLE = org.sakaiproject.authz.api.AuthzGroupService.ANON_ROLE;
065:
066: public static java.lang.String AUTH_ROLE = org.sakaiproject.authz.api.AuthzGroupService.AUTH_ROLE;
067:
068: public static java.util.List getAuthzGroups(
069: java.lang.String param0,
070: org.sakaiproject.javax.PagingPosition param1) {
071: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
072: if (service == null)
073: return null;
074:
075: return service.getAuthzGroups(param0, param1);
076: }
077:
078: public static int countAuthzGroups(java.lang.String param0) {
079: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
080: if (service == null)
081: return 0;
082:
083: return service.countAuthzGroups(param0);
084: }
085:
086: public static Set getAuthzGroupIds(String providerId) {
087: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
088: if (service == null)
089: return new HashSet();
090:
091: return service.getAuthzGroupIds(providerId);
092: }
093:
094: public Set getProviderIds(String authzGroupId) {
095: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
096: if (service == null)
097: return new HashSet();
098:
099: return service.getProviderIds(authzGroupId);
100: }
101:
102: public static org.sakaiproject.authz.api.AuthzGroup getAuthzGroup(
103: java.lang.String param0)
104: throws org.sakaiproject.authz.api.GroupNotDefinedException {
105: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
106: if (service == null)
107: return null;
108:
109: return service.getAuthzGroup(param0);
110: }
111:
112: public static boolean allowUpdate(java.lang.String param0) {
113: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
114: if (service == null)
115: return false;
116:
117: return service.allowUpdate(param0);
118: }
119:
120: public static void save(org.sakaiproject.authz.api.AuthzGroup param0)
121: throws org.sakaiproject.authz.api.GroupNotDefinedException,
122: org.sakaiproject.authz.api.AuthzPermissionException {
123: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
124: if (service == null)
125: return;
126:
127: service.save(param0);
128: }
129:
130: public static boolean allowAdd(java.lang.String param0) {
131: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
132: if (service == null)
133: return false;
134:
135: return service.allowAdd(param0);
136: }
137:
138: public static org.sakaiproject.authz.api.AuthzGroup addAuthzGroup(
139: java.lang.String param0)
140: throws org.sakaiproject.authz.api.GroupIdInvalidException,
141: org.sakaiproject.authz.api.GroupAlreadyDefinedException,
142: org.sakaiproject.authz.api.AuthzPermissionException {
143: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
144: if (service == null)
145: return null;
146:
147: return service.addAuthzGroup(param0);
148: }
149:
150: public static org.sakaiproject.authz.api.AuthzGroup addAuthzGroup(
151: java.lang.String param0,
152: org.sakaiproject.authz.api.AuthzGroup param1,
153: java.lang.String param2)
154: throws org.sakaiproject.authz.api.GroupIdInvalidException,
155: org.sakaiproject.authz.api.GroupAlreadyDefinedException,
156: org.sakaiproject.authz.api.AuthzPermissionException {
157: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
158: if (service == null)
159: return null;
160:
161: return service.addAuthzGroup(param0, param1, param2);
162: }
163:
164: public static org.sakaiproject.authz.api.AuthzGroup newAuthzGroup(
165: java.lang.String param0,
166: org.sakaiproject.authz.api.AuthzGroup param1,
167: java.lang.String param2)
168: throws org.sakaiproject.authz.api.GroupAlreadyDefinedException {
169: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
170: if (service == null)
171: return null;
172:
173: return service.newAuthzGroup(param0, param1, param2);
174: }
175:
176: public static boolean allowRemove(java.lang.String param0) {
177: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
178: if (service == null)
179: return false;
180:
181: return service.allowRemove(param0);
182: }
183:
184: public static void removeAuthzGroup(
185: org.sakaiproject.authz.api.AuthzGroup param0)
186: throws org.sakaiproject.authz.api.AuthzPermissionException {
187: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
188: if (service == null)
189: return;
190:
191: service.removeAuthzGroup(param0);
192: }
193:
194: public static void removeAuthzGroup(java.lang.String param0)
195: throws org.sakaiproject.authz.api.AuthzPermissionException {
196: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
197: if (service == null)
198: return;
199:
200: service.removeAuthzGroup(param0);
201: }
202:
203: public static java.lang.String authzGroupReference(
204: java.lang.String param0) {
205: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
206: if (service == null)
207: return null;
208:
209: return service.authzGroupReference(param0);
210: }
211:
212: public static void joinGroup(java.lang.String param0,
213: java.lang.String param1)
214: throws org.sakaiproject.authz.api.GroupNotDefinedException,
215: org.sakaiproject.authz.api.AuthzPermissionException {
216: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
217: if (service == null)
218: return;
219:
220: service.joinGroup(param0, param1);
221: }
222:
223: public static void unjoinGroup(java.lang.String param0)
224: throws org.sakaiproject.authz.api.GroupNotDefinedException,
225: org.sakaiproject.authz.api.AuthzPermissionException {
226: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
227: if (service == null)
228: return;
229:
230: service.unjoinGroup(param0);
231: }
232:
233: public static boolean allowJoinGroup(java.lang.String param0) {
234: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
235: if (service == null)
236: return false;
237:
238: return service.allowJoinGroup(param0);
239: }
240:
241: public static boolean allowUnjoinGroup(java.lang.String param0) {
242: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
243: if (service == null)
244: return false;
245:
246: return service.allowUnjoinGroup(param0);
247: }
248:
249: public static java.util.Set getUsersIsAllowed(
250: java.lang.String param0, java.util.Collection param1) {
251: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
252: if (service == null)
253: return null;
254:
255: return service.getUsersIsAllowed(param0, param1);
256: }
257:
258: public static java.util.Set getAuthzGroupsIsAllowed(
259: java.lang.String param0, java.lang.String param1,
260: java.util.Collection param2) {
261: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
262: if (service == null)
263: return null;
264:
265: return service.getAuthzGroupsIsAllowed(param0, param1, param2);
266: }
267:
268: public static java.util.Set getAllowedFunctions(
269: java.lang.String param0, java.util.Collection param1) {
270: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
271: if (service == null)
272: return null;
273:
274: return service.getAllowedFunctions(param0, param1);
275: }
276:
277: public static void refreshUser(java.lang.String param0) {
278: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
279: if (service == null)
280: return;
281:
282: service.refreshUser(param0);
283: }
284:
285: public static boolean isAllowed(java.lang.String param0,
286: java.lang.String param1, java.util.Collection param2) {
287: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
288: if (service == null)
289: return false;
290:
291: return service.isAllowed(param0, param1, param2);
292: }
293:
294: public static boolean isAllowed(java.lang.String param0,
295: java.lang.String param1, java.lang.String param2) {
296: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
297: if (service == null)
298: return false;
299:
300: return service.isAllowed(param0, param1, param2);
301: }
302:
303: public static java.lang.String getUserRole(java.lang.String param0,
304: java.lang.String param1) {
305: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
306: if (service == null)
307: return null;
308:
309: return service.getUserRole(param0, param1);
310: }
311:
312: public static java.util.Map getUsersRole(
313: java.util.Collection param0, java.lang.String param1) {
314: org.sakaiproject.authz.api.AuthzGroupService service = getInstance();
315: if (service == null)
316: return null;
317:
318: return service.getUsersRole(param0, param1);
319: }
320: }
|