org.jumpmind.symmetric.ext
Class AbstractTextPublisherFilter

java.lang.Object
  extended by org.jumpmind.symmetric.ext.AbstractTextPublisherFilter
All Implemented Interfaces:
IExtensionPoint, INodeGroupExtensionPoint, IPublisherFilter, IBatchListener, IDataLoaderFilter, org.springframework.beans.factory.BeanNameAware
Direct Known Subclasses:
TemplatedPublisherFilter

public abstract class AbstractTextPublisherFilter
extends java.lang.Object
implements IPublisherFilter, INodeGroupExtensionPoint, org.springframework.beans.factory.BeanNameAware

An abstract convenience class meant to be implemented by classes that need to publish text messages


Field Summary
protected  IPublisher publisher
           
protected  java.lang.String tableName
           
 
Constructor Summary
AbstractTextPublisherFilter()
           
 
Method Summary
protected abstract  java.lang.String addTextElementForDelete(IDataLoaderContext ctx, java.lang.String[] keys)
           
protected abstract  java.lang.String addTextElementForInsert(IDataLoaderContext ctx, java.lang.String[] data)
           
protected abstract  java.lang.String addTextElementForUpdate(IDataLoaderContext ctx, java.lang.String[] data, java.lang.String[] keys)
           
protected abstract  java.lang.String addTextFooter(IDataLoaderContext ctx)
           
protected abstract  java.lang.String addTextHeader(IDataLoaderContext ctx)
           
 void batchComplete(IDataLoader loader, IncomingBatchHistory hist)
          This method is called after a batch has been successfully processed.
protected  boolean doesTextExistToPublish(IDataLoaderContext ctx)
           
 boolean filterDelete(IDataLoaderContext ctx, java.lang.String[] keys)
           
 boolean filterInsert(IDataLoaderContext ctx, java.lang.String[] data)
           
 boolean filterUpdate(IDataLoaderContext ctx, java.lang.String[] data, java.lang.String[] keys)
           
protected  java.lang.StringBuilder getFromCache(IDataLoaderContext ctx)
           
 java.lang.String[] getNodeGroupIdsToApplyTo()
           
 boolean isAutoRegister()
          Allow the plug-in implementation to specific whether the SymmetricDS runtime should auto register it or if it will register itself.
protected  void logCount()
           
 void setAutoRegister(boolean autoRegister)
           
 void setBeanName(java.lang.String name)
           
 void setLoadDataInTargetDatabase(boolean loadDataInTargetDatabase)
           
 void setMessagesSinceLastLogOutput(int messagesSinceLastLogOutput)
           
 void setMinTimeInMsBetweenLogOutput(long timeInMsBetweenLogOutput)
           
 void setNodeGroupIdToApplyTo(java.lang.String nodeGroupdId)
           
 void setPublisher(IPublisher publisher)
           
 void setTableName(java.lang.String tableName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

publisher

protected IPublisher publisher

tableName

protected java.lang.String tableName
Constructor Detail

AbstractTextPublisherFilter

public AbstractTextPublisherFilter()
Method Detail

addTextHeader

protected abstract java.lang.String addTextHeader(IDataLoaderContext ctx)

addTextElementForDelete

protected abstract java.lang.String addTextElementForDelete(IDataLoaderContext ctx,
                                                            java.lang.String[] keys)

addTextElementForUpdate

protected abstract java.lang.String addTextElementForUpdate(IDataLoaderContext ctx,
                                                            java.lang.String[] data,
                                                            java.lang.String[] keys)

addTextElementForInsert

protected abstract java.lang.String addTextElementForInsert(IDataLoaderContext ctx,
                                                            java.lang.String[] data)

addTextFooter

protected abstract java.lang.String addTextFooter(IDataLoaderContext ctx)

setBeanName

public void setBeanName(java.lang.String name)
Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware

filterDelete

public boolean filterDelete(IDataLoaderContext ctx,
                            java.lang.String[] keys)
Specified by:
filterDelete in interface IDataLoaderFilter
Returns:
true if the row should be loaded. false if the filter has handled the row and it should be ignored.

filterUpdate

public boolean filterUpdate(IDataLoaderContext ctx,
                            java.lang.String[] data,
                            java.lang.String[] keys)
Specified by:
filterUpdate in interface IDataLoaderFilter
Returns:
true if the row should be loaded. false if the filter has handled the row and it should be ignored.

filterInsert

public boolean filterInsert(IDataLoaderContext ctx,
                            java.lang.String[] data)
Specified by:
filterInsert in interface IDataLoaderFilter
Returns:
true if the row should be loaded. false if the filter has handled the row and it should be ignored.

getFromCache

protected java.lang.StringBuilder getFromCache(IDataLoaderContext ctx)

doesTextExistToPublish

protected boolean doesTextExistToPublish(IDataLoaderContext ctx)

batchComplete

public void batchComplete(IDataLoader loader,
                          IncomingBatchHistory hist)
Description copied from interface: IBatchListener
This method is called after a batch has been successfully processed. It is called in the scope of the transaction that controls the batch commit.

Specified by:
batchComplete in interface IBatchListener

logCount

protected void logCount()

setLoadDataInTargetDatabase

public void setLoadDataInTargetDatabase(boolean loadDataInTargetDatabase)

setPublisher

public void setPublisher(IPublisher publisher)
Specified by:
setPublisher in interface IPublisherFilter

setAutoRegister

public void setAutoRegister(boolean autoRegister)

isAutoRegister

public boolean isAutoRegister()
Description copied from interface: IExtensionPoint
Allow the plug-in implementation to specific whether the SymmetricDS runtime should auto register it or if it will register itself.

Specified by:
isAutoRegister in interface IExtensionPoint

getNodeGroupIdsToApplyTo

public java.lang.String[] getNodeGroupIdsToApplyTo()
Specified by:
getNodeGroupIdsToApplyTo in interface INodeGroupExtensionPoint

setNodeGroupIdToApplyTo

public void setNodeGroupIdToApplyTo(java.lang.String nodeGroupdId)

setMessagesSinceLastLogOutput

public void setMessagesSinceLastLogOutput(int messagesSinceLastLogOutput)

setMinTimeInMsBetweenLogOutput

public void setMinTimeInMsBetweenLogOutput(long timeInMsBetweenLogOutput)

setTableName

public void setTableName(java.lang.String tableName)


Copyright © 2007-2008. All Rights Reserved.