ome.services.eventlogs
Class PersistentEventLogLoader

java.lang.Object
  extended by ome.services.eventlogs.EventLogLoader
      extended by ome.services.eventlogs.PersistentEventLogLoader
All Implemented Interfaces:
Iterable<ome.model.meta.EventLog>, EventListener, Iterator<ome.model.meta.EventLog>, org.springframework.context.ApplicationListener
Direct Known Subclasses:
PersistentEventLogLoader, PersistentEventLogLoader

public abstract class PersistentEventLogLoader
extends EventLogLoader

EventLogLoader implementation which keeps tracks of the last EventLog instance, and always provides the next unindexed instance. Reseting that saved value would restart indexing.

Since:
3.0-Beta3
Author:
Josh Moore, josh at glencoesoftware.com

Field Summary
protected  String key
          Key used to look configuration value; 'name'
protected  ome.util.SqlAction sql
           
protected  ITypes types
           
 
Fields inherited from class ome.services.eventlogs.EventLogLoader
batchSize, DEFAULT_BATCH_SIZE, excludes, log, queryService
 
Constructor Summary
PersistentEventLogLoader()
           
 
Method Summary
 void deleteCurrentId()
           
 long getCurrentId()
          Get current EventLog id.
abstract  void initialize()
          Called when the configuration database does not contain a valid current_id.
 long more()
          Should return an estimate of how many more EventLog instances are available for processing.
protected  ome.model.meta.EventLog query()
           
 void setCurrentId(long id)
           
 void setKey(String key)
           
 void setSqlAction(ome.util.SqlAction sql)
           
 void setTypes(ITypes types)
           
 
Methods inherited from class ome.services.eventlogs.EventLogLoader
addEventLog, getBatchSize, hasNext, iterator, lastEventLog, next, nextEventLog, onApplicationEvent, remove, rollback, setBatchSize, setExcludes, setQueryService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

protected String key
Key used to look configuration value; 'name'


types

protected ITypes types

sql

protected ome.util.SqlAction sql
Constructor Detail

PersistentEventLogLoader

public PersistentEventLogLoader()
Method Detail

setKey

public void setKey(String key)

setTypes

public void setTypes(ITypes types)

setSqlAction

public void setSqlAction(ome.util.SqlAction sql)

query

protected ome.model.meta.EventLog query()
Specified by:
query in class EventLogLoader

initialize

public abstract void initialize()
Called when the configuration database does not contain a valid current_id.


getCurrentId

public long getCurrentId()
Get current EventLog id. 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: EventLogLoader
Should return an estimate of how many more EventLog instances are available for processing. Some implementations may attempt to take extra measures if the number is too large. Use 1 for a constant rather than Long.MAX_VALUE. Use 0 to stop execution.

Specified by:
more in class EventLogLoader


OmeroJava Api

Version: 4.3.4-dbcbce5a-b4

Copyright © 2009 The University of Dundee. All Rights Reserved.