org.jumpmind.symmetric.service.impl
Class DataExtractorService

java.lang.Object
  extended by org.jumpmind.symmetric.service.impl.DataExtractorService
All Implemented Interfaces:
IDataExtractorService, org.springframework.beans.factory.BeanFactoryAware

public class DataExtractorService
extends java.lang.Object
implements IDataExtractorService, org.springframework.beans.factory.BeanFactoryAware


Field Summary
protected  org.springframework.jdbc.core.JdbcTemplate jdbcTemplate
           
protected static org.apache.commons.logging.Log logger
           
protected  IParameterService parameterService
           
 
Constructor Summary
DataExtractorService()
           
 
Method Summary
 void addExtractorFilter(IExtractorFilter extractorFilter)
           
 boolean extract(Node node, IExtractListener handler)
          Allow a handler callback to do the work so we can route the extracted data to other types of handlers for processing.
 boolean extract(Node node, IOutgoingTransport transport)
           
 boolean extractBatchRange(IExtractListener handler, java.lang.String startBatchId, java.lang.String endBatchId)
           
 boolean extractBatchRange(IOutgoingTransport transport, java.lang.String startBatchId, java.lang.String endBatchId)
           
 void extractConfiguration(Node node, java.io.BufferedWriter writer, DataExtractorContext ctx)
           
 void extractConfigurationStandalone(Node node, java.io.BufferedWriter writer)
          Extract the SymmetricDS configuration for the passed in Node.
 void extractConfigurationStandalone(Node node, java.io.OutputStream out)
           
 OutgoingBatch extractInitialLoadFor(Node node, Trigger trigger, java.io.BufferedWriter writer)
           
 void extractInitialLoadWithinBatchFor(Node node, Trigger trigger, java.io.BufferedWriter writer, DataExtractorContext ctx)
           
protected  org.springframework.jdbc.core.simple.SimpleJdbcTemplate getSimpleTemplate()
           
 java.lang.String getSql(java.lang.String key)
           
 void setAcknowledgeService(IAcknowledgeService acknowledgeService)
           
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
           
 void setConfigurationService(IConfigurationService configurationService)
           
 void setContext(DataExtractorContext context)
           
 void setDbDialect(IDbDialect dialect)
           
 void setExtractorFilters(java.util.List<IExtractorFilter> extractorFilters)
           
 void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbc)
           
 void setNodeService(INodeService nodeService)
           
 void setOutgoingBatchService(IOutgoingBatchService batchBuilderService)
           
 void setParameterService(IParameterService parameterService)
           
 void setSql(java.util.Map<java.lang.String,java.lang.String> sql)
           
protected  java.sql.SQLException unwrapSqlException(java.lang.Throwable e)
           
protected  void writeInitialLoad(Node node, Trigger trigger, java.io.BufferedWriter writer, OutgoingBatch batch, DataExtractorContext ctx)
           
