Two tutorials are provided to assist you in learning to use the replication API. They are located in the following directories:
repl\tutorials\JSON RPC - This folder contains the tutorial for the JSON RPC API.
repl\tutorials\cpp - This folder contains the tutorial for use with C or C++.
These tutorials provide examples of how to use these APIs. They include sample projects that you can compile and run. After compiling the projects, you will start the servers and define the source and target folders that will be used for replication. You can run the projects in debug or add breakpoints so you can see how the various calls are used. Additionally, you can review the source code to study the use of the APIs.
Server 1
c:\temp
Replication Manager Server
Server 2
c:\temp2
Step-by-step instructions for these tutorials are provided in the next sections.
An example of how to use the high-level JSON RPC API is provided in the tutorials\rest directory. A NetBeans Java project and source are provided in the tutorial directory:
\tutorials\JSON RPC
To use the high-level JSON RPC API example in Java, perform the following steps:
Compile the Java NetBeans project from the tutorials\JSON RPC directory in the replication package.
Start the Web server from the replication package: repl/webSrv/fcWebSrv.exe
Start the Replication Manager Server from the replication package. The Replication Manager Server is found in the following location: repl/server/ctreesql.exe
This will create an empty Replication Manager Database.
Start servers 1 and 2 (from directories srv_east and srv_west) from the replication package. This will populate both DBEngines into Replication Manager Database.
Create source and target directories, for example:
source: c:\temp\source
target: c:\temp\target
Note: If you do not use the names shown above, you will need to update the IFIL structures in the sample data files.
Place some c-tree files that qualify for replication in the c:\temp\source directory.
Execute or debug the apiTestWeb.jar file:
Select one server from the provided list to be the source DBEngine.
Enter the source data path as c:\temp (this directory must match the directory from step 4).
Check that the files placed in the source data directory are correctly listed.
Select another server from the provided list to be the target DBEngine.
Enter the target data path as c:\temp2 (this directory must match the directory from step 5).
Confirm the other entries.
Open the Web GUI interface to graphically visualize what has been executed: https://localhost:8443/ReplicationManager/