001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/authz/tags/sakai_2-4-1/authz-api/api/src/java/org/sakaiproject/authz/cover/SecurityService.java $
003: * $Id: SecurityService.java 18600 2006-12-02 21:08:54Z 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.authz.cover;
021:
022: import org.sakaiproject.component.cover.ComponentManager;
023:
024: /**
025: * <p>
026: * SecurityService is a static Cover for the {@link org.sakaiproject.authz.api.SecurityService SecurityService}; see that interface for usage details.
027: * </p>
028: *
029: * @author University of Michigan, Sakai Software Development Team
030: * @version $Revision: 18600 $
031: */
032: public class SecurityService {
033: /**
034: * Access the component instance: special cover only method.
035: *
036: * @return the component instance.
037: */
038: public static org.sakaiproject.authz.api.SecurityService getInstance() {
039: if (ComponentManager.CACHE_COMPONENTS) {
040: if (m_instance == null)
041: m_instance = (org.sakaiproject.authz.api.SecurityService) ComponentManager
042: .get(org.sakaiproject.authz.api.SecurityService.class);
043: return m_instance;
044: } else {
045: return (org.sakaiproject.authz.api.SecurityService) ComponentManager
046: .get(org.sakaiproject.authz.api.SecurityService.class);
047: }
048: }
049:
050: private static org.sakaiproject.authz.api.SecurityService m_instance = null;
051:
052: public static java.lang.String SERVICE_NAME = org.sakaiproject.authz.api.SecurityService.SERVICE_NAME;
053:
054: public static java.util.List unlockUsers(java.lang.String param0,
055: java.lang.String param1) {
056: org.sakaiproject.authz.api.SecurityService service = getInstance();
057: if (service == null)
058: return null;
059:
060: return service.unlockUsers(param0, param1);
061: }
062:
063: public static boolean isSuperUser() {
064: org.sakaiproject.authz.api.SecurityService service = getInstance();
065: if (service == null)
066: return false;
067:
068: return service.isSuperUser();
069: }
070:
071: public static boolean isSuperUser(java.lang.String param0) {
072: org.sakaiproject.authz.api.SecurityService service = getInstance();
073: if (service == null)
074: return false;
075:
076: return service.isSuperUser(param0);
077: }
078:
079: public static boolean unlock(java.lang.String param0,
080: java.lang.String param1) {
081: org.sakaiproject.authz.api.SecurityService service = getInstance();
082: if (service == null)
083: return false;
084:
085: return service.unlock(param0, param1);
086: }
087:
088: public static boolean unlock(org.sakaiproject.user.api.User param0,
089: java.lang.String param1, java.lang.String param2) {
090: org.sakaiproject.authz.api.SecurityService service = getInstance();
091: if (service == null)
092: return false;
093:
094: return service.unlock(param0, param1, param2);
095: }
096:
097: public static boolean unlock(java.lang.String param0,
098: java.lang.String param1, java.lang.String param2) {
099: org.sakaiproject.authz.api.SecurityService service = getInstance();
100: if (service == null)
101: return false;
102:
103: return service.unlock(param0, param1, param2);
104: }
105:
106: public static boolean unlock(java.lang.String param0,
107: java.lang.String param1, java.lang.String param2,
108: java.util.Collection param3) {
109: org.sakaiproject.authz.api.SecurityService service = getInstance();
110: if (service == null)
111: return false;
112:
113: return service.unlock(param0, param1, param2, param3);
114: }
115:
116: public static void pushAdvisor(
117: org.sakaiproject.authz.api.SecurityAdvisor param0) {
118: org.sakaiproject.authz.api.SecurityService service = getInstance();
119: if (service == null)
120: return;
121:
122: service.pushAdvisor(param0);
123: }
124:
125: public static org.sakaiproject.authz.api.SecurityAdvisor popAdvisor() {
126: org.sakaiproject.authz.api.SecurityService service = getInstance();
127: if (service == null)
128: return null;
129:
130: return service.popAdvisor();
131: }
132:
133: public static boolean hasAdvisors() {
134: org.sakaiproject.authz.api.SecurityService service = getInstance();
135: if (service == null)
136: return false;
137:
138: return service.hasAdvisors();
139: }
140:
141: public static void clearAdvisors() {
142: org.sakaiproject.authz.api.SecurityService service = getInstance();
143: if (service == null)
144: return;
145:
146: service.clearAdvisors();
147: }
148: }
|