ch.elca.el4j.services.statistics.detailed.processing
Class NonPersistentMeasureCollectorService

java.lang.Object
  extended by ch.elca.el4j.services.statistics.detailed.processing.NonPersistentMeasureCollectorService
All Implemented Interfaces:
MeasureCollectorService

public class NonPersistentMeasureCollectorService
extends Object
implements MeasureCollectorService

This class implements a non-persistant MeasureCollectionSerice. This means that this measure collector service is not backed by any database or file system. All the collected measurements are only stored in the memory. The cacheSize determines the maximum number of MeasureIDs, which are stored. If the no of MeasureIDs, exceeds the cacheSize all MeasureItems belonging to one MeasureId will be removed. This MeasureId for removal is chosen by a least-recently-used strategy.

Author:
Rashid Waraich (RWA), David Stefan (DST)
File-location:
NonPersistentMeasureCollectorService
Last check-in date:
2009-08-04 15:22:05 +0200 (Di, 04. Aug 2009) by swismer for revision 3881

Field Summary
 
Fields inherited from interface ch.elca.el4j.services.statistics.detailed.processing.MeasureCollectorService
CONTEXT_NAME_ID, CONTEXT_NAME_SEQ
 
Constructor Summary
NonPersistentMeasureCollectorService(int maxCacheSize)
          Construtor.
 
Method Summary
 void add(MeasureItem item)
          Adds a new measure.
 void delete(int amount)
          Deletes all measures.
 List<MeasureItem> getAllMeasureItems()
          Returns a List of all the measures.
 List<MeasureItem> getFirstMeasureItems()
          
 void writeMeasures()
          Won't do anything, as this is a non-persistant MeasureCollectorService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonPersistentMeasureCollectorService

public NonPersistentMeasureCollectorService(int maxCacheSize)
Construtor.

Parameters:
maxCacheSize - The maximum number of Measurements in the cache.
Method Detail

writeMeasures

public void writeMeasures()
Won't do anything, as this is a non-persistant MeasureCollectorService.

Specified by:
writeMeasures in interface MeasureCollectorService

add

public void add(MeasureItem item)
Adds a new measure.

Specified by:
add in interface MeasureCollectorService
Parameters:
item - the measure to add

delete

public void delete(int amount)
Deletes all measures.

Specified by:
delete in interface MeasureCollectorService
Parameters:
amount - Dummy paramater, not used for non persistant collector (will simply be ignored). Perhaps required later if other CollectorServices are also ported.

getAllMeasureItems

public List<MeasureItem> getAllMeasureItems()
Returns a List of all the measures.

Specified by:
getAllMeasureItems in interface MeasureCollectorService
Returns:
the list of measures

getFirstMeasureItems

public List<MeasureItem> getFirstMeasureItems()

Specified by:
getFirstMeasureItems in interface MeasureCollectorService
Returns:
The MeasureIds of the collected MeasureItems.


Copyright © 2005-2011 ELCA. All Rights Reserved.