|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object magoffin.matt.ma2.lucene.AbstractIndexResultCallback<T,PK>
T
- the domain object typePK
- the primary key typepublic abstract class AbstractIndexResultCallback<T,PK extends java.io.Serializable>
Abstract implementation that combines IndexResults
and
BatchableDao.BatchCallback
.
Field Summary | |
---|---|
static int |
DEFAULT_ERROR_PERCENT_MAX_FRACTION_DIGITS
Default number of error percent fraction digits. |
protected org.apache.log4j.Logger |
log
A class logger. |
Constructor Summary | |
---|---|
AbstractIndexResultCallback(org.springframework.context.MessageSource messages)
Construct. |
Method Summary | |
---|---|
protected abstract magoffin.matt.dao.BatchableDao.BatchCallbackResult |
doHandle(T domainObject)
Handle the domain object callback. |
protected java.util.Map<PK,java.lang.String> |
getErrorMap()
Get the map of errors. |
java.util.Map<? extends java.io.Serializable,java.lang.String> |
getErrors()
|
protected magoffin.matt.dao.BatchableDao.BatchCallbackResult |
getExceptionResult(T domainObject,
java.lang.Exception e)
Get the result for when an exception occurs. |
protected abstract java.lang.String |
getIndexErrorMessage(T domainObject,
java.lang.Exception e)
Get an error message for an index operation. |
protected org.springframework.context.MessageSource |
getMessages()
|
int |
getNumIndexed()
|
int |
getNumProcessed()
|
protected abstract PK |
getPrimaryKey(T domainObject)
Get the primary key for a domain object. |
protected org.apache.lucene.index.IndexWriter |
getWriter()
|
magoffin.matt.dao.BatchableDao.BatchCallbackResult |
handle(T domainObject)
|
boolean |
isFinished()
|
protected void |
setFinished(boolean finished)
|
protected void |
setMessages(org.springframework.context.MessageSource messages)
|
protected void |
setWriter(org.apache.lucene.index.IndexWriter writer)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_ERROR_PERCENT_MAX_FRACTION_DIGITS
protected final org.apache.log4j.Logger log
Constructor Detail |
---|
public AbstractIndexResultCallback(org.springframework.context.MessageSource messages)
messages
- a MessageSourceMethod Detail |
---|
public final magoffin.matt.dao.BatchableDao.BatchCallbackResult handle(T domainObject)
handle
in interface magoffin.matt.dao.BatchableDao.BatchCallback<T>
protected magoffin.matt.dao.BatchableDao.BatchCallbackResult getExceptionResult(T domainObject, java.lang.Exception e)
domainObject
- the domain object that caused the errore
- the exception
protected abstract java.lang.String getIndexErrorMessage(T domainObject, java.lang.Exception e)
domainObject
- the domain object that caused the errore
- the exception
protected abstract PK getPrimaryKey(T domainObject)
domainObject
- the domain object
protected abstract magoffin.matt.dao.BatchableDao.BatchCallbackResult doHandle(T domainObject) throws java.lang.Exception
domainObject
- the domain object
java.lang.Exception
- if an error occurspublic java.util.Map<? extends java.io.Serializable,java.lang.String> getErrors()
getErrors
in interface magoffin.matt.lucene.IndexResults
public int getNumIndexed()
getNumIndexed
in interface magoffin.matt.lucene.IndexResults
public int getNumProcessed()
getNumProcessed
in interface magoffin.matt.lucene.IndexResults
public boolean isFinished()
isFinished
in interface magoffin.matt.lucene.IndexResults
protected void setFinished(boolean finished)
finished
- the finished to setprotected java.util.Map<PK,java.lang.String> getErrorMap()
protected org.springframework.context.MessageSource getMessages()
protected org.apache.lucene.index.IndexWriter getWriter()
protected void setMessages(org.springframework.context.MessageSource messages)
messages
- the messages to setprotected void setWriter(org.apache.lucene.index.IndexWriter writer)
writer
- the writer to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |