|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.dbreplicator.replication
Class Publication
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.dbreplicator.replication.Publication
- All Implemented Interfaces:
- java.io.Serializable, java.rmi.Remote, _PubImpl, _Publication, _Replicator
public class Publication
- extends java.rmi.server.UnicastRemoteObject
- implements _PubImpl, _Publication, _Replicator
- extends java.rmi.server.UnicastRemoteObject
The Publication class holds all the methods which are required for the physical creation of the publication(i.e system tables) and which are used at the time of synchronization at publisher's end. It implements three interfaces,
_PubImpl : It makes this class to implement all the remote methods which are called by the subscriber, at the time of subscribing, taking snapshot, synchronizing and for different tasks related to synchronization.
_Publication : It makes this class to implement all the methods which are called by the user, at the time of publishing, and for different tasks related to publishing.
_Replicator : It makes this class to implement all the methods which are called at the time of synchronization to get the publisher's information.
- See Also:
- Serialized Form
| Field Summary | |
|---|---|
int |
noOfPubTables
number of tables included in publication |
| Fields inherited from interface org.dbreplicator.replication._Publication |
|---|
publisher_wins, subscriber_wins, xmlAndShadow_entries |
| Constructor Summary | |
|---|---|
Publication()
|
|
Publication(ConnectionPool connectionPool0,
java.lang.String pubName0,
java.lang.String serverName0,
ReplicationServer localServer0)
|
|
| Method Summary | |
|---|---|
void |
addTableToPublication(java.lang.String[] newTableList,
java.lang.String[] filterClauses)
|
void |
checkFilter(java.sql.Statement stmt,
java.lang.String[] tableName0,
java.lang.String[] filterClause0)
|
void |
checkForLock(java.lang.String pubSubName)
|
void |
checkTableNameIfNull(java.lang.String[] tableNames)
|
void |
createSnapShot(java.lang.String subName,
boolean isSchemaSupported,
_FileUpload fileUpload,
java.lang.String remoteMachineAddress)
creates an XMl file for getting Snapshot on clients side. |
void |
createSnapShotAfterUpdateSub(java.lang.String address,
int portNo,
java.lang.String subName,
java.util.ArrayList tablesForSnapShot,
boolean isSchemaSupported,
_FileUpload fileUpload,
java.lang.String remoteMachineAddress)
creates an XMl file for getting Snapshot on clients side. |
void |
createStructure(int clientVendorType0,
java.lang.String subName,
java.lang.String address,
boolean isSchemaSupported,
_FileUpload fileUpload,
java.lang.String remoteMachineAddress)
This method is responsible to assist to subscribe a subscription. |
java.lang.Object[] |
createXMLForClient(java.lang.String subName,
java.lang.String clientServerName,
boolean isSchemaSupported,
_FileUpload fileUpload,
java.lang.String remoteMachineAddress)
Creates an XML file for synchronization purpose and send it to subscriber's socket. |
void |
dropSubscription(java.lang.String subName)
|
void |
dropTableFromPublication(java.lang.String[] dropTableList)
|
java.util.ArrayList |
dropTableListForSub(java.lang.String subName)
|
java.lang.String |
getConflictResolver()
|
ConnectionPool |
getConnectionPool()
|
AbstractDataBaseHandler |
getDBDataTypeHandler()
|
_FileUpload |
getFileUploader()
getFileUploader |
java.lang.String |
getFilterClause(SchemaQualifiedName tableName)
|
java.lang.String |
getPub_SubName()
|
java.lang.Object[] |
getPublisherAddressAndPort()
|
int |
getPubVendorName()
|
RepTable |
getRepTable(java.lang.String tableName)
|
java.lang.String |
getServerName()
|
boolean |
isPublicationCyclic()
|
void |
publish()
This method is responsible for creating required system tables in publication database and shadow tables and triggers on tables to be published. |
void |
push(java.lang.String subName,
java.lang.String remoteServerName,
boolean isCreateTransactionLogFile,
java.lang.String remoteMachineAddress)
It handle the push replication operation in publication data source. |
void |
releaseLOCK()
|
void |
saveSubscriptionData(java.lang.String subName)
Inserts a row into bookmark table of server side to put a matching pair of publication name and subscription name. |
void |
saveSubscriptionNewData(java.lang.String subName)
Inserts a row into bookmark table of server side to put a matching pair of publication name and subscription name. |
void |
setConflictResolver(java.lang.String conflictReolver0)
Sets the conflict resolver for publication. |
void |
setCreateShadowTable(java.lang.String tableName0,
boolean createShadowTable)
This method come in use if tables in a publications are refering to each other and It is required to |
void |
setCyclic(boolean isCyclic)
|
void |
setFilter(java.lang.String tableName0,
java.lang.String filterClause0)
Set the given filter clause for the given table |
void |
setFilter(java.lang.String tableName0,
java.lang.String filterClause0,
int paramCount0)
|
void |
setIgnoredColumns(java.lang.String tableName,
java.lang.String[] columnNamesToBeIgnored)
This method sets the columns whose values are to be ignored while taking snapshot,synchronizing etc. |
void |
setPublicationTables(java.util.ArrayList repTables0)
Set the replication tables for the publication |
void |
synchronize(java.lang.String subName,
java.lang.String remoteServerName,
boolean isCreateTransactionLogFile,
java.lang.String remoteMachineAddress)
merges the data between the client side and server side. |
void |
unpublish()
|
void |
updateBookMarkLastSyncId(java.lang.String remote_Pub_Sub_Name,
java.lang.Object[] lastId)
|
void |
updatePublisherShadowAndBookmarkTableAfterPullOnSubscriber(java.lang.String remote_Pub_Sub_Name,
java.lang.Object[] lastId)
|
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
|---|
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
|---|
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
|---|
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
noOfPubTables
public int noOfPubTables
- number of tables included in publication
| Constructor Detail |
|---|
Publication
public Publication() throws java.rmi.RemoteException
- Throws:
java.rmi.RemoteException
Publication
public Publication(ConnectionPool connectionPool0, java.lang.String pubName0, java.lang.String serverName0, ReplicationServer localServer0) throws java.rmi.RemoteException, RepException
- Throws:
java.rmi.RemoteExceptionRepException
| Method Detail |
|---|
setConflictResolver
public void setConflictResolver(java.lang.String conflictReolver0) throws RepException
- Sets the conflict resolver for publication. This can be one of:
- publisher_wins
- subscriber_wins
- Specified by:
setConflictResolverin interface_Publication
- Parameters:
conflictReolver0- conflict resolver- Throws:
RepException
setPublicationTables
public void setPublicationTables(java.util.ArrayList repTables0)
- Set the replication tables for the publication
- Parameters:
repTables0- list of tables
setCyclic
public void setCyclic(boolean isCyclic)
isPublicationCyclic
public boolean isPublicationCyclic()
getConflictResolver
public java.lang.String getConflictResolver() throws java.rmi.RemoteException
- Specified by:
getConflictResolverin interface_PubImpl
- Throws:
java.rmi.RemoteException
setFilter
public void setFilter(java.lang.String tableName0, java.lang.String filterClause0) throws RepException
- Set the given filter clause for the given table
A filter clause is simply the end of a where clause in an SQL statement. For example, to determine if your filterclause will work, insert it into this statement, where tablename is the table to which the filter is being applied:
select * from <tablename> where <filterclause>As you can see, the filterclause can be almost anything, including subselects.
- Specified by:
setFilterin interface_Publication
- Parameters:
tableName0- for which filter clause is to be addedfilterClause0- filter clause to be set- Throws:
RepException- if table does not exist or if filter clause is invalid
setFilter
public void setFilter(java.lang.String tableName0, java.lang.String filterClause0, int paramCount0) throws RepException
- Specified by:
setFilterin interface_Publication
- Throws:
RepException
setCreateShadowTable
public void setCreateShadowTable(java.lang.String tableName0, boolean createShadowTable) throws RepException
- This method come in use if tables in a publications are refering to
each other and It is required to
- Specified by:
setCreateShadowTablein interface_Publication
- Parameters:
tableName0- StringcreateShadowTable- boolean- Throws:
RepException
publish
public void publish() throws RepException
- This method is responsible for creating required system tables in publication database
and shadow tables and triggers on tables to be published. It is required for replication
and saves data into system tables about the publication.
- Specified by:
publishin interface_Publication
- Throws:
RepException
createStructure
public void createStructure(int clientVendorType0, java.lang.String subName, java.lang.String address, boolean isSchemaSupported, _FileUpload fileUpload, java.lang.String remoteMachineAddress) throws java.rmi.RemoteException, RepException
- This method is responsible to assist to subscribe a subscription. This
method creates a XML file to get all the tables involved in the publication
and makes an entry in bookmark table of serverside to save the publication
name with the subscription.
- Specified by:
createStructurein interface_PubImpl
- Parameters:
clientVendorType0- client database type i.e. oracle or sql serversubName- Subscription Nameaddress- IP AddressisSchemaSupported- True/False (boolean)fileUpload-remoteMachineAddress- IP Address- Throws:
java.rmi.RemoteExceptionRepException
getPublisherAddressAndPort
public java.lang.Object[] getPublisherAddressAndPort() throws java.rmi.RemoteException, RepException
- Specified by:
getPublisherAddressAndPortin interface_PubImpl
- Throws:
java.rmi.RemoteExceptionRepException
saveSubscriptionData
public void saveSubscriptionData(java.lang.String subName) throws java.rmi.RemoteException
- Inserts a row into bookmark table of server side to put a matching pair of
publication name and subscription name.
- Specified by:
saveSubscriptionDatain interface_PubImpl
- Parameters:
subName- sub name- Throws:
RepExceptionjava.rmi.RemoteException
createSnapShot
public void createSnapShot(java.lang.String subName, boolean isSchemaSupported, _FileUpload fileUpload, java.lang.String remoteMachineAddress) throws java.sql.SQLException, java.rmi.RemoteException, RepException
- creates an XMl file for getting Snapshot on clients side.
Do entry in the server side bookmark table.
Deletes all records from the server side log table.
- Specified by:
createSnapShotin interface_PubImpl
- Parameters:
subName- StringisSchemaSupported- True/False (boolean)fileUpload-remoteMachineAddress- IP Address- Throws:
java.sql.SQLExceptionjava.rmi.RemoteExceptionRepException
createXMLForClient
public java.lang.Object[] createXMLForClient(java.lang.String subName, java.lang.String clientServerName, boolean isSchemaSupported, _FileUpload fileUpload, java.lang.String remoteMachineAddress) throws java.rmi.RemoteException, RepException
- Creates an XML file for synchronization purpose and send it to subscriber's
socket.
Creates a server socket and send's it's information to the subscriber,
so that subscriber can transfer file over it.
- Specified by:
createXMLForClientin interface_PubImpl
- Parameters:
subName- StringclientServerName- StringisSchemaSupported- booleanfileUpload-remoteMachineAddress- String- Returns:
- Object[]
- Throws:
java.rmi.RemoteExceptionRepException
synchronize
public void synchronize(java.lang.String subName, java.lang.String remoteServerName, boolean isCreateTransactionLogFile, java.lang.String remoteMachineAddress) throws java.rmi.RemoteException, RepException
- merges the data between the client side and server side.
- Specified by:
synchronizein interface_PubImpl
- Parameters:
subName-remoteServerName-- Throws:
java.rmi.RemoteExceptionRepException
push
public void push(java.lang.String subName, java.lang.String remoteServerName, boolean isCreateTransactionLogFile, java.lang.String remoteMachineAddress) throws java.rmi.RemoteException, RepException
- It handle the push replication operation in publication data source.
- Parameters:
subName- StringremoteServerName- String- Throws:
java.rmi.RemoteExceptionRepException
getServerName
public java.lang.String getServerName() throws java.rmi.RemoteException
- Specified by:
getServerNamein interface_PubImpl
- Throws:
java.rmi.RemoteException
getFilterClause
public java.lang.String getFilterClause(SchemaQualifiedName tableName) throws java.rmi.RemoteException
- Specified by:
getFilterClausein interface_PubImpl
- Throws:
java.rmi.RemoteException
getDBDataTypeHandler
public AbstractDataBaseHandler getDBDataTypeHandler()
- Specified by:
getDBDataTypeHandlerin interface_Replicator
getPub_SubName
public java.lang.String getPub_SubName()
- Specified by:
getPub_SubNamein interface_Replicator
getRepTable
public RepTable getRepTable(java.lang.String tableName) throws RepException
- Specified by:
getRepTablein interface_Replicator
- Throws:
RepException
unpublish
public void unpublish() throws RepException
- Specified by:
unpublishin interface_Publication
- Throws:
RepException
dropSubscription
public void dropSubscription(java.lang.String subName) throws java.rmi.RemoteException, RepException
- Specified by:
dropSubscriptionin interface_PubImpl
- Throws:
java.rmi.RemoteExceptionRepException
checkForLock
public void checkForLock(java.lang.String pubSubName) throws RepException, java.rmi.RemoteException
- Specified by:
checkForLockin interface_PubImpl
- Throws:
RepExceptionjava.rmi.RemoteException
releaseLOCK
public void releaseLOCK() throws java.rmi.RemoteException
- Specified by:
releaseLOCKin interface_PubImpl
- Throws:
java.rmi.RemoteException
getPubVendorName
public int getPubVendorName() throws RepException
- Specified by:
getPubVendorNamein interface_PubImpl
- Throws:
RepException
updateBookMarkLastSyncId
public void updateBookMarkLastSyncId(java.lang.String remote_Pub_Sub_Name, java.lang.Object[] lastId) throws java.rmi.RemoteException, java.sql.SQLException, RepException
- Specified by:
updateBookMarkLastSyncIdin interface_PubImpl
- Throws:
java.rmi.RemoteExceptionjava.sql.SQLExceptionRepException
addTableToPublication
public void addTableToPublication(java.lang.String[] newTableList, java.lang.String[] filterClauses) throws RepException
- Specified by:
addTableToPublicationin interface_Publication
- Throws:
RepException
saveSubscriptionNewData
public void saveSubscriptionNewData(java.lang.String subName) throws java.rmi.RemoteException
- Inserts a row into bookmark table of server side to put a matching pair of
publication name and subscription name.
- Specified by:
saveSubscriptionNewDatain interface_PubImpl
- Parameters:
subName- sub name- Throws:
RepExceptionjava.rmi.RemoteException
dropTableFromPublication
public void dropTableFromPublication(java.lang.String[] dropTableList) throws RepException
- Specified by:
dropTableFromPublicationin interface_Publication
- Throws:
RepException
getConnectionPool
public ConnectionPool getConnectionPool()
checkFilter
public void checkFilter(java.sql.Statement stmt, java.lang.String[] tableName0, java.lang.String[] filterClause0) throws RepException
- Throws:
RepException
checkTableNameIfNull
public void checkTableNameIfNull(java.lang.String[] tableNames) throws RepException
- Throws:
RepException
createSnapShotAfterUpdateSub
public void createSnapShotAfterUpdateSub(java.lang.String address, int portNo, java.lang.String subName, java.util.ArrayList tablesForSnapShot, boolean isSchemaSupported, _FileUpload fileUpload, java.lang.String remoteMachineAddress) throws java.sql.SQLException, java.rmi.RemoteException, RepException
- creates an XMl file for getting Snapshot on clients side.
Do entry in the server side bookmark table.
Deletes all records from the server side log table.
- Specified by:
createSnapShotAfterUpdateSubin interface_PubImpl
- Parameters:
address-portNo-subName-- Throws:
java.sql.SQLExceptionjava.rmi.RemoteExceptionRepException
dropTableListForSub
public java.util.ArrayList dropTableListForSub(java.lang.String subName) throws RepException, java.sql.SQLException, java.rmi.RemoteException
- Specified by:
dropTableListForSubin interface_PubImpl
- Throws:
RepExceptionjava.sql.SQLExceptionjava.rmi.RemoteException
updatePublisherShadowAndBookmarkTableAfterPullOnSubscriber
public void updatePublisherShadowAndBookmarkTableAfterPullOnSubscriber(java.lang.String remote_Pub_Sub_Name, java.lang.Object[] lastId) throws java.rmi.RemoteException, java.sql.SQLException, RepException
- Specified by:
updatePublisherShadowAndBookmarkTableAfterPullOnSubscriberin interface_PubImpl
- Throws:
java.rmi.RemoteExceptionjava.sql.SQLExceptionRepException
setIgnoredColumns
public void setIgnoredColumns(java.lang.String tableName, java.lang.String[] columnNamesToBeIgnored) throws RepException
- Description copied from interface:
_Publication - This method sets the columns whose values are to be ignored while taking snapshot,synchronizing etc.
- Specified by:
setIgnoredColumnsin interface_Publication
- Parameters:
tableName- String- Throws:
RepException
getFileUploader
public _FileUpload getFileUploader() throws RepException, java.sql.SQLException, java.rmi.RemoteException
- getFileUploader
- Specified by:
getFileUploaderin interface_PubImpl
- Returns:
- ArrayList
- Throws:
RepExceptionjava.sql.SQLExceptionjava.rmi.RemoteException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.rmi.server.RemoteObject

