org.sakaiproject.component.adaptor
Class UsageSessionServiceAdaptor.BaseUsageSession

java.lang.Object
  extended byorg.sakaiproject.component.adaptor.UsageSessionServiceAdaptor.BaseUsageSession
All Implemented Interfaces:
Comparable, EventListener, SessionBindingListener, UsageSession
Enclosing class:
UsageSessionServiceAdaptor

protected class UsageSessionServiceAdaptor.BaseUsageSession
extends Object
implements UsageSession, SessionBindingListener

UsageSession


Field Summary
protected  String m_browserId
          The BrowserID string describing the browser used in this session.
protected  Time m_end
          The time the session was closed.
protected  String m_id
          The unique id for this session.
protected  String m_ip
          The IP Address from which this session originated.
protected  String m_server
          The server which is hosting the session.
protected  Time m_start
          The time the session was started
protected  String m_user
          The user id for this session.
protected  String m_userAgent
          The User Agent string describing the browser used in this session.
 
Fields inherited from interface org.sakaiproject.service.framework.session.UsageSession
MAC_CM, MAC_IE, MAC_MZ, MAC_NN, MAC_SF, UNKNOWN, WIN_IE, WIN_MZ, WIN_NN
 
Constructor Summary
UsageSessionServiceAdaptor.BaseUsageSession(String id, String server, String user, String address, String agent, Time start, Time end)
          Construct fully.
 
Method Summary
protected  void close()
          Close the session.
 int compareTo(Object obj)
           
 String getBrowserId()
          Access a short string describing the class of browser used in this session.
 Time getEnd()
          Access the end time of the session.
 String getId()
          Access the unique id for this session.
 String getIpAddress()
          Access the IP Address from which this session originated.
 String getServer()
          Access the server id which is hosting this session.
 Time getStart()
          Access the start time of the session
 String getUserAgent()
          Access the User Agent string describing the browser used in this session.
 String getUserId()
          Access the user object for this session.
 boolean isClosed()
          Is this session closed?
protected  boolean isInactive()
          Has this session gone inactive?
protected  void setActivity()
          There's new user activity now.
protected  void setBrowserId(String agent)
          Set the browser id for this session, decoded from the user agent string.
 String toString()
           
 void valueBound(SessionBindingEvent sbe)
          Notifies the object that it is being bound to a session.
 void valueUnbound(SessionBindingEvent sbe)
          Notifies the object that it is being unbound from a session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_user

protected String m_user
The user id for this session.


m_id

protected String m_id
The unique id for this session.


m_server

protected String m_server
The server which is hosting the session.


m_ip

protected String m_ip
The IP Address from which this session originated.


m_userAgent

protected String m_userAgent
The User Agent string describing the browser used in this session.


m_browserId

protected String m_browserId
The BrowserID string describing the browser used in this session.


m_start

protected Time m_start
The time the session was started


m_end

protected Time m_end
The time the session was closed.

Constructor Detail

UsageSessionServiceAdaptor.BaseUsageSession

public UsageSessionServiceAdaptor.BaseUsageSession(String id,
                                                   String server,
                                                   String user,
                                                   String address,
                                                   String agent,
                                                   Time start,
                                                   Time end)
Construct fully.

Parameters:
id - The session id.
server - The server id which is hosting the session.
user - The user id for this session.
address - The IP Address from which this session originated.
agent - The User Agent string describing the browser used in this session.
Method Detail

setBrowserId

protected void setBrowserId(String agent)
Set the browser id for this session, decoded from the user agent string.

Parameters:
agent - The user agent string.

close

protected void close()
Close the session.


isClosed

public boolean isClosed()
Description copied from interface: UsageSession
Is this session closed?

Specified by:
isClosed in interface UsageSession
Returns:
true if the session is closed, false if open.

getUserId

public String getUserId()
Description copied from interface: UsageSession
Access the user object for this session.

Specified by:
getUserId in interface UsageSession
Returns:
the user object for this session.

getId

public String getId()
Description copied from interface: UsageSession
Access the unique id for this session.

Specified by:
getId in interface UsageSession
Returns:
the unique id for this session.

getServer

public String getServer()
Description copied from interface: UsageSession
Access the server id which is hosting this session.

Specified by:
getServer in interface UsageSession
Returns:
the server id which is hosting this session.

getIpAddress

public String getIpAddress()
Description copied from interface: UsageSession
Access the IP Address from which this session originated.

Specified by:
getIpAddress in interface UsageSession
Returns:
the IP Address from which this session originated.

getUserAgent

public String getUserAgent()
Description copied from interface: UsageSession
Access the User Agent string describing the browser used in this session.

Specified by:
getUserAgent in interface UsageSession
Returns:
the User Agent string describing the browser used in this session.

getBrowserId

public String getBrowserId()
Description copied from interface: UsageSession
Access a short string describing the class of browser used in this session.

Specified by:
getBrowserId in interface UsageSession
Returns:
the short ID describing the browser used in this session.

getStart

public Time getStart()
Description copied from interface: UsageSession
Access the start time of the session

Specified by:
getStart in interface UsageSession
Returns:
The time the session started.

getEnd

public Time getEnd()
Description copied from interface: UsageSession
Access the end time of the session.

Specified by:
getEnd in interface UsageSession
Returns:
The time the session ended. If still going, this will .equals() the getStart() value.

setActivity

protected void setActivity()
There's new user activity now.


isInactive

protected boolean isInactive()
Has this session gone inactive?

Returns:
True if the session has seen no activity in the last timeout period, false if it's still active.

valueBound

public void valueBound(SessionBindingEvent sbe)
Description copied from interface: SessionBindingListener
Notifies the object that it is being bound to a session.

Specified by:
valueBound in interface SessionBindingListener
Parameters:
sbe - the event that identifies the session

valueUnbound

public void valueUnbound(SessionBindingEvent sbe)
Description copied from interface: SessionBindingListener
Notifies the object that it is being unbound from a session.

Specified by:
valueUnbound in interface SessionBindingListener
Parameters:
sbe - the event that identifies the session

compareTo

public int compareTo(Object obj)
Specified by:
compareTo in interface Comparable

toString

public String toString()