protected  void writeInitialLoad(Node node, Trigger trigger, TriggerHistory hist, java.io.BufferedWriter writer, OutgoingBatch batch, DataExtractorContext ctx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.commons.logging.Log logger

parameterService

protected IParameterService parameterService

jdbcTemplate

protected org.springframework.jdbc.core.JdbcTemplate jdbcTemplate
Constructor Detail

DataExtractorService

public DataExtractorService()
Method Detail

extractConfigurationStandalone

public void extractConfigurationStandalone(Node node,
                                           java.io.OutputStream out)
                                    throws java.io.IOException
Specified by:
extractConfigurationStandalone in interface IDataExtractorService
Throws:
java.io.IOException
See Also:
extractConfigurationStandalone(Node, BufferedWriter)

extractConfigurationStandalone

public void extractConfigurationStandalone(Node node,
                                           java.io.BufferedWriter writer)
                                    throws java.io.IOException
Extract the SymmetricDS configuration for the passed in Node. Note that this method will insert an already acknowledged batch to indicate that the configuration was sent. If the configuration fails to load for some reason on the client the batch status will NOT reflect the failure.

Specified by:
extractConfigurationStandalone in interface IDataExtractorService
Throws:
java.io.IOException

extractConfiguration

public void extractConfiguration(Node node,
                                 java.io.BufferedWriter writer,
                                 DataExtractorContext ctx)
                          throws java.io.IOException
Specified by:
extractConfiguration in interface IDataExtractorService
Throws:
java.io.IOException

extractInitialLoadFor

public OutgoingBatch extractInitialLoadFor(Node node,
                                           Trigger trigger,
                                           java.io.BufferedWriter writer)
Specified by:
extractInitialLoadFor in interface IDataExtractorService

extractInitialLoadWithinBatchFor

public void extractInitialLoadWithinBatchFor(Node node,
                                             Trigger trigger,
                                             java.io.BufferedWriter writer,
                                             DataExtractorContext ctx)
Specified by:
extractInitialLoadWithinBatchFor in interface IDataExtractorService

writeInitialLoad

protected void writeInitialLoad(Node node,
                                Trigger trigger,
                                java.io.BufferedWriter writer,
                                OutgoingBatch batch,
                                DataExtractorContext ctx)

writeInitialLoad

protected void writeInitialLoad(Node node,
                                Trigger trigger,
                                TriggerHistory hist,
                                java.io.BufferedWriter writer,
                                OutgoingBatch batch,
                                DataExtractorContext ctx)
Parameters:
node -
trigger -
hist -
transport -
batch - If null, then assume this 'initial load' is part of another batch.
ctx -

extract

public boolean extract(Node node,
                       IOutgoingTransport transport)
                throws java.lang.Exception
Specified by:
extract in interface IDataExtractorService
Returns:
true if work was done or false if there was no work to do.
Throws:
java.lang.Exception

extract

public boolean extract(Node node,
                       IExtractListener handler)
                throws java.lang.Exception
Allow a handler callback to do the work so we can route the extracted data to other types of handlers for processing.

Specified by:
extract in interface IDataExtractorService
Throws:
java.lang.Exception

extractBatchRange

public boolean extractBatchRange(IOutgoingTransport transport,
                                 java.lang.String startBatchId,
                                 java.lang.String endBatchId)
                          throws java.lang.Exception
Specified by:
extractBatchRange in interface IDataExtractorService
Throws:
java.lang.Exception

extractBatchRange

public boolean extractBatchRange(IExtractListener handler,
                                 java.lang.String startBatchId,
                                 java.lang.String endBatchId)
                          throws java.lang.Exception
Specified by:
extractBatchRange in interface IDataExtractorService
Throws:
java.lang.Exception

setOutgoingBatchService

public void setOutgoingBatchService(IOutgoingBatchService batchBuilderService)

setContext

public void setContext(DataExtractorContext context)

setDbDialect

public void setDbDialect(IDbDialect dialect)

setConfigurationService

public void setConfigurationService(IConfigurationService configurationService)

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
                    throws org.springframework.beans.BeansException
Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
Throws:
org.springframework.beans.BeansException

addExtractorFilter

public void addExtractorFilter(IExtractorFilter extractorFilter)
Specified by:
addExtractorFilter in interface IDataExtractorService

setExtractorFilters

public void setExtractorFilters(java.util.List<IExtractorFilter> extractorFilters)

setAcknowledgeService

public void setAcknowledgeService(IAcknowledgeService acknowledgeService)

setNodeService

public void setNodeService(INodeService nodeService)

setJdbcTemplate

public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbc)

getSimpleTemplate

protected org.springframework.jdbc.core.simple.SimpleJdbcTemplate getSimpleTemplate()

unwrapSqlException

protected java.sql.SQLException unwrapSqlException(java.lang.Throwable e)

setSql

public void setSql(java.util.Map<java.lang.String,java.lang.String> sql)

getSql

public java.lang.String getSql(java.lang.String key)

setParameterService

public void setParameterService(IParameterService parameterService)


Copyright © 2007-2008. All Rights Reserved.