ome.services.fulltext
Class PersistentEventLogLoader

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

public 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 delete
          String used with parameter 'name' to drop the current id;
protected  String insert
          String use with parameters 'name', and 'value' to insert a new current id
protected  String key
          Key used to look configuration value; 'name'
protected  String query
          Query used with parameter 'name' to lookup configuration value
protected  org.springframework.jdbc.core.simple.SimpleJdbcTemplate template
           
protected  ITypes types
           
protected  String update
          String used with parameters 'value' and 'name' to change the current id
 
Fields inherited from class ome.services.fulltext.EventLogLoader
batchSize, DEFAULT_BATCH_SIZE, excludes, queryService
 
Constructor Summary
PersistentEventLogLoader()
           
 
Method Summary
 void deleteCurrentId()
           
 long getCurrentId()
          Get current EventLog id.
 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 setDelete(String delete)
           
 void setInsert(String insert)
           
 void setKey(String key)
           
 void setQuery(String query)
           
 void setTemplate(org.springframework.jdbc.core.simple.SimpleJdbcTemplate template)
           
 void setTypes(ITypes types)
           
 void setUpdate(String update)
           
 
Methods inherited from class ome.services.fulltext.EventLogLoader
addEventLog, 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'


query

protected String query
Query used with parameter 'name' to lookup configuration value


insert

protected String insert
String use with parameters 'name', and 'value' to insert a new current id


update

protected String update
String used with parameters 'value' and 'name' to change the current id


delete

protected String delete
String used with parameter 'name' to drop the current id;


types

protected ITypes types

template

protected org.springframework.jdbc.core.simple.SimpleJdbcTemplate template
Constructor Detail

PersistentEventLogLoader

public PersistentEventLogLoader()
Method Detail

setKey

public void setKey(String key)

setQuery

public void setQuery(String query)

setInsert

public void setInsert(String insert)

setUpdate

public void setUpdate(String update)

setDelete

public void setDelete(String delete)

setTypes

public void setTypes(ITypes types)

setTemplate

public void setTemplate(org.springframework.jdbc.core.simple.SimpleJdbcTemplate template)

query

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

initialize

public void initialize()
Called when the configuration database does not contain a valid current_id. Used to index all the data which does not have an EventLog.


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: Beta-4.2.0-r7571-b29

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