xmlBlaster 2.1.0 API

org.xmlBlaster.contrib.replication
Class ReplicationDumper

java.lang.Object
  extended by org.xmlBlaster.contrib.replication.ReplicationDumper
All Implemented Interfaces:
ContribConstants, I_Writer, I_ContribPlugin, I_Update, ReplicationConstants, I_Timeout

public class ReplicationDumper
extends java.lang.Object
implements I_Writer, ReplicationConstants, I_Timeout


Field Summary
private  I_Update callback
           
private  long changeDumpFrequency
           
private  java.lang.String closeCmd
           
private  int count
           
private  java.io.FileWriter dumper
           
private  java.lang.String dumperFilename
           
private  java.text.DecimalFormat format
           
private  java.lang.String formatTxt
           
private  java.lang.String importLocation
           
protected  I_Info info
           
private  boolean keepDumpFiles
           
private static java.util.logging.Logger log
           
(package private)  I_Mapper mapper
           
private  long nextChangeDate
           
private  I_Parser parserForOldInUpdates
           
private  long startDate
           
private  Timeout timeout
           
 
Fields inherited from interface org.xmlBlaster.contrib.replication.ReplicationConstants
ABSOLUTE_COUNT, ACTION_ATTR, ALREADY_PROCESSED_ATTR, ALTER_ACTION, CATALOG_ATTR, CONTRIB_PERSISTENT_MAP, CREATE_ACTION, DB_ID_ATTR, DELETE_ACTION, DROP_ACTION, DUMP_ACTION, DUMP_CONTENT_ATTR, DUMP_FILENAME, DUMP_POSTFIX, END_OF_TRANSITION, EXCEPTION_ATTR, EXTRA_REPL_KEY_ATTR, GUID_ATTR, INITIAL_DATA_END, INITIAL_DATA_END_TO_REMOTE, INITIAL_DATA_ID, INITIAL_DUMP_AS_XML, INITIAL_FILES_LOCATION, INITIAL_UPDATE_COLLECT, INITIAL_UPDATE_ONLY_REGISTER, INITIAL_UPDATE_START_BATCH, INITIAL_XML_CMD, INSERT_ACTION, KEEP_TRANSACTION_OPEN, MASTER_ATTR, MAX_ENTRIES_ATTR, MESSAGE_SEQ, NUM_OF_TRANSACTIONS, OLD_CONTENT_ATTR, PURPOSE_REPLICATION, REPL_KEY_ATTR, REPL_MANAGER_SESSION, REPL_MANAGER_TOPIC, REPL_PREFIX_DEFAULT, REPL_PREFIX_GROUP_KEY, REPL_PREFIX_KEY, REPL_REQUEST_CANCEL_UPDATE, REPL_REQUEST_RECREATE_TRIGGERS, REPL_REQUEST_UPDATE, REPL_VERSION, REPLICATION_CMD, REPLICATION_FORCE_SENDING, REPLICATION_MAX_ENTRIES_DEFAULT, REPLICATION_MAX_ENTRIES_KEY, REPLICATION_SEND_UNCHANGED_UPDATES, REPLICATION_VERSION, REQUEST_BROADCAST_SQL_TOPIC, REQUEST_CANCEL_UPDATE_TOPIC, REQUEST_INITIAL_DATA_TOPIC, REQUEST_RECREATE_TRIGGERS, RESPONSE_INITIAL_DATA_TOPIC, SCHEMA_ATTR, SIMPLE_MESSAGE, SLAVE_NAME, SQL_TOPIC_ATTR, STATEMENT_ACTION, STATEMENT_ATTR, STATEMENT_ID_ATTR, STATEMENT_PRIO_ATTR, SUPPORTED_VERSIONS, TABLE_NAME_ATTR, TRANSACTION_ATTR, TRANSACTION_SEQ, UPDATE_ACTION, VERSION_ATTR, VERSION_TOKEN
 
Fields inherited from interface org.xmlBlaster.contrib.ContribConstants
FILE_DATE, FILENAME_ATTR, FILENAME_ATTR_OLD_FASHION, SUBDIR_ATTR, TIMESTAMP_ATTR, TOPIC_NAME
 
Constructor Summary
ReplicationDumper()
           
 
Method Summary
private  void changeDumpFile()
           
private  boolean changeTimeReached()
           
