org.sakaiproject.component.adaptor
Class UsageSessionServiceAdaptor.ClusterStorage

java.lang.Object
  extended byorg.sakaiproject.component.adaptor.UsageSessionServiceAdaptor.ClusterStorage
All Implemented Interfaces:
UsageSessionServiceAdaptor.Storage
Enclosing class:
UsageSessionServiceAdaptor

protected class UsageSessionServiceAdaptor.ClusterStorage
extends Object
implements UsageSessionServiceAdaptor.Storage

Storage component


Constructor Summary
protected UsageSessionServiceAdaptor.ClusterStorage()
           
 
Method Summary
 boolean addSession(UsageSession session)
          Take this session into storage.
 void close()
          Close.
 void closeSession(UsageSession session)
          This session is now closed.
 List getOpenSessions()
          Access a list of all open sessions.
 UsageSession getSession(String id)
          Access a session by id
 List getSessions(List ids)
          Access a bunch of sessions by the List id session ids.
 List getSessions(String criteria, Object[] values)
          Access a List of usage sessions by *arbitrary criteria*.
 void open()
          Open and be ready to read / write.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsageSessionServiceAdaptor.ClusterStorage

protected UsageSessionServiceAdaptor.ClusterStorage()
Method Detail

open

public void open()
Open and be ready to read / write.

Specified by:
open in interface UsageSessionServiceAdaptor.Storage

close

public void close()
Close.

Specified by:
close in interface UsageSessionServiceAdaptor.Storage

addSession

public boolean addSession(UsageSession session)
Take this session into storage.

Specified by:
addSession in interface UsageSessionServiceAdaptor.Storage
Parameters:
session - The usage session.
Returns:
true if added successfully, false if not.

getSession

public UsageSession getSession(String id)
Access a session by id

Specified by:
getSession in interface UsageSessionServiceAdaptor.Storage
Parameters:
id - The session id.
Returns:
The session object.

getSessions

public List getSessions(List ids)
Description copied from interface: UsageSessionServiceAdaptor.Storage
Access a bunch of sessions by the List id session ids.

Specified by:
getSessions in interface UsageSessionServiceAdaptor.Storage
Parameters:
ids - The session id List.
Returns:
The List (UsageSession) of session objects for these ids.

getSessions

public List getSessions(String criteria,
                        Object[] values)
Access a List of usage sessions by *arbitrary criteria*.

Specified by:
getSessions in interface UsageSessionServiceAdaptor.Storage
Parameters:
criteria - A string with meaning known to the particular implementation of the API running.
Returns:
The List (UsageSession) of UsageSession object for these ids.

closeSession

public void closeSession(UsageSession session)
This session is now closed.

Specified by:
closeSession in interface UsageSessionServiceAdaptor.Storage
Parameters:
session - The session which is closed.

getOpenSessions

public List getOpenSessions()
Access a list of all open sessions.

Specified by:
getOpenSessions in interface UsageSessionServiceAdaptor.Storage
Returns:
a List (UsageSession) of all open sessions, ordered by server, then by start (asc)