Page tree
Skip to end of metadata
Go to start of metadata

I. Configuring the REST Connector

  1. Add dependency to net.anotheria.moskito-core.2.2.3 into pom.xml of the client app.
  2. Create the rest-connector.json file. Add the following lines into it:

    rest-connector.json
    {
        host: "localhost",
        port: 8080,
        resourcePath: "/moskito-central/central/addSnapshot",
    }
    

    In these lines, host and port correspond to host and port of the HTTP server where REST Endpont is running.
     

  3. Open moskito.json and add the following lines into plug-ins array:

    moskito.json
    {
        "name": "RESTRemoteCentralConnector",
        "configurationName": "rest-connector",
        "className": "net.anotheria.moskito.central.connectors.rest.RESTConnector",
    },
    

    In these lines, the "rest-connector" entry should be substituted by the name of REST Connector JSON file, created in Step 2.

II. Starting the REST Endpoint

  1. Initiate moskito-central with war:war
    For example:

    mvn clean install war:war
    
  2. Start the Tomcat server and place <moskito-central>/target/moskito-central-[version].war into <tomcat-root>/webapps folder.

III. Configuring the DiMe Connector.

  1. Add dependency to net.anotheria.moskito-core.2.2.3 into pom.xml of the client app.
  2. Create he dime-connector.json file. Add the following lines into it:

    dime-connector.json
    {
        connectorHost: "localhost",
        connectorPort: 9249,
    }
    

    In these lines, host and port correspond to host and port of DistributeMe RMI service.

  3. Open moskito.json file and add the following lines into plug-ins array:

    moskito.json
    {
        "name": "DiMeCentralConnector",
        "configurationName": "dime-connector",
        "className": "net.anotheria.moskito.central.connectors.dime.DiMeCentralConnector",
    },
    

    In these lines, the "dime-connectorentry should be substituted by the name of DiMe Connector JSON file, configured in Step 2. 

IV. Starting the RMI Endpoint service.

Initiate moskito-central with "jar-with-service" profile, like the following:

Building executable JAR file with RMI Endpoint service
mvn clean install -Pjar-with-service

It will prepare the JAR file that can be started with java -jar utility.
We suppose that you will start it with local RMI registry and will use the following environment variables:

-DlocalRmiRegistryPort=9249 -DskipCentralRegistry=true.

Below is the example of starting the service:

Starting DiMeCentral Endpoint service
java -DlocalRmiRegistryPort=9249 -DskipCentralRegistry=true -jar moskito-central-[version].jar