org.novadeck.jxla.data
Class Site

java.lang.Object
  |
  +--org.novadeck.jxla.data.Site

public class Site
extends java.lang.Object

Contains all information picked from the logs files for a specific site


Constructor Summary
Site(java.lang.String str)
          simple constructor for a website
 
Method Summary
 void addHit(Line l)
          Add current log line to the site
static void addLine(Line l)
          search the site associated to this line and add the line data to his reports
static void addSite(SiteHistory hist)
          On load prog read the serialized data and init sites information using this method
 java.lang.StringBuffer getData(java.lang.String statsDirectory)
          Write all month reports an return a summary
 java.util.Date getFirstLogDate()
          Retrieve the date of the first lline log applied to this site.
 SiteHistory getHistory()
          Use for storing information report related of a particular site for storing into a file using Java serialization
 java.lang.StringBuffer getMonthData(int month, int year)
          Retrieve specified month summary information for a single global all sites summary
 java.lang.String getName()
          Return the name of the site
static Site getSite(java.lang.String host)
          Retrieve a site based on his name
static java.lang.String[] getSiteHosts()
          Return an array all site having log informations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Site

public Site(java.lang.String str)
simple constructor for a website
Parameters:
str - internal hostname of the site
Method Detail

getName

public java.lang.String getName()
Return the name of the site
Returns:
internal name of site

getFirstLogDate

public java.util.Date getFirstLogDate()
Retrieve the date of the first lline log applied to this site.
Returns:
date of 1st log line

addHit

public void addHit(Line l)
Add current log line to the site
Parameters:
l - line parsed

getMonthData

public java.lang.StringBuffer getMonthData(int month,
                                           int year)
Retrieve specified month summary information for a single global all sites summary
Parameters:
month - month number
year - year number
Returns:
an stringbuffer contaning an xml well formed element

addLine

public static void addLine(Line l)
search the site associated to this line and add the line data to his reports
Parameters:
l - line parsed

getHistory

public SiteHistory getHistory()
Use for storing information report related of a particular site for storing into a file using Java serialization
Returns:
a serializable form of all site information

getData

public java.lang.StringBuffer getData(java.lang.String statsDirectory)
Write all month reports an return a summary
Parameters:
statsDirectory - directory path where to write reports
Returns:
Summary report as stringbuffer representing a XML well form document

getSite

public static Site getSite(java.lang.String host)
Retrieve a site based on his name
Parameters:
host - hostname
Returns:
a site object associated with th specified name, create one if needed

getSiteHosts

public static java.lang.String[] getSiteHosts()
Return an array all site having log informations
Returns:
an array containing site names

addSite

public static void addSite(SiteHistory hist)
On load prog read the serialized data and init sites information using this method
Parameters:
hist - history data from previous parsing of a site