pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.statistics.model.aggregation
Class CountryPerVisitAggregation

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.component.statistics.model.aggregation.AbstractAggregation
          extended by org.torweg.pulse.component.statistics.model.aggregation.CountryPerVisitAggregation
All Implemented Interfaces:
java.io.Serializable, ICount, IHasDuration

@Entity
public class CountryPerVisitAggregation
extends AbstractAggregation
implements ICount

Aggregates the "countries" on a "per Visit" basis for the set Duration.

Version:
$Revision: 1579 $
Author:
Daniel Dietz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.torweg.pulse.component.statistics.model.aggregation.AbstractAggregation
AbstractAggregation.Hour
 
Field Summary
 
Fields inherited from class org.torweg.pulse.component.statistics.model.aggregation.AbstractAggregation
LOGGER
 
Constructor Summary
protected CountryPerVisitAggregation()
          Deprecated. 
  CountryPerVisitAggregation(StatisticsServer server, Duration duration)
          Creates a new CountryPerVisitAggregation with the given StatisticsServer and the given Duration.
 
Method Summary
 boolean aggregate(Visit visit, org.hibernate.Session s)
          Aggregates the given Visit.
 int getCount()
          Returns the total country-hit count for all countries.
 int getCount(java.lang.String c)
          Returns the country-hit count for the given country-string.
 java.util.Set<CountryHitCounter> getCounters()
          Returns the underlying CountryHitCounters.
 java.util.Set<CountryHitCounter> getCountryHitCounters()
          Returns the CountryHitCounters.
 boolean isAggregateable(Visit visit)
          Test if the given Visit is aggregate-able by this CountryPerVisitAggregation.
 
Methods inherited from class org.torweg.pulse.component.statistics.model.aggregation.AbstractAggregation
getDataResolution, getDuration, getEndMillis, getStartMillis, getStatisticsServer, setDuration, setEndMillis, setStartMillis, setStatisticsServer, toString
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CountryPerVisitAggregation

@Deprecated
protected CountryPerVisitAggregation()
Deprecated. 

Default constructor for HibernateTM and JAXB.


CountryPerVisitAggregation

public CountryPerVisitAggregation(StatisticsServer server, Duration duration)
Creates a new CountryPerVisitAggregation with the given StatisticsServer and the given Duration.

Parameters:
server - the StatisticsServer
duration - the Duration
Method Detail

getCountryHitCounters

public final java.util.Set<CountryHitCounter> getCountryHitCounters()
Returns the CountryHitCounters.

Returns:
the counters

getCount

public final int getCount(java.lang.String c)
Returns the country-hit count for the given country-string.

Parameters:
c - the country
Returns:
the count

getCount

public final int getCount()
Returns the total country-hit count for all countries.

Specified by:
getCount in interface ICount
Returns:
the count

getCounters

public final java.util.Set<CountryHitCounter> getCounters()
Returns the underlying CountryHitCounters.

Returns:
Collections.unmodifiableSet(this.counters)

isAggregateable

public final boolean isAggregateable(Visit visit)
Test if the given Visit is aggregate-able by this CountryPerVisitAggregation.

Specified by:
isAggregateable in class AbstractAggregation
Parameters:
visit - the Visit
Returns:
true if and only if this AbstractAggregation can process the given Visit, false otherwise
See Also:
#isAggregateable(org.torweg.pulse.component.statistics.model.Visit)

aggregate

public final boolean aggregate(Visit visit,
                               org.hibernate.Session s)
Aggregates the given Visit.

Specified by:
aggregate in class AbstractAggregation
Parameters:
visit - the Visit
s - the HibernateTM-Session
Returns:
true if and only if the Visit has been processed, false otherwise
See Also:
#aggregate(org.torweg.pulse.component.statistics.model.Visit)