001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/event/tags/sakai_2-4-1/event-api/api/src/java/org/sakaiproject/event/api/UsageSession.java $
003: * $Id: UsageSession.java 10598 2006-06-14 14:59:01Z 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.api;
021:
022: import org.sakaiproject.time.api.Time;
023:
024: /**
025: * <p>
026: * UsageSession models an end user's usage session.
027: * </p>
028: */
029: public interface UsageSession extends Comparable {
030: /** String constants for major browser types */
031: public static final String MAC_IE = "Mac-InternetExplorer";
032:
033: public static final String MAC_NN = "Mac-NetscapeNavigator";
034:
035: public static final String MAC_CM = "Mac-Camino";
036:
037: public static final String MAC_SF = "Mac-Safari";
038:
039: public static final String MAC_MZ = "Mac-Mozilla";
040:
041: public static final String WIN_IE = "Win-InternetExplorer";
042:
043: public static final String WIN_NN = "Win-NetscapeNavigator";
044:
045: public static final String WIN_MZ = "Win-Mozilla";
046:
047: public static final String UNKNOWN = "UnknownBrowser";
048:
049: /**
050: * Access the unique id for this session.
051: *
052: * @return the unique id for this session.
053: */
054: String getId();
055:
056: /**
057: * Access the server id which is hosting this session.
058: *
059: * @return the server id which is hosting this session.
060: */
061: String getServer();
062:
063: /**
064: * Access the user id for this session.
065: *
066: * @return the user id for this session.
067: */
068: String getUserId();
069:
070: /**
071: * Access the user eid for this session, if known - fallback to the id if not.
072: *
073: * @return The user eid for this session, or the use id if the eid cannot be found.
074: */
075: String getUserEid();
076:
077: /**
078: * Access the user display id for this session, if known - fallback to the id if not.
079: *
080: * @return The user display id for this session, or the use id if the user cannot be found.
081: */
082: String getUserDisplayId();
083:
084: /**
085: * Access the IP Address from which this session originated.
086: *
087: * @return the IP Address from which this session originated.
088: */
089: String getIpAddress();
090:
091: /**
092: * Access the User Agent string describing the browser used in this session.
093: *
094: * @return the User Agent string describing the browser used in this session.
095: */
096: String getUserAgent();
097:
098: /**
099: * Access a short string describing the class of browser used in this session.
100: *
101: * @return the short ID describing the browser used in this session.
102: */
103: String getBrowserId();
104:
105: /**
106: * Is this session closed?
107: *
108: * @return true if the session is closed, false if open.
109: */
110: boolean isClosed();
111:
112: /**
113: * Access the start time of the session
114: *
115: * @return The time the session started.
116: */
117: Time getStart();
118:
119: /**
120: * Access the end time of the session.
121: *
122: * @return The time the session ended. If still going, this will .equals() the getStart() value.
123: */
124: Time getEnd();
125: }
|