|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.olat.core.logging.activity.UserActivityLoggerImpl
public class UserActivityLoggerImpl
Default implementation of the IUserActivityLogger which logs into the o_loggingtable.
This class would usually not be subclassed or changed as it closely works together with the ThreadLocalUserActivityLogger.
Also, this class should not have to be accessed directly or cast to in any way.
There is an instance of UserActivityLoggerImpl for every Controller and for every ThreadLocalUserActivityLogger during its run methods.
The UserActivityLoggerImpl gathers all information during the course of time to be ready for the log() call later - i.e. to have all mandatory information at that time. This includes such things as session/identity, the businessPath and the list of LoggingResourceables.
Also, this class implements the simpleDuration calculation - which is a simple time difference between log calls within a session. Note that this is really simple, as it does not distinguish between having multiple log calls per click and having no log calls for a number of clicks - hence the simpleDuration can only be useful to some extend. The plan is to introduce a semanticDuration or some other concept later. Anyway, for the simpleDuration the UserActivityLoggerImpl stores the last LoggingObject (the actual hibernate object) into the session for comparison later.
Initial Date: 21.10.2009
| Field Summary | |
|---|---|
static java.lang.String |
USESS_KEY_USER_ACTIVITY_LOGGING_LAST_LOG
the key with which the last LoggingObject is stored in the session - used for simpleDuration calculation only |
| Method Summary | |
|---|---|
void |
addLoggingResourceInfo(ILoggingResourceable loggingResourceable)
Adds the given LoggingResourceable - which can be thought of as a simple wrapper around say an ICourse, a Node or in other cases just a String - to this IUserActivityLogger permanently. |
void |
frameworkSetBCContextEntries(java.util.List<ContextEntry> bcEntries)
INTERNAL FRAMEWORK METHOD! |
void |
frameworkSetBusinessPath(java.lang.String businessPath)
INTERNAL FRAMEWORK METHOD! |
void |
frameworkSetBusinessPathFromWindowControl(WindowControl wControl)
INTERNAL FRAMEWORK METHOD! |
void |
frameworkSetSession(UserSession session)
INTERNAL FRAMEWORK METHOD! |
ActionType |
getStickyActionType()
Gets 'sticky' ActionType of this IUserActivityLogger - or null if none is set |
void |
log(ILoggingAction loggingAction,
java.lang.Class<?> callingClass,
ILoggingResourceable... lriOrNull)
Stores a new log entry with the available information to the logging table. |
static UserActivityLoggerImpl |
newLoggerForEventBus(Controller controller)
The special thing about this 'logger for EventBus' is, that it doesn't propagate resourceInfos/businessPath etc to the parent nor the ThreadLocalUserActivityLogger. |
static IUserActivityLogger |
newLoggerForValueUnbound(UserSession session)
Webcontainer thread for expired sessions triggers value unbound which in turn disposes the whole gui session. |
void |
setStickyActionType(ActionType actionType)
Sets the given ActionType 'sticky' to this IUserActivityLogger - i.e. |
static UserActivityLoggerImpl |
setupLoggerForController(WindowControl wControl)
This method is used by the DefaultController to setup a new logger based on what's currently set in the ThreadLocalUserActivityLogger. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String USESS_KEY_USER_ACTIVITY_LOGGING_LAST_LOG
| Method Detail |
|---|
public static UserActivityLoggerImpl setupLoggerForController(WindowControl wControl)
wControl - the WindowControl from which the businessPath and contextEntries are extracted
public static IUserActivityLogger newLoggerForValueUnbound(UserSession session)
public static UserActivityLoggerImpl newLoggerForEventBus(Controller controller)
controller - the Controller from which the IUserActivityLogger and the WindowControl (businessPath) should
be extracted
public void frameworkSetSession(UserSession session)
IUserActivityLoggerSets the session on this IUserActivityLogger directly.
Note that there are two ways the session is set on an IUserActivityLogger:
frameworkSetSession in interface IUserActivityLoggersession - the session which should be set on this IUserActivityLoggerpublic void addLoggingResourceInfo(ILoggingResourceable loggingResourceable)
IUserActivityLoggerThis should be used by Controller constructors while setting up the IUserActivityLogger.
Anything set on the Controller's IUserActivityLogger will later be available for logging during event/doDispose calls.
addLoggingResourceInfo in interface IUserActivityLoggerloggingResourceable - the LoggingResourceable which should be added
to this IUserActivityLoggerpublic void frameworkSetBusinessPath(java.lang.String businessPath)
IUserActivityLoggerSets the businesspath - as String - on this IUserActivityLogger.
This method is called in a few carefully selected places only.
You should usually not call this otherwise - if you have to consider checking with the other places to verify why you have to set it
frameworkSetBusinessPath in interface IUserActivityLoggerpublic void frameworkSetBCContextEntries(java.util.List<ContextEntry> bcEntries)
IUserActivityLoggerSets the business context entries on this IUserActivityLogger.
This method is called in a few carefully selected places only.
PS: The context entries are used to make safety checks to ensure the business path matches the ResourceableInfos. It is likely that this will become redundant (i.e. overkill) at some point and that we'll get rid of this
frameworkSetBCContextEntries in interface IUserActivityLoggerpublic void frameworkSetBusinessPathFromWindowControl(WindowControl wControl)
IUserActivityLoggerSets the businesspath - by retrieving it from the WindowControl - on this IUserActivityLogger.
This method is called in a few carefully selected places only.
You should usually not call this otherwise - if you have to consider checking with the other places to verify why you have to set it
frameworkSetBusinessPathFromWindowControl in interface IUserActivityLoggerpublic void setStickyActionType(ActionType actionType)
IUserActivityLogger
setStickyActionType in interface IUserActivityLoggeractionType - the sticky ActionType which should overwrite
whatever comes in the ILoggingAction in log()public ActionType getStickyActionType()
IUserActivityLogger
getStickyActionType in interface IUserActivityLogger
public void log(ILoggingAction loggingAction,
java.lang.Class<?> callingClass,
ILoggingResourceable... lriOrNull)
IUserActivityLoggerNote that the logged information is composed from the following:
log in interface IUserActivityLoggerloggingAction - the logging action which contains the log message to logcallingClass - the class which calls this log method - stored to the databaelriOrNull - zero or many LoggingResourceable objects - they
will be stored to the database (four of them - the outermost and the three innermost ones)for details on the database table
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||