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 PIRecordCountAggregation

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.AbstractCountAggregation
              extended by org.torweg.pulse.component.statistics.model.aggregation.PIRecordCountAggregation
All Implemented Interfaces:
java.io.Serializable, ICount, IHasDuration

@Entity
public class PIRecordCountAggregation
extends AbstractCountAggregation

Aggregates the daily hits (page impressions as represented by PIRecords) per Visit being aggregated on a "per Hour" 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 PIRecordCountAggregation()
          Deprecated. 
  PIRecordCountAggregation(StatisticsServer server, Duration duration)
          Creates a new PIRecordCountAggregation with the given StatisticsServer and the given Duration.
 
Method Summary
 void accumulate(PIRecordCountAggregation aggr)
          Adds the values of the given PIRecordCountAggregation if its Duration lies within the Duration of the current PIRecordCountAggregation.
 boolean aggregate(Visit visit, org.hibernate.Session s)
          Aggregates the given Visit.
 int getCount(AbstractAggregation.Hour h)
          Returns the hit count for the given PIRecordCountAggregation.Hour .
 java.util.Set<PIRecordCountAggregationHitCounter> getHitCounters()
          Returns the HitCounters.
 boolean isAggregateable(Visit visit)
          Test if the given Visit is aggregate-able by this PIRecordCountAggregation.
 
Methods inherited from class org.torweg.pulse.component.statistics.model.aggregation.AbstractCountAggregation
getCount, increase, increaseBy, setCount
 
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

PIRecordCountAggregation

@Deprecated
protected PIRecordCountAggregation()
Deprecated. 

Default constructor for HibernateTM and JAXB.


PIRecordCountAggregation

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

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

getHitCounters

public final java.util.Set<PIRecordCountAggregationHitCounter> getHitCounters()
Returns the HitCounters.

Returns:
the counters

getCount

public final int getCount(AbstractAggregation.Hour h)
Returns the hit count for the given PIRecordCountAggregation.Hour .

Parameters:
h - the PIRecordCountAggregation.Hour
Returns:
the count

isAggregateable

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

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 Session UNUSED
Returns:
true if and only if the Visit has been processed, false otherwise
See Also:
#aggregate(org.torweg.pulse.component.statistics.model.Visit)

accumulate

public final void accumulate(PIRecordCountAggregation aggr)
Adds the values of the given PIRecordCountAggregation if its Duration lies within the Duration of the current PIRecordCountAggregation.

Parameters:
aggr - the PIRecordCountAggregation
Throws:
java.lang.NullPointerException - if the given PIRecordCountAggregation is null
java.lang.IllegalArgumentException - if the Duration of the given PIRecordCountAggregation does not lie within the Duration of the current PIRecordCountAggregation