Class AbstractSrcAdapter
- java.lang.Object
-
- org.openiam.sync.service.impl.srcadapter.adapters.AbstractSrcAdapter
-
- All Implemented Interfaces:
SourceAdapter
- Direct Known Subclasses:
ConnectorAdapter
,CSVAdapter
,LogAdapter
,RDBMSAdapter
public abstract class AbstractSrcAdapter extends Object implements SourceAdapter
Abstract class which all Source System adapters must extend User: Suneet Shah Date: 3/10/11 Time: 6:18 PM To change this template use File | Settings | File Templates.
-
-
Field Summary
Fields Modifier and Type Field Description protected AuditLogHelper
auditLogHelper
protected CustomJacksonMapper
mapper
protected PropertyValueCache
propertyValueSweeper
protected ProvisionQueue
provisionQueue
protected RabbitMQSender
rabbitMQSender
protected ScriptIntegration
scriptRunner
protected SynchronisationHelper
syncHelper
protected SyncObjectProcessorFactory
syncObjectProcessorFactory
-
Constructor Summary
Constructors Constructor Description AbstractSrcAdapter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
buildAuditLog(SynchConfig config, Throwable e, ProvisionObject provisionObject, LineObject rowObj, boolean includePO, boolean isSuccess, String description)
protected String
decryptPassword(SynchConfig config)
protected String
getLastRecGeneralizedTime(Set<SyncMetrics> metrics)
for incremental sync we need to track the latest record create/modify date from target system.protected LastRecordMetric
getLastRecordMetric(Set<SyncMetrics> metrics)
for incremental sync we need to track the latest record create/modify.protected String
getObjectString(Object o)
protected abstract LastRecordMetric
getRowTime(LineObject rowObj, SynchConfig config)
protected boolean
hasError(ValidationScript validationScript, LineObject rowObj, SynchConfig config)
protected void
incrementalSyncProcessing(SynchConfig config)
protected static long
mean(Long[] m)
protected int
performTransformationScript(List<TransformScript> transformScripts, ProvisionObject provisionObject, LineObject rowObj, SynchConfig config, List<String> errorList)
protected LastRecordMetric
processLineObject(ProvisionObject provisionObject, LineObject rowObj, SynchConfig config, ValidationScript validationScript, List<TransformScript> transformScripts, List<Orphan> orphanListToAdd, String syncActivityId, List<String> errorList)
process only 1 given record.void
processPart(PartialDataProcessingRequest request)
Method is used to process part of data of global synchronization event.protected void
setMetric(AuditLogBuilder parent, Set<SyncMetrics> metrics)
protected void
setMetric(AuditLogBuilder logBuilder, SyncMetrics newMetric)
SyncResponse
startSynch(SynchConfig config)
SyncResponse
startSynch(SynchConfig config, List<LineObject> targetSystemObjects)
protected static long
sum(Long[] m)
protected abstract boolean
validatePartsGeneration(List<LineObject> allObjects, SynchConfig config)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openiam.sync.service.SourceAdapter
testConnection
-
-
-
-
Field Detail
-
scriptRunner
@Autowired @Qualifier("configurableGroovyScriptEngine") protected ScriptIntegration scriptRunner
-
provisionQueue
@Autowired protected ProvisionQueue provisionQueue
-
rabbitMQSender
@Autowired protected RabbitMQSender rabbitMQSender
-
auditLogHelper
@Autowired protected AuditLogHelper auditLogHelper
-
syncObjectProcessorFactory
@Autowired protected SyncObjectProcessorFactory syncObjectProcessorFactory
-
mapper
@Autowired protected CustomJacksonMapper mapper
-
propertyValueSweeper
@Autowired protected PropertyValueCache propertyValueSweeper
-
syncHelper
@Autowired protected SynchronisationHelper syncHelper
-
-
Method Detail
-
validatePartsGeneration
protected abstract boolean validatePartsGeneration(List<LineObject> allObjects, SynchConfig config)
-
getRowTime
protected abstract LastRecordMetric getRowTime(LineObject rowObj, SynchConfig config)
-
incrementalSyncProcessing
protected void incrementalSyncProcessing(SynchConfig config)
-
decryptPassword
protected String decryptPassword(SynchConfig config)
-
mean
protected static long mean(Long[] m)
-
sum
protected static long sum(Long[] m)
-
hasError
protected boolean hasError(ValidationScript validationScript, LineObject rowObj, SynchConfig config)
-
performTransformationScript
protected int performTransformationScript(List<TransformScript> transformScripts, ProvisionObject provisionObject, LineObject rowObj, SynchConfig config, List<String> errorList)
-
processLineObject
protected LastRecordMetric processLineObject(ProvisionObject provisionObject, LineObject rowObj, SynchConfig config, ValidationScript validationScript, List<TransformScript> transformScripts, List<Orphan> orphanListToAdd, String syncActivityId, List<String> errorList)
process only 1 given record. Here we are validating incoming object with validation script, after based on matchRule try to get data from DB, and after apply transformation script. If all were fine call Save Object method.- Parameters:
rowObj
- - formatted to $LineObject
row from the target systemconfig
- - synchronization configurationvalidationScript
- - instance of validation script classtransformScripts
- - instances of transformation script classorphanListToAdd
- - the list of orphans to add- Returns:
- LastRecordMetric for given row.
-
setMetric
protected void setMetric(AuditLogBuilder logBuilder, SyncMetrics newMetric)
-
setMetric
protected void setMetric(AuditLogBuilder parent, Set<SyncMetrics> metrics)
-
getLastRecGeneralizedTime
protected String getLastRecGeneralizedTime(Set<SyncMetrics> metrics)
for incremental sync we need to track the latest record create/modify date from target system.- Parameters:
metrics
- - collected record metrics- Returns:
- formatted value of LastRecordMetric $
LastRecordMetric#getGeneralizedTime()
-
getLastRecordMetric
protected LastRecordMetric getLastRecordMetric(Set<SyncMetrics> metrics)
for incremental sync we need to track the latest record create/modify.- Parameters:
metrics
- - collected record's metrics- Returns:
- LastRecordMetric for the current job (part of sync)
-
processPart
public void processPart(PartialDataProcessingRequest request)
Method is used to process part of data of global synchronization event.- Specified by:
processPart
in interfaceSourceAdapter
- Parameters:
request
- request from the root synchronization event.
-
startSynch
public SyncResponse startSynch(SynchConfig config) throws BasicDataServiceException
- Specified by:
startSynch
in interfaceSourceAdapter
- Throws:
BasicDataServiceException
-
startSynch
public SyncResponse startSynch(SynchConfig config, List<LineObject> targetSystemObjects) throws BasicDataServiceException
- Specified by:
startSynch
in interfaceSourceAdapter
- Throws:
BasicDataServiceException
-
buildAuditLog
public void buildAuditLog(SynchConfig config, Throwable e, ProvisionObject provisionObject, LineObject rowObj, boolean includePO, boolean isSuccess, String description)
-
-