|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.gee.publication.servlets.util.ZpadCounter
public class ZpadCounter
Zpad hit counter utility
| Field Summary | |
|---|---|
protected static String[] |
_counterNames
|
protected static Hashtable[] |
_hitCounters
|
protected static HashMap |
_lastHitDowPerHost
This map remembers per virtual host the day of week (dow) at which the last hit was registered. |
static int |
CONTENT
|
protected static int |
HIT_COUNTERS
|
static int |
LOGIN
|
static int |
PAGE
|
static String |
PAGE_USERNAME
The fake username used for the pages counter. |
static int |
ZPAD
|
| Constructor Summary | |
|---|---|
ZpadCounter()
|
|
| Method Summary | |
|---|---|
protected static String |
_dayIndexToName(int dayIndex)
Translate our day indices (0,..6) to names. |
protected static void |
_store(String host,
int type,
int dow)
Store a type/dow counter. |
static void |
destroy()
On destroy save the current counters to disk. |
static void |
ensureCountersLoaded(String host)
Make sure the stored files on disk are loaded for a host. |
static Date |
getDate(int day)
Get a Date matching a day in the last week. |
static int |
getHighestCount(int type,
String host,
String username)
Get the highest count of one type for a specific user in the last week. |
static SortedSet |
getHits(int type,
String host)
Get a sorted overview of all hits of a single type for all users on a host over the last 7 days. |
static int |
getUserHits(int type,
String host,
String username)
Get the number of hits of a single type for a single user on a host over the last 7 days. |
static int |
getUserHitsPerDay(int day,
int type,
String host,
String username)
Get the number of hits of a single type for a single user on a host for a specific day. |
static void |
hit(int type,
String host,
UserInfo user)
Count a hit of a type on a server for a user. |
static void |
restore(String host)
Restore the current counters for a host from disk. |
static void |
store(String host)
Store the (all) current counters for a host to disk. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static HashMap _lastHitDowPerHost
public static String PAGE_USERNAME
public static int ZPAD
public static int CONTENT
public static int LOGIN
public static int PAGE
protected static String[] _counterNames
protected static int HIT_COUNTERS
protected static Hashtable[] _hitCounters
| Constructor Detail |
|---|
public ZpadCounter()
| Method Detail |
|---|
public static void hit(int type,
String host,
UserInfo user)
type - one of ZPAD, CONTENT, LOGIN, PAGEhost - the hostuser - the user
public static SortedSet getHits(int type,
String host)
type - one of ZPAD, CONTENT, LOGIN, PAGEhost - the host
public static int getUserHits(int type,
String host,
String username)
type - one of ZPAD, CONTENT, LOGIN, PAGEhost - the hostusername - the user's name
public static int getUserHitsPerDay(int day,
int type,
String host,
String username)
day - 0 = today, -1 = yesterday, -2 = day before yesterday, ... -6 = almost one week agotype - one of ZPAD, CONTENT, LOGIN, PAGEhost - the hostusername - the user's name
public static int getHighestCount(int type,
String host,
String username)
type - one of ZPAD, CONTENT, LOGIN, PAGEhost - the hostusername - the user's namepublic static Date getDate(int day)
day - 0 = today, -1 = yesterday, -2 = day before yesterday, ... -6 = almost one week agopublic static void ensureCountersLoaded(String host)
public static void store(String host)
protected static void _store(String host,
int type,
int dow)
public static void restore(String host)
public static void destroy()
throws IOException
IOExceptionprotected static String _dayIndexToName(int dayIndex)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||