001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/event/tags/sakai_2-4-1/event-api/api/src/java/org/sakaiproject/event/cover/UsageSessionService.java $
003: * $Id: UsageSessionService.java 15113 2006-09-21 19:11:42Z 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: * UsageSessionService is a static Cover for the {@link org.sakaiproject.event.api.UsageSessionService UsageSessionService}; see that interface for usage details.
027: * </p>
028: */
029: public class UsageSessionService {
030: /**
031: * Access the component instance: special cover only method.
032: *
033: * @return the component instance.
034: */
035: public static org.sakaiproject.event.api.UsageSessionService getInstance() {
036: if (ComponentManager.CACHE_COMPONENTS) {
037: if (m_instance == null)
038: m_instance = (org.sakaiproject.event.api.UsageSessionService) ComponentManager
039: .get(org.sakaiproject.event.api.UsageSessionService.class);
040: return m_instance;
041: } else {
042: return (org.sakaiproject.event.api.UsageSessionService) ComponentManager
043: .get(org.sakaiproject.event.api.UsageSessionService.class);
044: }
045: }
046:
047: private static org.sakaiproject.event.api.UsageSessionService m_instance = null;
048:
049: public static java.lang.String EVENT_LOGIN = org.sakaiproject.event.api.UsageSessionService.EVENT_LOGIN;
050:
051: public static java.lang.String EVENT_LOGOUT = org.sakaiproject.event.api.UsageSessionService.EVENT_LOGOUT;
052:
053: public static java.lang.String SAKAI_SESSION_COOKIE = org.sakaiproject.event.api.UsageSessionService.SAKAI_SESSION_COOKIE;
054:
055: public static java.lang.String USAGE_SESSION_KEY = org.sakaiproject.event.api.UsageSessionService.USAGE_SESSION_KEY;
056:
057: public static org.sakaiproject.event.api.UsageSession startSession(
058: java.lang.String param0, java.lang.String param1,
059: java.lang.String param2) {
060: org.sakaiproject.event.api.UsageSessionService service = getInstance();
061: if (service == null)
062: return null;
063:
064: return service.startSession(param0, param1, param2);
065: }
066:
067: public static org.sakaiproject.event.api.UsageSession getSession(
068: java.lang.String param0) {
069: org.sakaiproject.event.api.UsageSessionService service = getInstance();
070: if (service == null)
071: return null;
072:
073: return service.getSession(param0);
074: }
075:
076: public static org.sakaiproject.event.api.UsageSession getSession() {
077: org.sakaiproject.event.api.UsageSessionService service = getInstance();
078: if (service == null)
079: return null;
080:
081: return service.getSession();
082: }
083:
084: public static java.lang.String getSessionId() {
085: org.sakaiproject.event.api.UsageSessionService service = getInstance();
086: if (service == null)
087: return null;
088:
089: return service.getSessionId();
090: }
091:
092: public static org.sakaiproject.event.api.SessionState getSessionState(
093: java.lang.String param0) {
094: org.sakaiproject.event.api.UsageSessionService service = getInstance();
095: if (service == null)
096: return null;
097:
098: return service.getSessionState(param0);
099: }
100:
101: public static org.sakaiproject.event.api.UsageSession setSessionActive(
102: boolean param0) {
103: org.sakaiproject.event.api.UsageSessionService service = getInstance();
104: if (service == null)
105: return null;
106:
107: return service.setSessionActive(param0);
108: }
109:
110: public static java.util.List getSessions(
111: java.lang.String joinTable, java.lang.String joinAlias,
112: java.lang.String joinColumn, java.lang.String joinCriteria,
113: java.lang.Object[] values) {
114: org.sakaiproject.event.api.UsageSessionService service = getInstance();
115: if (service == null)
116: return null;
117:
118: return service.getSessions(joinTable, joinAlias, joinColumn,
119: joinCriteria, values);
120: }
121:
122: public static java.util.List getSessions(java.util.List param0) {
123: org.sakaiproject.event.api.UsageSessionService service = getInstance();
124: if (service == null)
125: return null;
126:
127: return service.getSessions(param0);
128: }
129:
130: public static int getSessionInactiveTimeout() {
131: org.sakaiproject.event.api.UsageSessionService service = getInstance();
132: if (service == null)
133: return 0;
134:
135: return service.getSessionInactiveTimeout();
136: }
137:
138: public static int getSessionLostTimeout() {
139: org.sakaiproject.event.api.UsageSessionService service = getInstance();
140: if (service == null)
141: return 0;
142:
143: return service.getSessionLostTimeout();
144: }
145:
146: public static java.util.List getOpenSessions() {
147: org.sakaiproject.event.api.UsageSessionService service = getInstance();
148: if (service == null)
149: return null;
150:
151: return service.getOpenSessions();
152: }
153:
154: public static java.util.Map getOpenSessionsByServer() {
155: org.sakaiproject.event.api.UsageSessionService service = getInstance();
156: if (service == null)
157: return null;
158:
159: return service.getOpenSessionsByServer();
160: }
161:
162: public static boolean login(
163: org.sakaiproject.user.api.Authentication param0,
164: javax.servlet.http.HttpServletRequest param1) {
165: org.sakaiproject.event.api.UsageSessionService service = getInstance();
166: if (service == null)
167: return false;
168:
169: return service.login(param0, param1);
170: }
171:
172: public static void logout() {
173: org.sakaiproject.event.api.UsageSessionService service = getInstance();
174: if (service == null)
175: return;
176:
177: service.logout();
178: }
179: }
|