private  void copyFile(java.lang.String inFile, java.lang.String outFile)
           
private  void deleteFiles(java.util.Map attrMap)
           
private  void deleteFiles(java.lang.String filename)
           
private  java.lang.String getCompleteFileName(java.lang.String filename)
           
private  int getIndex(java.lang.String filename)
           
private  int getInitialCount()
           
 java.util.Set getUsedPropertyKeys()
          Gets all property keys which may be used by this object.
 void init(I_Info info_)
           
 void shutdown()
           
 void store(SqlInfo dbInfo)
           
 void timeout(java.lang.Object userData)
          You will be notified about the timeout through this method.
 void update(java.lang.String topic, java.io.InputStream is, java.util.Map attrMap)
          The message received from the MoM or from another source.
private  void updateDump(java.lang.String topic, java.io.InputStream is, java.util.Map attrMap)
          This is invoked for dump files
private  void updateManualTransfer(java.lang.String topic, java.io.InputStream is, java.util.Map attrMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static java.util.logging.Logger log

info

protected I_Info info

mapper

I_Mapper mapper

importLocation

private java.lang.String importLocation

callback

private I_Update callback

keepDumpFiles

private boolean keepDumpFiles

parserForOldInUpdates

private I_Parser parserForOldInUpdates

dumper

private java.io.FileWriter dumper

dumperFilename

private java.lang.String dumperFilename

count

private int count

changeDumpFrequency

private long changeDumpFrequency

nextChangeDate

private long nextChangeDate

startDate

private long startDate

closeCmd

private java.lang.String closeCmd

timeout

private Timeout timeout

format

private java.text.DecimalFormat format

formatTxt

private java.lang.String formatTxt
Constructor Detail

ReplicationDumper

public ReplicationDumper()
Method Detail

getUsedPropertyKeys

public java.util.Set getUsedPropertyKeys()
Description copied from interface: I_ContribPlugin
Gets all property keys which may be used by this object.

Specified by:
getUsedPropertyKeys in interface I_ContribPlugin
Returns:
See Also:
I_ContribPlugin.getUsedPropertyKeys()

init

public void init(I_Info info_)
          throws java.lang.Exception
Specified by:
init in interface I_ContribPlugin
Throws:
java.lang.Exception

copyFile

private void copyFile(java.lang.String inFile,
                      java.lang.String outFile)
               throws java.io.IOException
Throws:
java.io.IOException

getInitialCount

private int getInitialCount()

getIndex

private int getIndex(java.lang.String filename)

changeDumpFile

private void changeDumpFile()
                     throws java.lang.Exception
Throws:
java.lang.Exception

shutdown

public void shutdown()
              throws java.lang.Exception
Specified by:
shutdown in interface I_ContribPlugin
Throws:
java.lang.Exception
See Also:
I_Plugin

store

public void store(SqlInfo dbInfo)
           throws java.lang.Exception
Specified by:
store in interface I_Writer
Throws:
java.lang.Exception

changeTimeReached

private boolean changeTimeReached()

getCompleteFileName

private final java.lang.String getCompleteFileName(java.lang.String filename)

deleteFiles

private void deleteFiles(java.lang.String filename)

deleteFiles

private void deleteFiles(java.util.Map attrMap)

updateDump

private void updateDump(java.lang.String topic,
                        java.io.InputStream is,
                        java.util.Map attrMap)
                 throws java.lang.Exception
This is invoked for dump files

Throws:
java.lang.Exception

updateManualTransfer

private void updateManualTransfer(java.lang.String topic,
                                  java.io.InputStream is,
                                  java.util.Map attrMap)
                           throws java.lang.Exception
Throws:
java.lang.Exception

update

public void update(java.lang.String topic,
                   java.io.InputStream is,
                   java.util.Map attrMap)
            throws java.lang.Exception
Description copied from interface: I_Update
The message received from the MoM or from another source.

Specified by:
update in interface I_Update
Parameters:
topic - The topic name
attrMap - A map with attribute, can be null
Throws:
java.lang.Exception

timeout

public void timeout(java.lang.Object userData)
Description copied from interface: I_Timeout
You will be notified about the timeout through this method.

Specified by:
timeout in interface I_Timeout
Parameters:
userData - You get bounced back your userData which you passed with Timeout.addTimeoutListener()
See Also:
I_Timeout.timeout(java.lang.Object)

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.