001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/event/tags/sakai_2-4-1/event-api/api/src/java/org/sakaiproject/event/cover/EventTrackingService.java $
003: * $Id: EventTrackingService.java 7036 2006-03-27 00:31:07Z 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.event.cover;
021:
022: import org.sakaiproject.component.cover.ComponentManager;
023:
024: /**
025: * <p>
026: * EventTrackingService is a static Cover for the {@link org.sakaiproject.event.api.EventTrackingService EventTrackingService}; see that interface for usage details.
027: * </p>
028: */
029: public class EventTrackingService {
030: /**
031: * Access the component instance: special cover only method.
032: *
033: * @return the component instance.
034: */
035: public static org.sakaiproject.event.api.EventTrackingService getInstance() {
036: if (ComponentManager.CACHE_COMPONENTS) {
037: if (m_instance == null)
038: m_instance = (org.sakaiproject.event.api.EventTrackingService) ComponentManager
039: .get(org.sakaiproject.event.api.EventTrackingService.class);
040: return m_instance;
041: } else {
042: return (org.sakaiproject.event.api.EventTrackingService) ComponentManager
043: .get(org.sakaiproject.event.api.EventTrackingService.class);
044: }
045: }
046:
047: private static org.sakaiproject.event.api.EventTrackingService m_instance = null;
048:
049: public static java.lang.String SERVICE_NAME = org.sakaiproject.event.api.EventTrackingService.SERVICE_NAME;
050:
051: public static void addPriorityObserver(java.util.Observer param0) {
052: org.sakaiproject.event.api.EventTrackingService service = getInstance();
053: if (service == null)
054: return;
055:
056: service.addPriorityObserver(param0);
057: }
058:
059: public static void addLocalObserver(java.util.Observer param0) {
060: org.sakaiproject.event.api.EventTrackingService service = getInstance();
061: if (service == null)
062: return;
063:
064: service.addLocalObserver(param0);
065: }
066:
067: public static org.sakaiproject.event.api.Event newEvent(
068: java.lang.String param0, java.lang.String param1,
069: boolean param2) {
070: org.sakaiproject.event.api.EventTrackingService service = getInstance();
071: if (service == null)
072: return null;
073:
074: return service.newEvent(param0, param1, param2);
075: }
076:
077: public static org.sakaiproject.event.api.Event newEvent(
078: java.lang.String param0, java.lang.String param1,
079: boolean param2, int param3) {
080: org.sakaiproject.event.api.EventTrackingService service = getInstance();
081: if (service == null)
082: return null;
083:
084: return service.newEvent(param0, param1, param2, param3);
085: }
086:
087: public static void addObserver(java.util.Observer param0) {
088: org.sakaiproject.event.api.EventTrackingService service = getInstance();
089: if (service == null)
090: return;
091:
092: service.addObserver(param0);
093: }
094:
095: public static void deleteObserver(java.util.Observer param0) {
096: org.sakaiproject.event.api.EventTrackingService service = getInstance();
097: if (service == null)
098: return;
099:
100: service.deleteObserver(param0);
101: }
102:
103: public static void post(org.sakaiproject.event.api.Event param0,
104: org.sakaiproject.event.api.UsageSession param1) {
105: org.sakaiproject.event.api.EventTrackingService service = getInstance();
106: if (service == null)
107: return;
108:
109: service.post(param0, param1);
110: }
111:
112: public static void post(org.sakaiproject.event.api.Event param0) {
113: org.sakaiproject.event.api.EventTrackingService service = getInstance();
114: if (service == null)
115: return;
116:
117: service.post(param0);
118: }
119: }
|