Product Documentation

FairCom Replication JSON RPC API

Previous Topic

Next Topic

Tutorial for the JSON RPC API

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.

In This Chapter

JSON RPC Tutorial

Previous Topic

Next Topic

JSON RPC Tutorial

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:

  1. Compile the Java NetBeans project from the tutorials\JSON RPC directory in the replication package.
  2. Start the Web server from the replication package: repl/webSrv/fcWebSrv.exe
  3. 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.

  4. 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.
  5. 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.

  6. Place some c-tree files that qualify for replication in the c:\temp\source directory.
  7. Execute or debug the apiTestWeb.jar file:
    1. Select one server from the provided list to be the source DBEngine.
    2. Enter the source data path as c:\temp (this directory must match the directory from step 4).
    3. Check that the files placed in the source data directory are correctly listed.
    4. Select another server from the provided list to be the target DBEngine.
    5. Enter the target data path as c:\temp2 (this directory must match the directory from step 5).
    6. Confirm the other entries.
  8. Open the Web GUI interface to graphically visualize what has been executed:
    https://localhost:8443/ReplicationManager/

TOCIndex