001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/alias/tags/sakai_2-4-1/alias-api/api/src/java/org/sakaiproject/alias/cover/AliasService.java $
003: * $Id: AliasService.java 8385 2006-04-27 03:09:38Z 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.alias.cover;
021:
022: import org.sakaiproject.component.cover.ComponentManager;
023:
024: /**
025: * <p>
026: * AliasService is a static Cover for the {@link org.sakaiproject.alias.api.AliasService AliasService}; see that interface for usage details.
027: * </p>
028: */
029: public class AliasService {
030: /**
031: * Access the component instance: special cover only method.
032: *
033: * @return the component instance.
034: */
035: public static org.sakaiproject.alias.api.AliasService getInstance() {
036: if (ComponentManager.CACHE_COMPONENTS) {
037: if (m_instance == null)
038: m_instance = (org.sakaiproject.alias.api.AliasService) ComponentManager
039: .get(org.sakaiproject.alias.api.AliasService.class);
040: return m_instance;
041: } else {
042: return (org.sakaiproject.alias.api.AliasService) ComponentManager
043: .get(org.sakaiproject.alias.api.AliasService.class);
044: }
045: }
046:
047: private static org.sakaiproject.alias.api.AliasService m_instance = null;
048:
049: public static java.lang.String APPLICATION_ID = org.sakaiproject.alias.api.AliasService.APPLICATION_ID;
050:
051: public static java.lang.String REFERENCE_ROOT = org.sakaiproject.alias.api.AliasService.REFERENCE_ROOT;
052:
053: public static java.lang.String SECURE_ADD_ALIAS = org.sakaiproject.alias.api.AliasService.SECURE_ADD_ALIAS;
054:
055: public static java.lang.String SECURE_UPDATE_ALIAS = org.sakaiproject.alias.api.AliasService.SECURE_UPDATE_ALIAS;
056:
057: public static java.lang.String SECURE_REMOVE_ALIAS = org.sakaiproject.alias.api.AliasService.SECURE_REMOVE_ALIAS;
058:
059: public static boolean allowSetAlias(java.lang.String param0,
060: java.lang.String param1) {
061: org.sakaiproject.alias.api.AliasService service = getInstance();
062: if (service == null)
063: return false;
064:
065: return service.allowSetAlias(param0, param1);
066: }
067:
068: public static void setAlias(java.lang.String param0,
069: java.lang.String param1)
070: throws org.sakaiproject.exception.IdUsedException,
071: org.sakaiproject.exception.IdInvalidException,
072: org.sakaiproject.exception.PermissionException {
073: org.sakaiproject.alias.api.AliasService service = getInstance();
074: if (service == null)
075: return;
076:
077: service.setAlias(param0, param1);
078: }
079:
080: public static boolean allowRemoveAlias(java.lang.String param0) {
081: org.sakaiproject.alias.api.AliasService service = getInstance();
082: if (service == null)
083: return false;
084:
085: return service.allowRemoveAlias(param0);
086: }
087:
088: public static void removeAlias(java.lang.String param0)
089: throws org.sakaiproject.exception.IdUnusedException,
090: org.sakaiproject.exception.PermissionException,
091: org.sakaiproject.exception.InUseException {
092: org.sakaiproject.alias.api.AliasService service = getInstance();
093: if (service == null)
094: return;
095:
096: service.removeAlias(param0);
097: }
098:
099: public static boolean allowRemoveTargetAliases(
100: java.lang.String param0) {
101: org.sakaiproject.alias.api.AliasService service = getInstance();
102: if (service == null)
103: return false;
104:
105: return service.allowRemoveTargetAliases(param0);
106: }
107:
108: public static void removeTargetAliases(java.lang.String param0)
109: throws org.sakaiproject.exception.PermissionException {
110: org.sakaiproject.alias.api.AliasService service = getInstance();
111: if (service == null)
112: return;
113:
114: service.removeTargetAliases(param0);
115: }
116:
117: public static java.util.List getAliases(int param0, int param1) {
118: org.sakaiproject.alias.api.AliasService service = getInstance();
119: if (service == null)
120: return null;
121:
122: return service.getAliases(param0, param1);
123: }
124:
125: public static java.util.List getAliases(java.lang.String param0) {
126: org.sakaiproject.alias.api.AliasService service = getInstance();
127: if (service == null)
128: return null;
129:
130: return service.getAliases(param0);
131: }
132:
133: public static java.util.List getAliases(java.lang.String param0,
134: int param1, int param2) {
135: org.sakaiproject.alias.api.AliasService service = getInstance();
136: if (service == null)
137: return null;
138:
139: return service.getAliases(param0, param1, param2);
140: }
141:
142: public static int countAliases() {
143: org.sakaiproject.alias.api.AliasService service = getInstance();
144: if (service == null)
145: return 0;
146:
147: return service.countAliases();
148: }
149:
150: public static java.util.List searchAliases(java.lang.String param0,
151: int param1, int param2) {
152: org.sakaiproject.alias.api.AliasService service = getInstance();
153: if (service == null)
154: return null;
155:
156: return service.searchAliases(param0, param1, param2);
157: }
158:
159: public static int countSearchAliases(java.lang.String param0) {
160: org.sakaiproject.alias.api.AliasService service = getInstance();
161: if (service == null)
162: return 0;
163:
164: return service.countSearchAliases(param0);
165: }
166:
167: public static java.lang.String aliasReference(
168: java.lang.String param0) {
169: org.sakaiproject.alias.api.AliasService service = getInstance();
170: if (service == null)
171: return null;
172:
173: return service.aliasReference(param0);
174: }
175:
176: public static boolean allowAdd() {
177: org.sakaiproject.alias.api.AliasService service = getInstance();
178: if (service == null)
179: return false;
180:
181: return service.allowAdd();
182: }
183:
184: public static boolean allowEdit(java.lang.String param0) {
185: org.sakaiproject.alias.api.AliasService service = getInstance();
186: if (service == null)
187: return false;
188:
189: return service.allowEdit(param0);
190: }
191:
192: public static void commit(
193: org.sakaiproject.alias.api.AliasEdit param0) {
194: org.sakaiproject.alias.api.AliasService service = getInstance();
195: if (service == null)
196: return;
197:
198: service.commit(param0);
199: }
200:
201: public static org.sakaiproject.alias.api.AliasEdit add(
202: java.lang.String param0)
203: throws org.sakaiproject.exception.IdInvalidException,
204: org.sakaiproject.exception.IdUsedException,
205: org.sakaiproject.exception.PermissionException {
206: org.sakaiproject.alias.api.AliasService service = getInstance();
207: if (service == null)
208: return null;
209:
210: return service.add(param0);
211: }
212:
213: public static void remove(
214: org.sakaiproject.alias.api.AliasEdit param0)
215: throws org.sakaiproject.exception.PermissionException {
216: org.sakaiproject.alias.api.AliasService service = getInstance();
217: if (service == null)
218: return;
219:
220: service.remove(param0);
221: }
222:
223: public static void cancel(
224: org.sakaiproject.alias.api.AliasEdit param0) {
225: org.sakaiproject.alias.api.AliasService service = getInstance();
226: if (service == null)
227: return;
228:
229: service.cancel(param0);
230: }
231:
232: public static java.lang.String getTarget(java.lang.String param0)
233: throws org.sakaiproject.exception.IdUnusedException {
234: org.sakaiproject.alias.api.AliasService service = getInstance();
235: if (service == null)
236: return null;
237:
238: return service.getTarget(param0);
239: }
240:
241: public static org.sakaiproject.alias.api.AliasEdit edit(
242: java.lang.String param0)
243: throws org.sakaiproject.exception.IdUnusedException,
244: org.sakaiproject.exception.PermissionException,
245: org.sakaiproject.exception.InUseException {
246: org.sakaiproject.alias.api.AliasService service = getInstance();
247: if (service == null)
248: return null;
249:
250: return service.edit(param0);
251: }
252: }
|