|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.contrib.replication.TableToWatchInfo
public class TableToWatchInfo
TableToWatchInfo is a place holder (as an ejb) for data which is stored in the ${replPrefix}tables table. It also offers facility to retrieve the data from info objects.
Field Summary | |
---|---|
static java.lang.String |
ACTION_KEY
|
private java.lang.String |
actions
flags which are set mean the replication does happen for these flags. |
static java.lang.String |
ALL_TOKEN
|
private java.lang.String |
catalog
|
private long |
debug
|
static java.lang.String |
EMPTY
|
static java.lang.String |
KEY_SEP
|
private static java.util.logging.Logger |
log
|
private long |
replKey
|
private java.lang.String |
schema
|
static java.lang.String |
SCHEMA_PREFIX
|
static java.lang.String |
SEQUENCE_KEY
|
private java.lang.String |
status
|
static java.lang.String |
STATUS_CREATING
|
static java.lang.String |
STATUS_OK
|
static java.lang.String |
STATUS_REMOVE
|
private java.lang.String |
table
|
static java.lang.String |
TABLE_PREFIX
|
static java.lang.String |
TABLE_PREFIX_WITH_SEP
this is used as the prefix for all tables to replicate |
private java.lang.String |
trigger
|
static java.lang.String |
TRIGGER_KEY
|
static java.lang.String |
VAL_SEP
|
Constructor Summary | |
---|---|
TableToWatchInfo()
|
|
TableToWatchInfo(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
|
Method Summary | |
---|---|
void |
assignFromInfoPair(java.lang.String key,
java.lang.String value)
Parses the data which is passed as a key/value pair. |
private static boolean |
checkIfForeignKeysAreResolved(SqlDescription desc,
java.util.Set setOfProcessedTables,
java.util.Map allTables)
Checks if there are foreign keys which are not resolved yet |
static TableToWatchInfo |
get(java.sql.Connection conn,
java.lang.String tableName,
java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
TableToWatchInfo tableToWatch)
|
private static TableToWatchInfo |
get(java.sql.ResultSet rs,
TableToWatchInfo tableToWatch)
|
java.lang.String |
getActions()
|
static TableToWatchInfo[] |
getAll(java.sql.Connection conn,
java.lang.String confTableName)
Gets the entire configuration information of the configuration table specified in the argument list. |
java.lang.String |
getCatalog()
|
java.lang.String |
getConfigKey()
|
java.lang.String |
getConfigValue()
|
int |
getDebug()
|
long |
getReplKey()
|
java.lang.String |
getSchema()
|
static java.lang.String |
getSortedTablesToWatch(java.sql.Connection conn,
I_Info info,
java.util.List outputSequence)
|
java.lang.String |
getStatus()
|
java.lang.String |
getTable()
|
private static java.lang.String[] |
getTablesForSchema(java.lang.String prefixToAdd,
java.sql.Connection conn,
TableToWatchInfo tableToWatch)
Returns all table names for the given catalog and schema. |
static TableToWatchInfo[] |
getTablesToWatch(java.sql.Connection conn,
I_Info originalInfo)
Gets an array containing all the tables to watch found in this configuration info object. |
java.lang.String |
getTrigger()
|
boolean |
isReplicate()
|
boolean |
isStatusOk(I_DbSpecific dbSpecific,
java.sql.Connection conn)
Checks if the status is OK. |
private void |
parseKey(java.lang.String key)
Parses the key and fills this object appropriately. |
private void |
parseValue(java.lang.String val)
Parses the value and fills the object appropriately. |
void |
removeFromDb(java.lang.String replicationPrefix,
I_DbPool dbPool)
|
void |
setActions(java.lang.String actions)
|
void |
setCatalog(java.lang.String catalog)
|
void |
setDebug(int debug)
|
void |
setReplKey(long replKey)
|
void |
setSchema(java.lang.String schema)
|
void |
setStatus(java.lang.String status)
|
void |
setTable(java.lang.String table)
|
void |
setTrigger(java.lang.String trigger)
|
void |
store(java.lang.String replPrefix,
I_DbPool dbPool,
java.sql.Connection conn)
First checks if the entry exists already. |
void |
storeStatus(java.lang.String replicationPrefix,
I_DbPool dbPool)
|
java.lang.String |
toXml()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.logging.Logger log
public static final java.lang.String ACTION_KEY
public static final java.lang.String TRIGGER_KEY
public static final java.lang.String SEQUENCE_KEY
public static final java.lang.String STATUS_CREATING
public static final java.lang.String STATUS_OK
public static final java.lang.String STATUS_REMOVE
private java.lang.String catalog
private java.lang.String schema
private java.lang.String table
private java.lang.String status
private long replKey
private java.lang.String trigger
private long debug
private java.lang.String actions
public static final java.lang.String TABLE_PREFIX
public static final java.lang.String SCHEMA_PREFIX
public static final java.lang.String KEY_SEP
public static final java.lang.String VAL_SEP
public static final java.lang.String EMPTY
public static final java.lang.String ALL_TOKEN
public static final java.lang.String TABLE_PREFIX_WITH_SEP
Constructor Detail |
---|
public TableToWatchInfo()
public TableToWatchInfo(java.lang.String catalog, java.lang.String schema, java.lang.String table)
Method Detail |
---|
private static boolean checkIfForeignKeysAreResolved(SqlDescription desc, java.util.Set setOfProcessedTables, java.util.Map allTables) throws java.lang.Exception
java.lang.Exception
private static final java.lang.String[] getTablesForSchema(java.lang.String prefixToAdd, java.sql.Connection conn, TableToWatchInfo tableToWatch) throws java.sql.SQLException
prefixToAdd
- the prefix to be added to the table names, if null nothing is added.conn
- the connection to be used.tableToWatch
- The tableToWatch object containing the name of the catalog and schema
java.lang.Exception
- if an exception on the backend occurs.
java.sql.SQLException
public static java.lang.String getSortedTablesToWatch(java.sql.Connection conn, I_Info info, java.util.List outputSequence) throws java.lang.Exception
java.lang.Exception
public static TableToWatchInfo[] getTablesToWatch(java.sql.Connection conn, I_Info originalInfo) throws java.lang.Exception
info
-
java.lang.Exception
private final void parseKey(java.lang.String key) throws java.lang.Exception
key
-
java.lang.Exception
public java.lang.String getConfigKey()
public java.lang.String getConfigValue()
private final void parseValue(java.lang.String val) throws java.lang.Exception
val
-
java.lang.Exception
public void assignFromInfoPair(java.lang.String key, java.lang.String value) throws java.lang.Exception
key
- value
-
java.lang.Exception
public java.lang.String getCatalog()
public void setCatalog(java.lang.String catalog)
catalog
- The catalog to set.public boolean isReplicate()
public void setActions(java.lang.String actions)
replicate
- The replicate to set.public long getReplKey()
public void setReplKey(long replKey)
replKey
- The replKey to set.public java.lang.String getSchema()
public void setSchema(java.lang.String schema)
schema
- The schema to set.public java.lang.String getStatus()
public void setStatus(java.lang.String status)
status
- The status to set.public java.lang.String getTable()
public void setTable(java.lang.String table)
table
- The table to set.public java.lang.String getTrigger()
public void setTrigger(java.lang.String trigger)
trigger
- The trigger to set.public void store(java.lang.String replPrefix, I_DbPool dbPool, java.sql.Connection conn) throws java.lang.Exception
replPrefix
- dbPool
- conn
-
java.lang.Exception
private static TableToWatchInfo get(java.sql.ResultSet rs, TableToWatchInfo tableToWatch) throws java.sql.SQLException
rs
- tableToWatch
- can be null. If not it will be the instance returned (after having filled it of course).
java.sql.SQLException
public static TableToWatchInfo get(java.sql.Connection conn, java.lang.String tableName, java.lang.String catalog, java.lang.String schema, java.lang.String table, TableToWatchInfo tableToWatch) throws java.lang.Exception
conn
- tableName
- The name of the table from which to retrieve the informationcatalog
- schema
- table
- tableToWatch
- can be null. If it is not null, it will be changed appropriately and returned.
java.lang.Exception
public static TableToWatchInfo[] getAll(java.sql.Connection conn, java.lang.String confTableName)
conn
- tableName
-
public java.lang.String getActions()
public java.lang.String toXml()
public int getDebug()
public void setDebug(int debug)
public void storeStatus(java.lang.String replicationPrefix, I_DbPool dbPool) throws java.lang.Exception
java.lang.Exception
public void removeFromDb(java.lang.String replicationPrefix, I_DbPool dbPool) throws java.lang.Exception
java.lang.Exception
public boolean isStatusOk(I_DbSpecific dbSpecific, java.sql.Connection conn)
dbSpecific
- conn
-
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |