org.jasig.portal.services
Class StatsRecorder

java.lang.Object
  extended by org.jasig.portal.services.StatsRecorder

public final class StatsRecorder
extends java.lang.Object

Static cover for the primary instance of IStatsRecorder. This class makes the primary instance of IStatsRecorder defined as a Spring bean named "statsRecorder" available via static lookup. Various parts of the portal call the static methods in this service to record events such as when a user logs in, logs out, and subscribes to a channel. We forward those method calls to the configured instance of IStatsRecorder. Object instances configured via Spring and therefore ammenable to Dependency Injection can and probably should receive their IStatsRecorded instance via injection rather than statically accessing this class.

Version:
$Revision: 1.20.2.1 $ $Date: 2005/07/15 21:39:21 $
Author:
Ken Weiner, kweiner@unicon.net

Field Summary
static java.lang.String BACKING_BEAN_NAME
          The name of the Spring-configured IStatsRecorder instance to which we expect to delegate.
private static org.apache.commons.logging.Log log
           
private static IStatsRecorder STATS_RECORDER
           
 
Constructor Summary
private StatsRecorder()
           
 
Method Summary
static boolean get(int setting)
          Deprecated. since uPortal 2.5.1, recorder settings are no longer global
static StatsRecorderLayoutEventListener newLayoutEventListener(IPerson person, UserProfile profile)
          Creates an instance of a StatsRecorderLayoutEventListener.
static void recordChannelAddedToLayout(IPerson person, UserProfile profile, IUserLayoutChannelDescription channelDesc)
          Record that a channel is being added to a user layout
static void recordChannelDefinitionModified(IPerson person, ChannelDefinition channelDef)
          Record that an existing channel is being modified
static void recordChannelDefinitionPublished(IPerson person, ChannelDefinition channelDef)
          Record that a new channel is being published
static void recordChannelDefinitionRemoved(IPerson person, ChannelDefinition channelDef)
          Record that a channel is being removed
static void recordChannelInstantiated(IPerson person, UserProfile profile, IUserLayoutChannelDescription channelDesc)
          Record that a channel is being instantiated
static void recordChannelMovedInLayout(IPerson person, UserProfile profile, IUserLayoutChannelDescription channelDesc)
          Record that a channel is being moved in a user layout
static void recordChannelRemovedFromLayout(IPerson person, UserProfile profile, IUserLayoutChannelDescription channelDesc)
          Record that a channel is being removed from a user layout
static void recordChannelRendered(IPerson person, UserProfile profile, IUserLayoutChannelDescription channelDesc)
          Record that a channel is being rendered
static void recordChannelTargeted(IPerson person, UserProfile profile, IUserLayoutChannelDescription channelDesc)
          Record that a channel is being targeted.
static void recordChannelUpdatedInLayout(IPerson person, UserProfile profile, IUserLayoutChannelDescription channelDesc)
          Record that a channel is being updated in a user layout
static void recordFolderAddedToLayout(IPerson person, UserProfile profile, IUserLayoutFolderDescription folderDesc)
          Record that a folder is being added to a user layout
static void recordFolderMovedInLayout(IPerson person, UserProfile profile, IUserLayoutFolderDescription folderDesc)
          Record that a folder is being moved in a user layout
static void recordFolderRemovedFromLayout(IPerson person, UserProfile profile, IUserLayoutFolderDescription folderDesc)
          Record that a folder is being removed from a user layout
static void recordFolderUpdatedInLayout(IPerson person, UserProfile profile, IUserLayoutFolderDescription folderDesc)
          Record that a folder is being updated in a user layout
static void recordLogin(IPerson person)
          Record the successful login of a user.
static void recordLogout(IPerson person)
          Record the logout of a user.
static void recordSessionCreated(IPerson person)
          Record that a new session is created for a user.
static void recordSessionDestroyed(IPerson person)
          Record that a user's session is destroyed (when the user logs out or his/her session simply times out)
static void set(int setting, boolean newValue)
          Deprecated. since uPortal 2.5.1, recorder settings are no longer necessarily global
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BACKING_BEAN_NAME

public static final java.lang.String BACKING_BEAN_NAME
The name of the Spring-configured IStatsRecorder instance to which we expect to delegate.

See Also:
Constant Field Values

log

private static final org.apache.commons.logging.Log log

STATS_RECORDER

private static IStatsRecorder STATS_RECORDER
Constructor Detail

StatsRecorder

private StatsRecorder()
Method Detail

newLayoutEventListener

public static final StatsRecorderLayoutEventListener newLayoutEventListener(IPerson person,
                                                                            UserProfile profile)
Creates an instance of a StatsRecorderLayoutEventListener. There is currently no difference between calling this method and using the StatsRecorderLayoutEventListener constructor directly.

Returns:
a new stats recorder layout event listener instance

recordLogin

public static void recordLogin(IPerson person)
Record the successful login of a user.

Parameters:
person - the person who is logging in

recordLogout

public static void recordLogout(IPerson person)
Record the logout of a user.

Parameters:
person - the person who is logging out

recordSessionCreated

public static void recordSessionCreated(IPerson person)
Record that a new session is created for a user.

Parameters:
person - the person whose session is being created

recordSessionDestroyed

public static void recordSessionDestroyed(IPerson person)
Record that a user's session is destroyed (when the user logs out or his/her session simply times out)

Parameters:
person - the person whose session is ending

recordChannelDefinitionPublished

public static void recordChannelDefinitionPublished(IPerson person,
                                                    ChannelDefinition channelDef)
Record that a new channel is being published

Parameters:
person - the person publishing the channel
channelDef - the channel being published

recordChannelDefinitionModified

public static void recordChannelDefinitionModified(IPerson person,
                                                   ChannelDefinition channelDef)
Record that an existing channel is being modified

Parameters:
person - the person modifying the channel
channelDef - the channel being modified

recordChannelDefinitionRemoved

public static void recordChannelDefinitionRemoved(IPerson person,
                                                  ChannelDefinition channelDef)
Record that a channel is being removed

Parameters:
person - the person removing the channel
channelDef - the channel being modified

recordChannelAddedToLayout

public static void recordChannelAddedToLayout(IPerson person,
                                              UserProfile profile,
                                              IUserLayoutChannelDescription channelDesc)
Record that a channel is being added to a user layout

Parameters:
person - the person adding the channel
profile - the profile of the layout to which the channel is being added
channelDesc - the channel being subscribed to

recordChannelUpdatedInLayout

public static void recordChannelUpdatedInLayout(IPerson person,
                                                UserProfile profile,
                                                IUserLayoutChannelDescription channelDesc)
Record that a channel is being updated in a user layout

Parameters:
person - the person updating the channel
profile - the profile of the layout in which the channel is being updated
channelDesc - the channel being updated

recordChannelMovedInLayout

public static void recordChannelMovedInLayout(IPerson person,
                                              UserProfile profile,
                                              IUserLayoutChannelDescription channelDesc)
Record that a channel is being moved in a user layout

Parameters:
person - the person moving the channel
profile - the profile of the layout in which the channel is being moved
channelDesc - the channel being moved

recordChannelRemovedFromLayout

public static void recordChannelRemovedFromLayout(IPerson person,
                                                  UserProfile profile,
                                                  IUserLayoutChannelDescription channelDesc)
Record that a channel is being removed from a user layout

Parameters:
person - the person removing the channel
profile - the profile of the layout to which the channel is being added
channelDesc - the channel being removed from a user layout

recordFolderAddedToLayout

public static void recordFolderAddedToLayout(IPerson person,
                                             UserProfile profile,
                                             IUserLayoutFolderDescription folderDesc)
Record that a folder is being added to a user layout

Parameters:
person - the person adding the folder
profile - the profile of the layout to which the folder is being added
folderDesc - the folder being subscribed to

recordFolderUpdatedInLayout

public static void recordFolderUpdatedInLayout(IPerson person,
                                               UserProfile profile,
                                               IUserLayoutFolderDescription folderDesc)
Record that a folder is being updated in a user layout

Parameters:
person - the person updating the folder
profile - the profile of the layout in which the folder is being updated
folderDesc - the folder being updated

recordFolderMovedInLayout

public static void recordFolderMovedInLayout(IPerson person,
                                             UserProfile profile,
                                             IUserLayoutFolderDescription folderDesc)
Record that a folder is being moved in a user layout

