public class FusionAccessor extends RecordAccessor
The FusionAccessor class is a SemanticAccessor which uses multiple underlying SemanticAccessors. When the FusionAccessor is queried for a particular data structure, it retrieves records from all available accessors, and attempts to fuse them.
The FusionAccessor uses the templates for each of its underlying accessors to map the data from the original source into a set of intermediary records. Then, each of the original source is merged into a cohesive set of records.
In the configuration file for the FusionAccessor, the template name keys and each of the source fields in the various field descriptors uses a accessor.template.field notation. For instance, foo.bar.baz refers to the baz field in the records retrieved by the bar template by the accessor foo. If the field component is omitted, the source field refers to the name of the resulting data record.
Constructor and Description |
---|
FusionAccessor() |
Modifier and Type | Method and Description |
---|---|
void |
addAccessor(java.lang.String name,
RecordAccessor accessor)
Add a semantic accessor to this data coordinator.
|
void |
addFieldHandler(java.lang.String fieldName,
FieldHandler handler)
Add a field handler for a particular field.
|
protected java.util.Set<DataRecord> |
retrieveRecords(DataTemplate template)
Retrieve a set of data records for a particular DataTemplate.
|
void |
setInitParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
Set any initialization parameters required by this data accessor.
|
void |
setQuery(java.lang.String queryString)
Set the query string used to retrieve records.
|
addToGraph, addToTree, createReferenceNode, extendGraph, extendTree, getDataset, getFieldHandler, getGraph, getGrid, getMaxRecords, getReasoner, getStructureReasoners, getTree, setMaxRecords, setReasoner, setReasoner
addStructure, addTemplate, getDatasetNames, getGraphNames, getGridNames, getSpec, getStructureType, getTemplate, getTemplateNames, getTreeNames, setConfig, setConfigFile, setConfigFile
public void addAccessor(java.lang.String name, RecordAccessor accessor)
name
- the name for the accessoraccessor
- the new accessorpublic void addFieldHandler(java.lang.String fieldName, FieldHandler handler)
addFieldHandler
in class RecordAccessor
fieldName
- the data field within the DataRecordhandler
- the field handlerprotected java.util.Set<DataRecord> retrieveRecords(DataTemplate template)
retrieveRecords
in class RecordAccessor
template
- The data template specifying field mappings and
descriptionspublic void setInitParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
parameters
- a map of initialization parameterspublic void setQuery(java.lang.String queryString)
setQuery
in class AbstractDataAccessor<DataRecord,DataRecord>
queryString
- the query string