com.jalios.jcms.stat.listener
Class AbstractStatFieldListener

java.lang.Object
  extended by com.jalios.jcms.stat.listener.AbstractStatListener
      extended by com.jalios.jcms.stat.listener.AbstractStatFieldListener
All Implemented Interfaces:
StatListener
Direct Known Subclasses:
AbstractStatMultiListener, StatDateTimeListener, StatRequestListener, StatSessionListener

public abstract class AbstractStatFieldListener
extends AbstractStatListener

A generic abstract class that store log informations in a multiple workspace Map. Map of Workspace > Map of Information > ObectIntTreeMap of counted information

Since:
jcms-5.0.0
Version:
$Revision: 27753 $
Author:
Jean-Philippe Encausse

Field Summary
protected  Beautifier beautifier
           
 long handleCount
           
 long handleTime
           
static String REVISION
           
protected  long t0
           
 
Fields inherited from class com.jalios.jcms.stat.listener.AbstractStatListener
ADMIN_AREA, ALL_AREA, channel, display, displayAverage, displayTimeChart, displayWeekChart, FEED_AREA, filteredZone, name, portlet, PUBLIC_AREA, regexpFilter, report, WORK_AREA
 
Fields inherited from interface com.jalios.jcms.stat.StatListener
ALL_WORKSPACE, TRUNCATE
 
Constructor Summary
AbstractStatFieldListener()
           
 
Method Summary
 Beautifier getBeautifier()
          Return the Beautifier that will display correctly stored data
 SortedSet getCurrentObjSet(String mapKey)
          Return the current processing objects
 String getNanoDuration()
           
static Object getWorkspaceFieldMap(Object workspace, String field, Object defaultObject, Map workspaceMap)
          Return the map for a given field for a given workspace
static Object getWorkspaceFieldMap(Object workspace, String field1, Object field2, ObjectIntTreeMap defaultObject1, Object defaultObject2, Map workspaceMap)
          Return the map for a given field1, field2 for a given workspace
 Map getWorkspaceMap()
           
 void handleEndOfStatEntries()
          Called when parsing is finished and then no more line will be send
abstract  void handleEndOfStatEntries(Map workspaceMap)
          Call EndOfStatEntries with given WorkspaceMap
 boolean handleStatEntry(StatEntry entry)
          Handle a line of Log
abstract  void processEntry(StatEntry entry, Object workspace, Map workspaceMap)
          Process an object and store it to the workspace map
 Object processWorkspace(StatEntry entry)
          Get the workspace of the StatEntry
protected  void timeStart()
           
protected  void timeStop()
           
protected static void updateWorkspaceMap(Object workspace, String field1, Collection incField1, Object incField2, Map workspaceMap)
          Convenient method calling updateWorkspaceMap() for each element of collection
protected static void updateWorkspaceMap(Object workspace, String field, Object incField, Map workspaceMap)
          Update the WORKSPACE > TIME > COUNT Map
protected static void updateWorkspaceMap(Object workspace, String field1, Object incField1, Object incField2, Map workspaceMap)
          Update the WORKSPACE > TIME > FIELD > COUNT Map
 boolean validateEntry(StatEntry entry)
          Validate the Stat Entry and get the correct parameter to process later.
 
Methods inherited from class com.jalios.jcms.stat.listener.AbstractStatListener
getDisplay, getName, getPortlet, getZone, handleStartDocument, init, isFiltered, setDisplay, setPortlet, setZone, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values

handleTime

public long handleTime

handleCount

public long handleCount

beautifier

protected Beautifier beautifier

t0

protected long t0
Constructor Detail

AbstractStatFieldListener

public AbstractStatFieldListener()
Method Detail

getNanoDuration

public String getNanoDuration()

handleStatEntry

public boolean handleStatEntry(StatEntry entry)
Description copied from interface: StatListener
Handle a line of Log

Specified by:
handleStatEntry in interface StatListener
Overrides:
handleStatEntry in class AbstractStatListener
Returns:
true if line is handle
Since:
jcms-5.0.0
See Also:
AbstractStatListener.handleStatEntry(StatEntry)

timeStart

protected void timeStart()

timeStop

protected void timeStop()

handleEndOfStatEntries

public void handleEndOfStatEntries()
Description copied from interface: StatListener
Called when parsing is finished and then no more line will be send

Specified by:
handleEndOfStatEntries in interface StatListener
Specified by:
handleEndOfStatEntries in class AbstractStatListener
See Also:
AbstractStatListener.handleEndOfStatEntries()

validateEntry

public boolean validateEntry(StatEntry entry)
Validate the Stat Entry and get the correct parameter to process later.

Parameters:
entry -
Returns:
true if the Entry shoud be processed.
Since:
jcms-5.0.0

processEntry

public abstract void processEntry(StatEntry entry,
                                  Object workspace,
                                  Map workspaceMap)
Process an object and store it to the workspace map

Parameters:
entry -
workspace -
workspaceMap -
Since:
jcms-5.0.0

handleEndOfStatEntries

public abstract void handleEndOfStatEntries(Map workspaceMap)
Call EndOfStatEntries with given WorkspaceMap

Parameters:
workspaceMap -
Since:
jcms-5.0.0

getCurrentObjSet

public SortedSet getCurrentObjSet(String mapKey)
Return the current processing objects

Since:
jcms-5.6.0

processWorkspace

public Object processWorkspace(StatEntry entry)
Get the workspace of the StatEntry

Parameters:
entry -
Returns:
a Workspace
Since:
jcms-5.0.0

updateWorkspaceMap

protected static void updateWorkspaceMap(Object workspace,
                                         String field,
                                         Object incField,
                                         Map workspaceMap)
Update the WORKSPACE > TIME > COUNT Map

Since:
jcms-5.0.0

updateWorkspaceMap

protected static void updateWorkspaceMap(Object workspace,
                                         String field1,
                                         Object incField1,
                                         Object incField2,
                                         Map workspaceMap)
Update the WORKSPACE > TIME > FIELD > COUNT Map

Since:
jcms-5.0.0

updateWorkspaceMap

protected static void updateWorkspaceMap(Object workspace,
                                         String field1,
                                         Collection incField1,
                                         Object incField2,
                                         Map workspaceMap)
Convenient method calling updateWorkspaceMap() for each element of collection

Since:
jcms-5.6.0

getWorkspaceFieldMap

public static Object getWorkspaceFieldMap(Object workspace,
                                          String field,
                                          Object defaultObject,
                                          Map workspaceMap)
Return the map for a given field for a given workspace

Returns:
a map
Since:
jcms-5.0.0

getWorkspaceFieldMap

public static Object getWorkspaceFieldMap(Object workspace,
                                          String field1,
                                          Object field2,
                                          ObjectIntTreeMap defaultObject1,
                                          Object defaultObject2,
                                          Map workspaceMap)
Return the map for a given field1, field2 for a given workspace

Returns:
the map for a given field1, field2 for a given workspace
Since:
jcms-5.0.0

getWorkspaceMap

public Map getWorkspaceMap()
Returns:
The workspace map
Since:
jcms-5.0.0

getBeautifier

public Beautifier getBeautifier()
Return the Beautifier that will display correctly stored data

Returns:
Beautifier
Since:
jcms-5.0.0


Copyright © 2001-2010 Jalios SA. All Rights Reserved.