public class ReconLinkProcessor extends java.lang.Object implements ReconLinkerI
Modifier and Type | Field and Description |
---|---|
protected java.util.Map |
attributeToIndex1 |
protected java.util.Map |
attributeToIndex2 |
protected java.util.List |
cascadingRules
input: the cascading link rules
|
protected ReconValueSet |
dataSet1ValueSet
input: the data set 1
|
protected ReconValueSet |
dataSet2ValueSet
input: the data set 2
|
protected static int |
KEYS_IN_LIST
numbers of database keys to be grouped for the in() clause of a delete
statement
|
protected LinkResult |
linkResult |
protected ReconInfo |
reconInfo
Contains reference to the recon info class.
|
protected boolean |
saveResult |
protected TaskFilter |
taskFilter
Reconciliation task filter if one exists
|
protected java.util.List |
unlinkedLeadingDataSetItems
leading data items that failed to link
|
Constructor and Description |
---|
ReconLinkProcessor(ReconInfo reconInfo) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map |
buildAttributeToIndexMap(DataSet ds,
ReconValueSet dsValueSet)
Method returns a HashMap containing linking between an attribute name and
the original attribute name.
|
protected void |
deleteFromLinkTable(java.lang.String tableName,
DBShortcut dbShortcut,
java.util.Iterator keys) |
protected void |
deleteFromReconlink(DBShortcut dbShortcut,
java.util.Iterator keys)
Deletes from table reconlink old results.
|
protected void |
deleteFromReconMultilink(DBShortcut dbShortcut,
java.util.Iterator keys) |
protected void |
deleteListedKeys(DBShortcut dbShortcut,
java.lang.String partialDeleteStatement,
java.util.List keyGroup)
Appends key values to a partial delete statement and executes it.
|
protected java.util.Set |
extractMatchingAttributes(java.util.Map matchingAttributeNameByExpression,
boolean forLeadingDataSet)
Extracts matching attributes.
|
protected SubordinateSetAttribute[] |
extractSubordinateSetAttributes(ReconValueSet subordinateDataSet)
Builds an array of attribute sets - one element for every separate
attribute.
|
protected int |
findAttributeIndex(java.lang.String attributeName,
boolean forLeadingDataSet)
Finds the index of an attribute by name.
|
protected java.lang.String |
getAssetidFieldName(DataSet dataset) |
LinkResult |
getLinkResult() |
java.util.List |
getUnlinked() |
boolean |
isSaveResult() |
java.util.Map[][] |
link()
Links data from one data set to the data of another data set.
|
protected void |
loadData()
Loads data for the linking from the database.
|
protected void |
loadTaskFilter()
Loads the attributes from the specified task filter.
|
protected void |
processLeadingSet(ReconValueSet leadingSet,
SubordinateSetAttribute[] subordinateSetAttributes)
Does the actual linking of leading set and subordinate set.
|
protected void |
registerMultilinkedData(java.util.Map multilinkedSet,
ReconValue multilinkedObject,
ReconLinkExpression cascadingRule)
Registers data which got multiple linkings.
|
void |
setSaveResult(boolean saveResult) |
protected void |
writeLeadingSetErrors(java.util.List failedLinks,
DBShortcut dbShortcut)
Writes out the errors from linking the data from the leading set.
|
protected java.util.Map[][] |
writeLinkPhaseOutputs(ReconValueSet leadingSet)
Writes the outputs of the linking phase.
|
protected void |
writeLinkSuccessPairs(DBShortcut dbShortcut,
java.util.List successfulLinks,
java.util.Map[][] ret)
Writes out the successfully linked items.
|
protected void |
writeSubordinateSetErrors(DBShortcut dbShortcut,
java.util.List failedLinks)
Writes out the errors from linking data from the subordinate data set.
|
protected ReconInfo reconInfo
protected TaskFilter taskFilter
protected ReconValueSet dataSet1ValueSet
protected ReconValueSet dataSet2ValueSet
protected java.util.List cascadingRules
protected java.util.Map attributeToIndex1
protected java.util.Map attributeToIndex2
protected LinkResult linkResult
protected java.util.List unlinkedLeadingDataSetItems
protected static final int KEYS_IN_LIST
protected boolean saveResult
public ReconLinkProcessor(ReconInfo reconInfo) throws java.rmi.RemoteException, MXException, MXApplicationException
java.rmi.RemoteException
MXException
MXApplicationException
protected java.util.Map buildAttributeToIndexMap(DataSet ds, ReconValueSet dsValueSet) throws java.rmi.RemoteException, MXException
ds
- dsValueSet
- java.rmi.RemoteException
MXException
protected void loadTaskFilter() throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
protected void loadData() throws MXException, java.rmi.RemoteException, java.sql.SQLException
MXException
java.rmi.RemoteException
java.sql.SQLException
public java.util.Map[][] link() throws MXException, java.rmi.RemoteException, java.sql.SQLException
link
in interface ReconLinkerI
MXException
java.rmi.RemoteException
java.sql.SQLException
protected void deleteListedKeys(DBShortcut dbShortcut, java.lang.String partialDeleteStatement, java.util.List keyGroup) throws MXException, java.sql.SQLException, java.rmi.RemoteException
deleteStatement
- -
the part of the delete statement to which keys are appendedkeyGroup
- -
list of key values as String objectsMXException
java.sql.SQLException
java.rmi.RemoteException
protected void deleteFromReconlink(DBShortcut dbShortcut, java.util.Iterator keys) throws MXException, java.sql.SQLException, java.rmi.RemoteException
keys
- An iterator to a container that contains ReconValue objects -
each of them has one key value to be deleted from the
reconlink table. The method will figure out whether to use
ASSETID or NODEID based on the type of the first element
returned by the iteratorMXException
java.sql.SQLException
java.rmi.RemoteException
protected void deleteFromReconMultilink(DBShortcut dbShortcut, java.util.Iterator keys) throws MXException, java.sql.SQLException, java.rmi.RemoteException
MXException
java.sql.SQLException
java.rmi.RemoteException
protected void deleteFromLinkTable(java.lang.String tableName, DBShortcut dbShortcut, java.util.Iterator keys) throws MXException, java.sql.SQLException, java.rmi.RemoteException
MXException
java.sql.SQLException
java.rmi.RemoteException
protected java.lang.String getAssetidFieldName(DataSet dataset) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
protected void writeLinkSuccessPairs(DBShortcut dbShortcut, java.util.List successfulLinks, java.util.Map[][] ret) throws MXException, java.sql.SQLException, java.rmi.RemoteException
dbShortcut
- - db connection.leadingSet
- - the leading set of data.ret
- - the set of linked items.MXException
java.sql.SQLException
java.rmi.RemoteException
protected int findAttributeIndex(java.lang.String attributeName, boolean forLeadingDataSet)
attributeName
- - the name of the attribute.forLeadingDataSet
- - is it for leading or subordinate data set?protected java.util.Set extractMatchingAttributes(java.util.Map matchingAttributeNameByExpression, boolean forLeadingDataSet)
matchingAttributeNameByExpression
- protected void writeLeadingSetErrors(java.util.List failedLinks, DBShortcut dbShortcut) throws MXException, java.sql.SQLException, java.rmi.RemoteException
dbShortcut
- - db connection.MXException
java.sql.SQLException
java.rmi.RemoteException
protected void writeSubordinateSetErrors(DBShortcut dbShortcut, java.util.List failedLinks) throws MXException, java.sql.SQLException, java.rmi.RemoteException
dbShortcut
- - db connection.MXException
java.sql.SQLException
java.rmi.RemoteException
protected java.util.Map[][] writeLinkPhaseOutputs(ReconValueSet leadingSet) throws MXApplicationException, java.rmi.RemoteException
leadingSet
- - the leading set of data to link.MXApplicationException
java.rmi.RemoteException
protected void processLeadingSet(ReconValueSet leadingSet, SubordinateSetAttribute[] subordinateSetAttributes) throws MXException
leadingSet
- - the leading set of the data to link.subordinateSetAttributes
- - the set of attributes for the subordinate set.MXException
protected void registerMultilinkedData(java.util.Map multilinkedSet, ReconValue multilinkedObject, ReconLinkExpression cascadingRule)
multilinkedSet
- - data multilinked.multilinkedObject
- - a multilinked object.cascadingRule
- - a cascading rule.protected SubordinateSetAttribute[] extractSubordinateSetAttributes(ReconValueSet subordinateDataSet)
subordinateDataSet
- psdi.app.recontask.engine.ValueSet.preprocessAttributes
public boolean isSaveResult()
public void setSaveResult(boolean saveResult)
public LinkResult getLinkResult()
public java.util.List getUnlinked()