public final class DataSourceImpl extends AbstractSource<DataSourceUpdatedEvent,DataSourceBackend,DataSourceUpdatedEvent,DataSourceBackendUpdatedEvent> implements DataSource
DataSourceBackend| Constructor and Description |
|---|
DataSourceImpl(DataSourceBackend[] backends) |
| Modifier and Type | Method and Description |
|---|---|
void |
backendUpdated(DataSourceBackendUpdatedEvent evt)
Notifies a listener when it needs to reread data in the backend.
|
void |
clear() |
void |
close()
|
void |
deleteAllKeys() |
GranularityFactory |
getGranularityFactory()
Returns an object for accessing the granularity of returned data from the
schema adaptor for this data source.
|
String |
getKeyType()
Returns a string representing the type of keys in this data source (e.g.,
patient, case).
|
String |
getKeyTypeDisplayName()
Returns a string representing the type of keys in this data source (e.g.,
patient, case) for display purposes.
|
String |
getKeyTypePluralDisplayName()
Returns a plural string representing the type of keys in this data source
(e.g., patient, case) for display purposes.
|
KeySetSpec[] |
getSelectedKeySetSpecs() |
UnitFactory |
getUnitFactory()
Returns the length units of returned data from this data source.
|
DataStreamingEventIterator<Proposition> |
readPropositions(Set<String> keyIds,
Set<String> propIds,
Filter filters,
QueryResultsHandler queryResultsHandler) |
void |
writeKeys(Set<String> keyIds) |
void |
writeKeysFromKeySet(KeySetQueryResultsHandler queryResultsHandler) |
addSourceListener, fireClosedUnexpectedly, fireSourceUpdated, getBackends, isClosed, removeSourceListener, setEventListeners, unrecoverableErrorOccurredclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddSourceListener, getBackends, removeSourceListener, setEventListenersunrecoverableErrorOccurredpublic DataSourceImpl(DataSourceBackend[] backends)
public String getKeyType() throws DataSourceReadException
getKeyType in interface DataSourceString, guaranteed not null.TerminologyAdaptorInitializationException - if the terminology
adaptor could not be initialized.SchemaAdaptorInitializationException - if the schema adaptor could
not be initialized.DataSourceReadExceptionpublic String getKeyTypeDisplayName() throws DataSourceReadException
getKeyTypeDisplayName in interface DataSourceString, guaranteed not null.TerminologyAdaptorInitializationException - if the terminology
adaptor could not be initialized.SchemaAdaptorInitializationException - if the schema adaptor could
not be initialized.DataSourceReadExceptionpublic String getKeyTypePluralDisplayName() throws DataSourceReadException
getKeyTypePluralDisplayName in interface DataSourceString, guaranteed not null.TerminologyAdaptorInitializationException - if the terminology
adaptor could not be initialized.SchemaAdaptorInitializationException - if the schema adaptor could
not be initialized.IllegalStateException - if the schema adaptor and/or terminology
adaptor could not be initialized, or if the schema adaptor returned a
null key type plural display name.DataSourceReadExceptionpublic KeySetSpec[] getSelectedKeySetSpecs() throws DataSourceReadException
getSelectedKeySetSpecs in interface DataSourceDataSourceReadExceptionpublic GranularityFactory getGranularityFactory() throws DataSourceReadException
getGranularityFactory in interface DataSourceGranularityFactory, or null if the data
source could not be initialized or the schema adaptor returned a null
GranularityFactory.TerminologyAdaptorInitializationException - if the terminology
adaptor could not be initialized.SchemaAdaptorInitializationException - if the schema adaptor could
not be initialized.DataSourceReadExceptionSchemaAdaptor#getGranularityFactory()public UnitFactory getUnitFactory() throws DataSourceReadException
getUnitFactory in interface DataSourceUnitFactory, or null if the data source
could not be initialized or the schema adaptor returned a null
UnitFactory.DataSourceReadException - if the data source could not be
initialized.public DataStreamingEventIterator<Proposition> readPropositions(Set<String> keyIds, Set<String> propIds, Filter filters, QueryResultsHandler queryResultsHandler) throws DataSourceReadException
readPropositions in interface DataSourceDataSourceReadExceptionpublic void deleteAllKeys()
throws DataSourceWriteException
deleteAllKeys in interface DataSourceDataSourceWriteExceptionpublic void writeKeys(Set<String> keyIds) throws DataSourceWriteException
writeKeys in interface DataSourceDataSourceWriteExceptionpublic void writeKeysFromKeySet(KeySetQueryResultsHandler queryResultsHandler) throws DataSourceWriteException
writeKeysFromKeySet in interface DataSourceDataSourceWriteExceptionpublic void backendUpdated(DataSourceBackendUpdatedEvent evt)
BackendListenerbackendUpdated in interface BackendListener<DataSourceBackendUpdatedEvent>evt - an EventObjectpublic void close()
throws SourceCloseException
AbstractSourceSource as a listener to the Backends
provided to the constructor.
Must be called by subclasses, or proper cleanup will not occur.close in interface AutoCloseableclose in interface Source<DataSourceUpdatedEvent,DataSourceBackend,DataSourceBackendUpdatedEvent>close in class AbstractSource<DataSourceUpdatedEvent,DataSourceBackend,DataSourceUpdatedEvent,DataSourceBackendUpdatedEvent>SourceCloseExceptionpublic void clear()
clear in interface Source<DataSourceUpdatedEvent,DataSourceBackend,DataSourceBackendUpdatedEvent>Copyright © 2012–2018 Emory University. All rights reserved.