001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/chat/tags/sakai_2-4-1/chat-api/api/src/java/org/sakaiproject/chat/cover/ChatService.java $
003: * $Id: ChatService.java 20991 2007-02-04 02:49:20Z csev@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.chat.cover;
021:
022: import java.util.Map;
023:
024: import org.sakaiproject.component.cover.ComponentManager;
025:
026: /**
027: * <p>
028: * ChatService is a static Cover for the {@link org.sakaiproject.chat.api.ChatService ChatService}; see that interface for usage details.
029: * </p>
030: */
031: public class ChatService {
032: /**
033: * Access the component instance: special cover only method.
034: *
035: * @return the component instance.
036: */
037: public static org.sakaiproject.chat.api.ChatService getInstance() {
038: if (ComponentManager.CACHE_COMPONENTS) {
039: if (m_instance == null)
040: m_instance = (org.sakaiproject.chat.api.ChatService) ComponentManager
041: .get(org.sakaiproject.chat.api.ChatService.class);
042: return m_instance;
043: } else {
044: return (org.sakaiproject.chat.api.ChatService) ComponentManager
045: .get(org.sakaiproject.chat.api.ChatService.class);
046: }
047: }
048:
049: private static org.sakaiproject.chat.api.ChatService m_instance = null;
050:
051: public static java.lang.String APPLICATION_ID = org.sakaiproject.chat.api.ChatService.APPLICATION_ID;
052:
053: public static java.lang.String REFERENCE_ROOT = org.sakaiproject.chat.api.ChatService.REFERENCE_ROOT;
054:
055: public static java.lang.String SECURE_READ = org.sakaiproject.chat.api.ChatService.SECURE_READ;
056:
057: public static java.lang.String SECURE_ADD = org.sakaiproject.chat.api.ChatService.SECURE_ADD;
058:
059: public static java.lang.String SECURE_REMOVE_OWN = org.sakaiproject.chat.api.ChatService.SECURE_REMOVE_OWN;
060:
061: public static java.lang.String SECURE_REMOVE_ANY = org.sakaiproject.chat.api.ChatService.SECURE_REMOVE_ANY;
062:
063: public static java.lang.String SECURE_UPDATE_OWN = org.sakaiproject.chat.api.ChatService.SECURE_UPDATE_OWN;
064:
065: public static java.lang.String SECURE_UPDATE_ANY = org.sakaiproject.chat.api.ChatService.SECURE_UPDATE_ANY;
066:
067: public static java.lang.String SECURE_READ_DRAFT = org.sakaiproject.chat.api.ChatService.SECURE_READ_DRAFT;
068:
069: public static java.lang.String REF_TYPE_CHANNEL = org.sakaiproject.chat.api.ChatService.REF_TYPE_CHANNEL;
070:
071: public static java.lang.String REF_TYPE_MESSAGE = org.sakaiproject.chat.api.ChatService.REF_TYPE_MESSAGE;
072:
073: public static org.sakaiproject.chat.api.ChatChannel getChatChannel(
074: java.lang.String param0)
075: throws org.sakaiproject.exception.IdUnusedException,
076: org.sakaiproject.exception.PermissionException {
077: org.sakaiproject.chat.api.ChatService service = getInstance();
078: if (service == null)
079: return null;
080:
081: return service.getChatChannel(param0);
082: }
083:
084: public static org.sakaiproject.chat.api.ChatChannelEdit addChatChannel(
085: java.lang.String param0)
086: throws org.sakaiproject.exception.IdUsedException,
087: org.sakaiproject.exception.IdInvalidException,
088: org.sakaiproject.exception.PermissionException {
089: org.sakaiproject.chat.api.ChatService service = getInstance();
090: if (service == null)
091: return null;
092:
093: return service.addChatChannel(param0);
094: }
095:
096: public static java.util.List getChannels() {
097: org.sakaiproject.chat.api.ChatService service = getInstance();
098: if (service == null)
099: return null;
100:
101: return service.getChannels();
102: }
103:
104: public static boolean allowGetChannel(java.lang.String param0) {
105: org.sakaiproject.chat.api.ChatService service = getInstance();
106: if (service == null)
107: return false;
108:
109: return service.allowGetChannel(param0);
110: }
111:
112: public static boolean allowAddChannel(java.lang.String param0) {
113: org.sakaiproject.chat.api.ChatService service = getInstance();
114: if (service == null)
115: return false;
116:
117: return service.allowAddChannel(param0);
118: }
119:
120: public static org.sakaiproject.message.api.MessageChannelEdit addChannel(
121: java.lang.String param0)
122: throws org.sakaiproject.exception.IdUsedException,
123: org.sakaiproject.exception.IdInvalidException,
124: org.sakaiproject.exception.PermissionException {
125: org.sakaiproject.chat.api.ChatService service = getInstance();
126: if (service == null)
127: return null;
128:
129: return service.addChannel(param0);
130: }
131:
132: public static boolean allowEditChannel(java.lang.String param0) {
133: org.sakaiproject.chat.api.ChatService service = getInstance();
134: if (service == null)
135: return false;
136:
137: return service.allowEditChannel(param0);
138: }
139:
140: public static org.sakaiproject.message.api.MessageChannelEdit editChannel(
141: java.lang.String param0)
142: throws org.sakaiproject.exception.IdUnusedException,
143: org.sakaiproject.exception.PermissionException,
144: org.sakaiproject.exception.InUseException {
145: org.sakaiproject.chat.api.ChatService service = getInstance();
146: if (service == null)
147: return null;
148:
149: return service.editChannel(param0);
150: }
151:
152: public static void commitChannel(
153: org.sakaiproject.message.api.MessageChannelEdit param0) {
154: org.sakaiproject.chat.api.ChatService service = getInstance();
155: if (service == null)
156: return;
157:
158: service.commitChannel(param0);
159: }
160:
161: public static void cancelChannel(
162: org.sakaiproject.message.api.MessageChannelEdit param0) {
163: org.sakaiproject.chat.api.ChatService service = getInstance();
164: if (service == null)
165: return;
166:
167: service.cancelChannel(param0);
168: }
169:
170: public static boolean allowRemoveChannel(java.lang.String param0) {
171: org.sakaiproject.chat.api.ChatService service = getInstance();
172: if (service == null)
173: return false;
174:
175: return service.allowRemoveChannel(param0);
176: }
177:
178: public static void removeChannel(
179: org.sakaiproject.message.api.MessageChannelEdit param0)
180: throws org.sakaiproject.exception.PermissionException {
181: org.sakaiproject.chat.api.ChatService service = getInstance();
182: if (service == null)
183: return;
184:
185: service.removeChannel(param0);
186: }
187:
188: public static java.lang.String channelReference(
189: java.lang.String param0, java.lang.String param1) {
190: org.sakaiproject.chat.api.ChatService service = getInstance();
191: if (service == null)
192: return null;
193:
194: return service.channelReference(param0, param1);
195: }
196:
197: public static java.lang.String messageReference(
198: java.lang.String param0, java.lang.String param1,
199: java.lang.String param2) {
200: org.sakaiproject.chat.api.ChatService service = getInstance();
201: if (service == null)
202: return null;
203:
204: return service.messageReference(param0, param1, param2);
205: }
206:
207: public static java.lang.String messageReference(
208: java.lang.String param0, java.lang.String param1) {
209: org.sakaiproject.chat.api.ChatService service = getInstance();
210: if (service == null)
211: return null;
212:
213: return service.messageReference(param0, param1);
214: }
215:
216: public static void cancelMessage(
217: org.sakaiproject.message.api.MessageEdit param0) {
218: org.sakaiproject.chat.api.ChatService service = getInstance();
219: if (service == null)
220: return;
221:
222: service.cancelMessage(param0);
223: }
224:
225: public static java.util.List getMessages(java.lang.String param0,
226: org.sakaiproject.time.api.Time param1, int param2,
227: boolean param3, boolean param4, boolean param5)
228: throws org.sakaiproject.exception.PermissionException {
229: org.sakaiproject.chat.api.ChatService service = getInstance();
230: if (service == null)
231: return null;
232:
233: return service.getMessages(param0, param1, param2, param3,
234: param4, param5);
235: }
236:
237: public static java.util.List getChannelIds(java.lang.String param0) {
238: org.sakaiproject.chat.api.ChatService service = getInstance();
239: if (service == null)
240: return null;
241:
242: return service.getChannelIds(param0);
243: }
244:
245: public static org.sakaiproject.message.api.Message getMessage(
246: org.sakaiproject.entity.api.Reference param0)
247: throws org.sakaiproject.exception.IdUnusedException,
248: org.sakaiproject.exception.PermissionException {
249: org.sakaiproject.chat.api.ChatService service = getInstance();
250: if (service == null)
251: return null;
252:
253: return service.getMessage(param0);
254: }
255:
256: public static org.sakaiproject.message.api.MessageChannel getChannel(
257: java.lang.String param0)
258: throws org.sakaiproject.exception.IdUnusedException,
259: org.sakaiproject.exception.PermissionException {
260: org.sakaiproject.chat.api.ChatService service = getInstance();
261: if (service == null)
262: return null;
263:
264: return service.getChannel(param0);
265: }
266:
267: public static java.lang.String merge(java.lang.String param0,
268: org.w3c.dom.Element param1, java.lang.String param2,
269: java.lang.String param3, java.util.Map param4,
270: java.util.HashMap param5, java.util.Set param6) {
271: org.sakaiproject.chat.api.ChatService service = getInstance();
272: if (service == null)
273: return null;
274:
275: return service.merge(param0, param1, param2, param3, param4,
276: param5, param6);
277: }
278:
279: public static java.lang.String getLabel() {
280: org.sakaiproject.chat.api.ChatService service = getInstance();
281: if (service == null)
282: return null;
283:
284: return service.getLabel();
285: }
286:
287: public static java.lang.String archive(java.lang.String param0,
288: org.w3c.dom.Document param1, java.util.Stack param2,
289: java.lang.String param3, java.util.List param4) {
290: org.sakaiproject.chat.api.ChatService service = getInstance();
291: if (service == null)
292: return null;
293:
294: return service.archive(param0, param1, param2, param3, param4);
295: }
296:
297: public static java.util.Map getSummary(java.lang.String param0,
298: int param1, int param2)
299: throws org.sakaiproject.exception.IdUsedException,
300: org.sakaiproject.exception.IdInvalidException,
301: org.sakaiproject.exception.PermissionException {
302: org.sakaiproject.chat.api.ChatService service = getInstance();
303: if (service == null)
304: return null;
305:
306: return service.getSummary(param0, param1, param2);
307: }
308: }
|