public abstract class AbstractQueryResultsHandler extends Object implements QueryResultsHandler
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractQueryResultsHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Requests cancellation of whatever this object is currently doing.
|
void |
close()
Called by Protempa after
#handleFinish() to clean up any
resources used by the handler. |
void |
finish()
Called by Protempa as soon as all query results have been retrieved from
the data source.
|
String |
getDisplayName()
Returns this query result handler's display name for user interfaces.
|
String |
getId()
Gets the query result handler's identifier string for logging and
internal purposes.
|
void |
start(Collection<PropositionDefinition> cache)
Called by Protempa prior to the first invocation of
QueryResultsHandler.handleQueryResult(java.lang.String, java.util.List, java.util.Map, java.util.Map, java.util.Map). |
void |
validate()
Validates this query results handler's specification.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandleQueryResultpublic String getId()
QueryResultsHandlergetId in interface QueryResultsHandlerpublic String getDisplayName()
getId().getDisplayName in interface QueryResultsHandlerpublic void validate()
throws QueryResultsHandlerValidationFailedException
QueryResultsHandlervalidate in interface QueryResultsHandlerQueryResultsHandlerValidationFailedException - if validation
failed.public void start(Collection<PropositionDefinition> cache) throws QueryResultsHandlerProcessingException
QueryResultsHandlerQueryResultsHandler.handleQueryResult(java.lang.String, java.util.List, java.util.Map, java.util.Map, java.util.Map).
Implementers of this method may perform arbitrary processing related to
the output of the handler, such as printing out headers of a file or
extracting metadata for the handler's output.start in interface QueryResultsHandlercache - a cache of all of the proposition definitions that were
queried.QueryResultsHandlerProcessingException - if any exceptions occur at
a lower level.public void finish()
throws QueryResultsHandlerProcessingException
QueryResultsHandlerfinish in interface QueryResultsHandlerQueryResultsHandlerProcessingException - if any exceptions occur at
a lower levelpublic void close()
throws QueryResultsHandlerCloseException
QueryResultsHandler#handleFinish() to clean up any
resources used by the handler. It is called always, even if a previous
step failed.close in interface AutoCloseableclose in interface QueryResultsHandlerQueryResultsHandlerCloseException - if any exceptions occur at a
lower levelpublic void cancel()
QueryResultsHandlerQueryResultsHandler.finish() has not been called yet, it will be skipped. If
QueryResultsHandler.close() has not been called yet, it will be called, and it
must finish cleaning up all resources associated with this query
results handler.cancel in interface QueryResultsHandlerCopyright © 2012–2016 Emory University. All rights reserved.