Class AbstractXmlPublisherExtensionPoint

java.lang.Object
org.jumpmind.symmetric.integrate.AbstractXmlPublisherExtensionPoint
All Implemented Interfaces:
IExtensionPoint, INodeGroupExtensionPoint, ISymmetricEngineAware, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware
Direct Known Subclasses:
XmlPublisherDatabaseWriterFilter, XmlPublisherDataRouter

@ManagedResource(description="The management interface for an xml publisher") public abstract class AbstractXmlPublisherExtensionPoint extends Object implements IExtensionPoint, INodeGroupExtensionPoint, ISymmetricEngineAware, org.springframework.beans.factory.BeanNameAware
An abstract class that accumulates data to publish.
  • Field Details

    • log

      protected final org.slf4j.Logger log
    • XML_CACHE

      protected final String XML_CACHE
    • publisher

      protected IPublisher publisher
    • tableNamesToPublishAsGroup

      protected Set<String> tableNamesToPublishAsGroup
    • xmlTagNameToUseForGroup

      protected String xmlTagNameToUseForGroup
    • groupByColumnNames

      protected List<String> groupByColumnNames
    • xmlFormat

      protected org.jdom2.output.Format xmlFormat
    • name

      protected String name
    • engine

      protected ISymmetricEngine engine
    • timeBetweenStatisticsPrintTime

      protected long timeBetweenStatisticsPrintTime
    • lastStatisticsPrintTime

      protected transient long lastStatisticsPrintTime
    • numberOfMessagesPublishedSinceLastPrintTime

      protected transient long numberOfMessagesPublishedSinceLastPrintTime
    • amountOfTimeToPublishMessagesSinceLastPrintTime

      protected transient long amountOfTimeToPublishMessagesSinceLastPrintTime
    • timeStringGenerator

  • Constructor Details

    • AbstractXmlPublisherExtensionPoint

      public AbstractXmlPublisherExtensionPoint()
  • Method Details

    • setBeanName

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

      @ManagedOperation(description="Looks up rows in the database and resends them to the publisher") @ManagedOperationParameters(@ManagedOperationParameter(name="args",description="A pipe deliminated list of key values to use to look up the tables to resend")) public boolean resend(String args)
    • getKeyColumnNames

      @ManagedAttribute(description="A comma separated list of columns that act as the key values for the tables that will be published") public String getKeyColumnNames()
    • getTableNames

      @ManagedAttribute(description="A comma separated list of tables that will be published") public String getTableNames()
    • readData

      protected List<String[]> readData(Table table, String[] args)
    • getXmlNamespace

      protected static final org.jdom2.Namespace getXmlNamespace()
    • getXmlCache

      protected Map<String,org.jdom2.Element> getXmlCache(Context context)
    • doesXmlExistToPublish

      protected boolean doesXmlExistToPublish(Context context)
    • finalizeXmlAndPublish

      protected void finalizeXmlAndPublish(Context context)
    • toXmlElement

      protected void toXmlElement(DataEventType dml, org.jdom2.Element xml, String catalogName, String schemaName, String tableName, String[] columnNames, String[] data, String[] keyNames, String[] keys)
    • replaceInvalidChars

      public String replaceInvalidChars(String in)
    • addFormattedExtraGroupAttributes

      protected void addFormattedExtraGroupAttributes(Context context, org.jdom2.Element xml)
      Give the opportunity for the user of this publisher to add in additional attributes. The default implementation adds in the nodeId from the Context.
      Parameters:
      context -
      xml - append XML attributes to this buffer
    • getXmlFromCache

      protected org.jdom2.Element getXmlFromCache(Context context, BinaryEncoding binaryEncoding, String[] columnNames, String[] data, String[] keyNames, String[] keys)
    • toXmlGroupId

      protected String toXmlGroupId(String[] columnNames, String[] data, String[] keyNames, String[] keys)
    • getNodeGroupIdsToApplyTo

      public String[] getNodeGroupIdsToApplyTo()
      Specified by:
      getNodeGroupIdsToApplyTo in interface INodeGroupExtensionPoint
    • setNodeGroups

      public void setNodeGroups(String[] nodeGroups)
    • setNodeGroup

      public void setNodeGroup(String nodeGroup)
    • setPublisher

      public void setPublisher(IPublisher publisher)
    • setTimeStringGenerator

      public void setTimeStringGenerator(AbstractXmlPublisherExtensionPoint.ITimeGenerator timeStringGenerator)
      Used to populate the time attribute of an XML message.
    • setXmlFormat

      public void setXmlFormat(org.jdom2.output.Format xmlFormat)
    • setTableNamesToPublishAsGroup

      public void setTableNamesToPublishAsGroup(Set<String> tableNamesToPublishAsGroup)
    • setTableNameToPublish

      public void setTableNameToPublish(String tableName)
    • setXmlTagNameToUseForGroup

      public void setXmlTagNameToUseForGroup(String xmlTagNameToUseForGroup)
    • setTimeBetweenStatisticsPrintTime

      public void setTimeBetweenStatisticsPrintTime(long timeBetweenStatisticsPrintTime)
    • setGroupByColumnNames

      public void setGroupByColumnNames(List<String> groupByColumnNames)
      This attribute is required. It needs to identify the columns that will be used to key on rows in the specified tables that need to be grouped together in an 'XML batch.'
    • setSymmetricEngine

      public void setSymmetricEngine(ISymmetricEngine engine)
      Specified by:
      setSymmetricEngine in interface ISymmetricEngineAware