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 AuditLogHelperauditLogHelperprotected CustomJacksonMappermapperprotected PropertyValueCachepropertyValueSweeperprotected ProvisionQueueprovisionQueueprotected RabbitMQSenderrabbitMQSenderprotected ScriptIntegrationscriptRunnerprotected SynchronisationHelpersyncHelperprotected SyncObjectProcessorFactorysyncObjectProcessorFactory
-
Constructor Summary
Constructors Constructor Description AbstractSrcAdapter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidbuildAuditLog(SynchConfig config, Throwable e, ProvisionObject provisionObject, LineObject rowObj, boolean includePO, boolean isSuccess, String description)protected StringdecryptPassword(SynchConfig config)protected StringgetLastRecGeneralizedTime(Set<SyncMetrics> metrics)for incremental sync we need to track the latest record create/modify date from target system.protected LastRecordMetricgetLastRecordMetric(Set<SyncMetrics> metrics)for incremental sync we need to track the latest record create/modify.protected StringgetObjectString(Object o)protected abstract LastRecordMetricgetRowTime(LineObject rowObj, SynchConfig config)protected booleanhasError(ValidationScript validationScript, LineObject rowObj, SynchConfig config)protected voidincrementalSyncProcessing(SynchConfig config)protected static longmean(Long[] m)protected intperformTransformationScript(List<TransformScript> transformScripts, ProvisionObject provisionObject, LineObject rowObj, SynchConfig config, List<String> errorList)protected LastRecordMetricprocessLineObject(ProvisionObject provisionObject, LineObject rowObj, SynchConfig config, ValidationScript validationScript, List<TransformScript> transformScripts, List<Orphan> orphanListToAdd, String syncActivityId, List<String> errorList)process only 1 given record.voidprocessPart(PartialDataProcessingRequest request)Method is used to process part of data of global synchronization event.protected voidsetMetric(AuditLogBuilder parent, Set<SyncMetrics> metrics)protected voidsetMetric(AuditLogBuilder logBuilder, SyncMetrics newMetric)SyncResponsestartSynch(SynchConfig config)SyncResponsestartSynch(SynchConfig config, List<LineObject> targetSystemObjects)protected static longsum(Long[] m)protected abstract booleanvalidatePartsGeneration(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 $LineObjectrow 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:
processPartin interfaceSourceAdapter- Parameters:
request- request from the root synchronization event.
-
startSynch
public SyncResponse startSynch(SynchConfig config) throws BasicDataServiceException
- Specified by:
startSynchin interfaceSourceAdapter- Throws:
BasicDataServiceException
-
startSynch
public SyncResponse startSynch(SynchConfig config, List<LineObject> targetSystemObjects) throws BasicDataServiceException
- Specified by:
startSynchin interfaceSourceAdapter- Throws:
BasicDataServiceException
-
buildAuditLog
public void buildAuditLog(SynchConfig config, Throwable e, ProvisionObject provisionObject, LineObject rowObj, boolean includePO, boolean isSuccess, String description)
-
-