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 AbstractAggregation

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.component.statistics.model.aggregation.AbstractAggregation
All Implemented Interfaces:
java.io.Serializable, IHasDuration
Direct Known Subclasses:
AbstractCountAggregation, AbstractRegexVersionedCounterAggregation, AbstractTreeAggregation, AverageTimePerVisitAggregation, CountryPerPIRecordAggregation, CountryPerVisitAggregation

@MappedSuperclass
public abstract class AbstractAggregation
extends AbstractBasicEntity
implements IHasDuration

Abstract bass class representing a basic aggregation of statistical data (by aggregating Visits) as being produced by an AbstractBaseAggregator.

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

Nested Class Summary
static class AbstractAggregation.Hour
          The known hours for the PIRecordCountAggregation.HitCounter.
 
Field Summary
protected static org.slf4j.Logger LOGGER
          the logger.
 
Constructor Summary
AbstractAggregation()
           
 
Method Summary
abstract  boolean aggregate(Visit visit, org.hibernate.Session s)
          Aggregates the given Visit.
 Period getDataResolution()
          Returns the data resolution as Period.
 Duration getDuration()
          Returns a Duration representing the start/end of the AbstractAggregation.
 long getEndMillis()
          Returns the end time-stamp.
 long getStartMillis()
          Returns the start time-stamp.
 StatisticsServer getStatisticsServer()
          Returns the StatisticsServer the aggregation is related to.
abstract  boolean isAggregateable(Visit visit)
          Checks if the given Visit can be aggregated by the AbstractRegexVersionedCounterAggregation.
protected  void setDuration(Duration duration)
          Sets the start/end of the AbstractAggregation from the given Duration.
protected  void setEndMillis(long end)
          Sets the end time-stamp.
protected  void setStartMillis(long start)
          Sets the start time-stamp.
protected  void setStatisticsServer(StatisticsServer server)
          Sets the StatisticsServer.
 java.lang.String 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
 

Field Detail

LOGGER

protected static final org.slf4j.Logger LOGGER
the logger.

Constructor Detail

AbstractAggregation

public AbstractAggregation()
Method Detail

setStartMillis

protected final void setStartMillis(long start)
Sets the start time-stamp.

Parameters:
start - the start time to set

getStartMillis

public final long getStartMillis()
Returns the start time-stamp.

Returns:
the startTime

setEndMillis

protected final void setEndMillis(long end)
Sets the end time-stamp.

Parameters:
end - the end time to set

getEndMillis

public final long getEndMillis()
Returns the end time-stamp.

Returns:
the endTime

setDuration

protected final void setDuration(Duration duration)
Sets the start/end of the AbstractAggregation from the given Duration.

Parameters:
duration - the Duration to apply
Throws:
java.lang.NullPointerException - if the given Duration is null
java.lang.IllegalArgumentException - if the given Duration does not match a valid Period

getDuration

public final Duration getDuration()
Returns a Duration representing the start/end of the AbstractAggregation.

Specified by:
getDuration in interface IHasDuration
Returns:
a Duration

getDataResolution

public final Period getDataResolution()
Returns the data resolution as Period.

Returns:
the data resolution as Period

getStatisticsServer

public final StatisticsServer getStatisticsServer()
Returns the StatisticsServer the aggregation is related to.

Returns:
the StatisticsServer

setStatisticsServer

protected final void setStatisticsServer(StatisticsServer server)
Sets the StatisticsServer.

Parameters:
server - the StatisticsServer
Throws:
java.lang.NullPointerException - if the given server is null

isAggregateable

public abstract boolean isAggregateable(Visit visit)
Checks if the given Visit can be aggregated by the AbstractRegexVersionedCounterAggregation.

Parameters:
visit - the Visit
Returns:
true if and only if the Visit can be processed, false otherwise

aggregate

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

Parameters:
visit - the Visit
s - a HibernateTM-Session
Returns:
true if and only if the Visit could be processed, false otherwise

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
a string-representation of the AbstractAggregation