Parameters:
person - the person moving the folder
profile - the profile of the layout in which the folder is being moved
folderDesc - the folder being moved

recordFolderRemovedFromLayout

public static void recordFolderRemovedFromLayout(IPerson person,
                                                 UserProfile profile,
                                                 IUserLayoutFolderDescription folderDesc)
Record that a folder is being removed from a user layout

Parameters:
person - the person removing the folder
profile - the profile of the layout to which the folder is being added
folderDesc - the folder being removed from a user layout

recordChannelInstantiated

public static void recordChannelInstantiated(IPerson person,
                                             UserProfile profile,
                                             IUserLayoutChannelDescription channelDesc)
Record that a channel is being instantiated

Parameters:
person - the person for whom the channel is instantiated
profile - the profile of the layout for whom the channel is instantiated
channelDesc - the channel being instantiated

recordChannelRendered

public static void recordChannelRendered(IPerson person,
                                         UserProfile profile,
                                         IUserLayoutChannelDescription channelDesc)
Record that a channel is being rendered

Parameters:
person - the person for whom the channel is rendered
profile - the profile of the layout for whom the channel is rendered
channelDesc - the channel being rendered

recordChannelTargeted

public static void recordChannelTargeted(IPerson person,
                                         UserProfile profile,
                                         IUserLayoutChannelDescription channelDesc)
Record that a channel is being targeted. In other words, the user is interacting with the channel via either a hyperlink or form submission.

Parameters:
person - the person interacting with the channel
profile - the profile of the layout in which the channel resides
channelDesc - the channel being targeted

get

public static boolean get(int setting)
Deprecated. since uPortal 2.5.1, recorder settings are no longer global

This method is deprecated. Stats recorder settings are no longer necessarily global. This method (continues to) access information about only one particular way in which StatsRecorder can be configured, that of portal.properties entries specifying booleans about which kinds of statistics should be recorded, fronting the StatsRecorderSettings static singleton. Instead of using the Static Singleton (anti-)pattern, you can instead wire together and configure your IStatsRecorder as a Spring-managed bean named "statsRecorder" and there apply, in a strongly typed and more flexible way, your desired statistics recording configuration. Specifically, the ConditionalStatsRecorder wrapper now provides a JavaBean-properties approach to querying the settings that were previously accessible via this method. Note that since StatsRecorderSettings is a Static Singleton, this implementation of this method continues to do what the 2.5.0 implementation did. The change since 2.5.0 is that StatsRecorderSettings is no longer necessarily controlling of StatsRecorder behavior. Gets the value of a particular stats recorder from StatsRecorderSettings. Possible settings are available from StatsRecorderSettings. For example: StatsRecorder.get(StatsRecorderSettings.RECORD_LOGIN)

Parameters:
setting - the setting
Returns:
the value for the setting

set

public static void set(int setting,
                       boolean newValue)
Deprecated. since uPortal 2.5.1, recorder settings are no longer necessarily global

This method is deprecated. Stats recorder settings are no longer necessarily global. This method (continues to) provide a very thin layer in front of just one particular way in which StatsRecorder can be configured, that of portal.poperties specifying booleans about which kinds of statistics should be recorded, fronting the StatsRecorderSettings static singleton. Instead of using the Static Singleton (anti-)patterh, you can instead wire together and configure your IStatsRecorder as a Spring-managed bean named "statsRecorder" and there apply, in a strongly typed and more flexible way, your desired statistics recording configuration. Specifically, the ConditionalStatsRecorder wrapper now provides a JavaBean-properties approach to configuring the stats recorder even filtering that was previously configurable via this method. Note that since StatsRecorderSettings is a Static Singleton, this implementation of this method continues to do what the 2.5.0 implementation did. The change since 2.5.-0 is that StatsRecorderSettings is no longer necessarily controlling of StatsRecorderBehavior. CALLING THIS METHOD MAY HAVE NO EFFECT ON StatsRecorder BEHAVIOR. This method will only have effect if the IStatsRecorder implementation is actually using StatsRecorderSettings. Sets the value of a particular stats recorder setting. Possible settings are available from StatsRecorderSettings. For example: StatsRecorder.set(StatsRecorderSettings.RECORD_LOGIN, true)

Parameters:
setting - the setting to change
newValue - the new value for the setting