|
xmlBlaster 2.2.0 contributions API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface I_DbSpecific
Field Summary | |
---|---|
static java.lang.String |
NEEDS_PUBLISHER_KEY
key for the property defining if the publisher is needed on the implementation of this interface. |
static boolean[] |
WIPEOUT_ALL
|
static int |
WIPEOUT_FUNCTIONS
|
static int |
WIPEOUT_INDEXES
|
static boolean[] |
WIPEOUT_NO_TABLES
|
static boolean[] |
WIPEOUT_ONLY_TABLES
|
static int |
WIPEOUT_PACKAGES
|
static int |
WIPEOUT_PROCEDURES
|
static int |
WIPEOUT_SEQUENCES
|
static int |
WIPEOUT_SYNONYMS
|
static int |
WIPEOUT_TABLES
|
static int |
WIPEOUT_TRIGGERS
|
static int |
WIPEOUT_VIEWS
|
Method Summary | |
---|---|
void |
addSchemaToWatch(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String schema)
Adds a schema to be watched. |
boolean |
addTableToWatch(TableToWatchInfo tableToWatch,
boolean force,
java.lang.String[] destinations,
boolean forceSend)
Adds a table to be watcher/replicated. |
void |
addTrigger(java.sql.Connection conn,
java.lang.String catalog,
java.lang.String schema,
java.lang.String tableName)
|
void |
addTriggersIfNeeded(boolean force,
java.lang.String[] destinations,
boolean forceSend)
Creates the necessary triggers if needed, i.e. |
void |
bootstrap(java.sql.Connection conn,
boolean doWarn,
boolean force)
This method is invoked for the initial setup of the database. |
byte[] |
broadcastStatement(java.lang.String sql,
long maxResponseEntries,
boolean isHighPrio,
boolean isMaster,
java.lang.String sqlTopic,
java.lang.String statementId)
broadcasts a statement to be replicated. |
void |
cancelUpdate(java.lang.String replSlave)
Tells the DbSpecific to cancel the ongoing initial update for the given slave. |
void |
checkTriggerConsistency(boolean doFix)
Checks if the triggers are consistent, i.e. |
void |
cleanup(java.sql.Connection conn,
boolean doWarn)
This method is invoked for the cleanup while testing. |
void |
clearCancelUpdate(java.lang.String replSlave)
Tells the DbSpecific to clear the cancel flag for ongoing updates for the given slave. |
java.lang.String |
createTableTrigger(SqlDescription infoDescription,
TableToWatchInfo tableToWatch)
Creates a string containing the trigger of the table to be watched. |
void |
forceTableChangeCheck()
Invokes the function to check wether a table has been created, dropped or altered. |
java.lang.StringBuffer |
getColumnStatement(SqlColumn colInfoDescription)
This method should actually be protected since it is not used on the outside. |
java.lang.String |
getContentFromGuid(java.lang.String guid,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
I_AttributeTransformer transformer)
This is used for cases where it was not possible to retrieve the (new) content of an entry synchronously in the PL/SQL Code. |
java.lang.String |
getCreateTableStatement(SqlDescription infoDescription,
I_Mapper mapper)
Returns the statement necessary to create a new table. |
java.lang.String |
getName()
|
long |
incrementReplKey(java.sql.Connection conn)
Increments and retreives the repl_key sequence counter. |
void |
initialCommand(java.lang.String[] slaveNames,
java.lang.String completeFilename,
java.lang.String version)
This is the intial command which is invoked on the OS. |
void |
initialCommandPre()
This is the command/script which is invoked before cleaning up resources on the initial update on the slave side (before the wipeout of the schema to be replicated). |
void |
initiateUpdate(java.lang.String topic,
java.lang.String replManagerAddress,
java.lang.String[] slaveName,
java.lang.String version,
java.lang.String initialFilesLocation)
Initiates an initial update. |
boolean |
isDatasourceReadonly()
|
void |
readNewTable(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.util.Map attrs,
boolean sendInitialContents)
Reads the metadata and content of the specified table. |
void |
removeTableToWatch(TableToWatchInfo tableToWatch,
boolean removeAlsoSchemaTrigger)
Removes a table from the repl_tables. |
boolean |
removeTrigger(java.lang.String triggerName,
java.lang.String tableName,
boolean isSchemaTrigger)
removes the specified trigger from the specified table. |
void |
setAttributeTransformer(I_AttributeTransformer transformer)
|
boolean |
triggerExists(java.sql.Connection conn,
TableToWatchInfo tableToWatch)
Checks wether a trigger really exists or not. |
int |
wipeoutSchema(java.lang.String catalog,
java.lang.String schema,
boolean[] objectsToWipeout)
Cleans up the complete schema. |
Methods inherited from interface org.xmlBlaster.contrib.I_ContribPlugin |
---|
getUsedPropertyKeys, init, shutdown |
Field Detail |
---|
static final int WIPEOUT_TRIGGERS
static final int WIPEOUT_SEQUENCES
static final int WIPEOUT_FUNCTIONS
static final int WIPEOUT_PACKAGES
static final int WIPEOUT_PROCEDURES
static final int WIPEOUT_VIEWS
static final int WIPEOUT_TABLES
static final int WIPEOUT_SYNONYMS
static final int WIPEOUT_INDEXES
static final boolean[] WIPEOUT_ALL
static final boolean[] WIPEOUT_ONLY_TABLES
static final boolean[] WIPEOUT_NO_TABLES
static final java.lang.String NEEDS_PUBLISHER_KEY
Method Detail |
---|
void bootstrap(java.sql.Connection conn, boolean doWarn, boolean force) throws java.lang.Exception
conn
- doWarn
- if false no warning is given on excrption.force
- if true, then everything is cleaned up, if false, then tables and sequences are
only rebuilt if not existing.
java.lang.Exception
void cleanup(java.sql.Connection conn, boolean doWarn) throws java.lang.Exception
conn
- doWarn
- if false no warning is given on excrption.
java.lang.Exception
void readNewTable(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.util.Map attrs, boolean sendInitialContents) throws java.lang.Exception
catalog
- can be nullschema
- can be nulltable
- can not be nullattrs
- can be nullsendInitialContents
- if true it will send all the contents of the added table, if false it
will not send anything. So normally if you made a dump of the Database you don't want
to send all the content of the tables again.attrs
- the attributes to pass to the description object when publishing. It basically contains the
information about the metadata of an entry (the columns in repl_items without the old and new contents).
Note that the values of such map are normally Strings, while the SqlInfo objects contain attributes where
the value is a ClientProperty. That conversion is handled by the SqlDescription object.
java.lang.Exception
java.lang.String getCreateTableStatement(SqlDescription infoDescription, I_Mapper mapper)
infoDescription
- The description from which to create the statement.mapper
- the mapper to convert the table name (and in future the column names). Can be null,
if null, no mapping is done.
java.lang.String createTableTrigger(SqlDescription infoDescription, TableToWatchInfo tableToWatch)
infoDescription
- triggerName
- the name to give to the trigger associated with this table,
void forceTableChangeCheck() throws java.lang.Exception
java.lang.Exception
long incrementReplKey(java.sql.Connection conn) throws java.lang.Exception
conn
- the connection (it must not be null)
java.lang.Exception
- if an exception occurs.boolean addTableToWatch(TableToWatchInfo tableToWatch, boolean force, java.lang.String[] destinations, boolean forceSend) throws java.lang.Exception
catalog
- the name of the catalog to use. If null, an empty string is stored (since part of the PK)schema
- the name of the schema to use. If null, an empty string is stored (since part of the PK).tableName
- the name of the table to be added.replFlags
- is a String containing a combination of 'IDU' (I)nsert, (U)pdate and (D)elete.
If null or emtpy, then the trigger used to detect stuff to be replicated is not put anywhere, it
is equivalent to not to replicate. If you pass I, then only inserts are performed.
You normally will pass IDU' here.triggerName
- is the name which will be given to the trigger to add to the table. Can be null. If null
is passed, then a name is choosed by the application. It is good practice to provide with a unique name.force
- if true, then the trigger is added even if it exists already.destinations
- can be null. If it has to be sent to an individual client you pass its session name here.
If you pass null, then it is published in pub/sub modus. If you want to publish it to more than one client,
you pass more destinations.forceSend
- if true, all content data of the table will be sent.
java.lang.Exception
- if an exception occurs on the backend. For example if the table already has been
added, it will throw an exception.void addSchemaToWatch(java.sql.Connection conn, java.lang.String catalog, java.lang.String schema) throws java.lang.Exception
catalog
- schema
-
java.lang.Exception
void removeTableToWatch(TableToWatchInfo tableToWatch, boolean removeAlsoSchemaTrigger) throws java.lang.Exception
tableToWatch
- removeAlsoSchemaTrigger
- if true it will also remove the associated schema trigger.
java.lang.Exception
java.lang.StringBuffer getColumnStatement(SqlColumn colInfoDescription)
colInfoDescription
- The info object describing this column.
void initiateUpdate(java.lang.String topic, java.lang.String replManagerAddress, java.lang.String[] slaveName, java.lang.String version, java.lang.String initialFilesLocation) throws java.lang.Exception
topic
- replManagerAddress
- the address to which to send acknowleges.slaveName
- the name of the slave interested in these updatesversion
- the version for which to start replication. If null the current versioninitialFilesLocation
- tells where to store the initial files in case the replication data
has to be transfered manually by means of copying files.
is ment.
java.lang.Exception
void initialCommand(java.lang.String[] slaveNames, java.lang.String completeFilename, java.lang.String version) throws java.lang.Exception
slaveNames
- an array containing the slaveNames to be updated. can be null.completeFilename
- the filename to be used to execute.version
- the version for which to start replication. If null the current version
is ment.
java.lang.Exception
void initialCommandPre() throws java.lang.Exception
java.lang.Exception
- if an exception occurs when executing the script.boolean removeTrigger(java.lang.String triggerName, java.lang.String tableName, boolean isSchemaTrigger)
triggerName
- tableName
- isSchemaTrigger
- true if the trigger to be removed is a schema trigger.
java.lang.Exception
int wipeoutSchema(java.lang.String catalog, java.lang.String schema, boolean[] objectsToWipeout) throws java.lang.Exception
catalog
- schema
- objectsToWipeout
- a boolean[] array containing 9 elements telling wether the specified objects of a certain
type have to be wiped out or not. For the relationship between position and meaning see the static variables.
If you pass null here all object types are wiped out.
java.lang.Exception
java.lang.String getContentFromGuid(java.lang.String guid, java.lang.String catalog, java.lang.String schema, java.lang.String table, I_AttributeTransformer transformer) throws java.lang.Exception
guid
- the unique Id identifying this entry. This is needed. Can not be nullcatalog
- can be nullschema
- can be nulltable
- must be defined (can not be null).transformer
- An optional plugin
java.lang.Exception
java.lang.String getName()
void addTriggersIfNeeded(boolean force, java.lang.String[] destinations, boolean forceSend) throws java.lang.Exception
force
- to force recreation of triggers even if they exist already.
java.lang.Exception
boolean triggerExists(java.sql.Connection conn, TableToWatchInfo tableToWatch) throws java.lang.Exception
tableToWatch
- The object containing the table to be checked for trigger
java.lang.Exception
- If an exception occurs in the backend.void checkTriggerConsistency(boolean doFix) throws java.lang.Exception
doFix
-
java.lang.Exception
byte[] broadcastStatement(java.lang.String sql, long maxResponseEntries, boolean isHighPrio, boolean isMaster, java.lang.String sqlTopic, java.lang.String statementId) throws java.lang.Exception
sql
- maxResponseEntries
- isHighPrio
- isMaster
- true if it is on the master side, i.e. in the DbWatcher. Then it will first put an entry in the
ITEMS table and thereafter execute the statement.sqlTopic
- the topic on which the response will be published.statementId
- The unique Id identifying this statement. This will also be the topic on which the response is sent.
java.lang.Exception
void cancelUpdate(java.lang.String replSlave)
replSlave
- the String identifying the slave name.void clearCancelUpdate(java.lang.String replSlave)
replSlave
- the String identifying the slave name.void setAttributeTransformer(I_AttributeTransformer transformer)
boolean isDatasourceReadonly()
void addTrigger(java.sql.Connection conn, java.lang.String catalog, java.lang.String schema, java.lang.String tableName) throws java.lang.Exception
java.lang.Exception
|
xmlBlaster 2.2.0 contributions API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |