Package ome.services.eventlogs
Class PersistentEventLogLoader
- java.lang.Object
-
- ome.services.eventlogs.EventLogLoader
-
- ome.services.eventlogs.PersistentEventLogLoader
-
- All Implemented Interfaces:
java.lang.Iterable<ome.model.meta.EventLog>,java.util.EventListener,java.util.Iterator<ome.model.meta.EventLog>,org.springframework.context.ApplicationListener
- Direct Known Subclasses:
EventLogQueue,PersistentEventLogLoader,PersistentEventLogLoader
public abstract class PersistentEventLogLoader extends EventLogLoader
EventLogLoaderimplementation which keeps tracks of the lastEventLoginstance, and always provides the next unindexed instance. Resetting that saved value would restart indexing.- Since:
- 3.0-Beta3
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringkeyKey used to look configuration value; 'name'protected ome.util.SqlActionsqlprotected ome.api.ITypestypes-
Fields inherited from class ome.services.eventlogs.EventLogLoader
batchSize, DEFAULT_BATCH_SIZE, excludes, log, query, queryService
-
-
Constructor Summary
Constructors Constructor Description PersistentEventLogLoader()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddeleteCurrentId()longgetCurrentId()Get currentEventLogid.java.lang.StringgetKey()abstract voidinitialize()Called when the configuration database does not contain a valid current_id.longmore()Should return an estimate of how many moreEventLoginstances are available for processing.protected ome.model.meta.EventLogquery()voidsetCurrentId(long id)voidsetKey(java.lang.String key)voidsetSqlAction(ome.util.SqlAction sql)voidsetTypes(ome.api.ITypes types)-
Methods inherited from class ome.services.eventlogs.EventLogLoader
addEventLog, getBatchSize, hasNext, isStopSet, iterator, lastEventLog, next, nextEventLog, onApplicationEvent, remove, rollback, setBatchSize, setExcludes, setQueryService, setStop
-
-
-
-
Method Detail
-
setKey
public void setKey(java.lang.String key)
-
getKey
public java.lang.String getKey()
-
setTypes
public void setTypes(ome.api.ITypes types)
-
setSqlAction
public void setSqlAction(ome.util.SqlAction sql)
-
query
protected ome.model.meta.EventLog query()
- Specified by:
queryin classEventLogLoader
-
initialize
public abstract void initialize()
Called when the configuration database does not contain a valid current_id.
-
getCurrentId
public long getCurrentId()
Get currentEventLogid. If the lookup throws an exception, either the configuration has been deleted or renamed, in which we need to reinitialize, or the table is missing and something is wrong.
-
setCurrentId
public void setCurrentId(long id)
-
deleteCurrentId
public void deleteCurrentId()
-
more
public long more()
Description copied from class:EventLogLoaderShould return an estimate of how many moreEventLoginstances are available for processing. Some implementations may attempt to take extra measures if the number is too large. Use 1 for a constant rather thanLong.MAX_VALUE. Use 0 to stop execution.- Specified by:
morein classEventLogLoader
-
-