Package org.bonitasoft.engine.tracking
Class TimeTracker
- java.lang.Object
-
- org.bonitasoft.engine.tracking.TimeTracker
-
- All Implemented Interfaces:
LifecycleService,TenantLifecycleService
public class TimeTracker extends java.lang.Object implements TenantLifecycleService
-
-
Constructor Summary
Constructors Constructor Description TimeTracker(TechnicalLoggerService logger, boolean startTracking, java.util.List<FlushEventListener> flushEventListeners, int maxSize, int flushIntervalInSeconds, java.lang.String... activatedRecords)TimeTracker(TechnicalLoggerService logger, Clock clock, boolean startTracking, java.util.List<FlushEventListener> flushEventListeners, int maxSize, int flushIntervalInMS, java.lang.String... activatedRecords)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanactivateFlushEventListener(java.lang.String flushEventListenerName)voidactivateRecord(TimeTrackerRecords activatedRecord)voidaddFlushEventListener(FlushEventListener flushEventListener)reference a new flushEventListener.voidclearRecords()voiddeactivatedRecord(TimeTrackerRecords activatedRecord)booleandeactivateFlushEventListener(java.lang.String flushEventListenerName)FlushResultflush()java.util.Set<TimeTrackerRecords>getActivatedRecords()java.util.List<FlushEventListener>getActiveFlushEventListeners()get the list of Active ListenerClockgetClock()java.util.List<FlushEventListener>getFlushEventListeners()return all Event Listeners, active or notlonggetFlushIntervalInMS()TechnicalLoggerServicegetLogger()java.util.List<Record>getRecordsCopy()java.lang.StringgetStatus()booleanisTrackable(TimeTrackerRecords recordName)booleanisTracking()voidpause()Temporary halt the execution of this service.voidremoveFlushEventListener(java.lang.String flushEventListenerName)remove a flush event listenervoidresume()resume the execution the servicevoidsetFlushIntervalInMS(long flushIntervalInMS)voidsetFlushIntervalInSeconds(long flushIntervalInSeconds)voidstart()Start the servicevoidstartTracking()voidstop()voidstopTracking()voidtrack(TimeTrackerRecords recordName, java.lang.String recordDescription, long duration)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bonitasoft.engine.commons.TenantLifecycleService
init
-
-
-
-
Constructor Detail
-
TimeTracker
public TimeTracker(TechnicalLoggerService logger, boolean startTracking, java.util.List<FlushEventListener> flushEventListeners, int maxSize, int flushIntervalInSeconds, java.lang.String... activatedRecords)
-
TimeTracker
public TimeTracker(TechnicalLoggerService logger, Clock clock, boolean startTracking, java.util.List<FlushEventListener> flushEventListeners, int maxSize, int flushIntervalInMS, java.lang.String... activatedRecords)
-
-
Method Detail
-
getActiveFlushEventListeners
public java.util.List<FlushEventListener> getActiveFlushEventListeners()
get the list of Active Listener
-
getFlushEventListeners
public java.util.List<FlushEventListener> getFlushEventListeners()
return all Event Listeners, active or not
-
addFlushEventListener
public void addFlushEventListener(FlushEventListener flushEventListener)
reference a new flushEventListener. The key of the reference is the flushEventListener.name(). If a listener exist with this name, it will be replaced.
-
removeFlushEventListener
public void removeFlushEventListener(java.lang.String flushEventListenerName)
remove a flush event listener
-
activateFlushEventListener
public boolean activateFlushEventListener(java.lang.String flushEventListenerName)
-
deactivateFlushEventListener
public boolean deactivateFlushEventListener(java.lang.String flushEventListenerName)
-
activateRecord
public void activateRecord(TimeTrackerRecords activatedRecord)
-
deactivatedRecord
public void deactivatedRecord(TimeTrackerRecords activatedRecord)
-
getActivatedRecords
public java.util.Set<TimeTrackerRecords> getActivatedRecords()
-
startTracking
public void startTracking()
-
stopTracking
public void stopTracking()
-
isTracking
public boolean isTracking()
-
getFlushIntervalInMS
public long getFlushIntervalInMS()
-
setFlushIntervalInSeconds
public void setFlushIntervalInSeconds(long flushIntervalInSeconds)
-
setFlushIntervalInMS
public void setFlushIntervalInMS(long flushIntervalInMS)
-
getClock
public Clock getClock()
-
getStatus
public java.lang.String getStatus()
-
isTrackable
public boolean isTrackable(TimeTrackerRecords recordName)
-
getLogger
public TechnicalLoggerService getLogger()
-
track
public void track(TimeTrackerRecords recordName, java.lang.String recordDescription, long duration)
-
flush
public FlushResult flush()
-
getRecordsCopy
public java.util.List<Record> getRecordsCopy()
-
clearRecords
public void clearRecords()
-
start
public void start()
Description copied from interface:LifecycleServiceStart the service- Specified by:
startin interfaceLifecycleService
-
stop
public void stop()
- Specified by:
stopin interfaceLifecycleService
-
pause
public void pause()
Description copied from interface:LifecycleServiceTemporary halt the execution of this service.- Specified by:
pausein interfaceLifecycleService
-
resume
public void resume()
Description copied from interface:LifecycleServiceresume the execution the service- Specified by:
resumein interfaceLifecycleService
-
-