ibspan.tss.agents.sha.history
Class HistoryLogger

java.lang.Object
  extended by ibspan.tss.agents.sha.history.HistoryLogger

public class HistoryLogger
extends Object

Logs user requests, which occurs during session, in persistent store by using given DAO for History model. Additionally, NewEventHandler object, passed as argument in costructor, is informed about each new user request.

Remember. Term of session used here is not exactly the same as the one used in context of action dispatching. Here a session means interaction with authorized (logged in user), in which each act of the user is logged in persistent store.

HistoryLogger must be initialized by calling registerLoggableAction() method before use.

Author:
Maciej Gawinecki
See Also:
ActionDispatcherWithSessionTracking, NewEventHandler

Constructor Summary
HistoryLogger(HistoryDAO daoHistory, NewEventHandler handler)
          Constructs HistoryLogger.
 
Method Summary
 void logUserRequest(UserRequest request)
          Logs given request in persistent store.
 void registerLoggableAction(String actionName, UserBehaviour behaviour)
          Registers actions which will be logged in History model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistoryLogger

public HistoryLogger(HistoryDAO daoHistory,
                     NewEventHandler handler)
Constructs HistoryLogger.

Parameters:
daoHistory - is DAO interface for History model with logged events.
handler - is handler which additionally will be informed about each new event; if null, then no such handling will be performed.
Method Detail

registerLoggableAction

public void registerLoggableAction(String actionName,
                                   UserBehaviour behaviour)
Registers actions which will be logged in History model.

Parameters:
actionName - is a name of an action resolved by ActionDispatcherWithSessionTracking.
behaviour - is the name of behaviour (usually from user modelling ontology) under which user action will be remembered.
See Also:
ActionDispatcherWithSessionTracking

logUserRequest

public void logUserRequest(UserRequest request)
Logs given request in persistent store. More precisely translates request into Event object, put it into persitent store NewEventHandler object about this event.

Parameters:
request - is a user request to be logged in.