Interface RobotWorldClient

All Known Implementing Classes:
RobotWorldJsonClient

public interface RobotWorldClient
A basic interface that wraps the expected Robot Worlds API so that we can easily connect to and send requests to the server.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    connect(String ipAddress, int port)
    Connects to the Robot Worlds server on specified ip address and port
    void
    Disconnect from server
    boolean
    Checks if client is connected to server
    com.fasterxml.jackson.databind.JsonNode
    sendRequest(String requestJsonString)
    Sends a request presented by the Json object to the server
    sendRequestAsString(String requestString)
     
  • Method Details

    • connect

      void connect(String ipAddress, int port)
      Connects to the Robot Worlds server on specified ip address and port
      Parameters:
      ipAddress - either `localhost` or actual IP address
      port - port that server is configured to receive connections on
    • isConnected

      boolean isConnected()
      Checks if client is connected to server
      Returns:
    • disconnect

      void disconnect()
      Disconnect from server
    • sendRequest

      com.fasterxml.jackson.databind.JsonNode sendRequest(String requestJsonString)
      Sends a request presented by the Json object to the server
      Parameters:
      requestJsonString - a String representing the Json string to send to server
      Returns:
      the response as a JsonNode
    • sendRequestAsString

      String sendRequestAsString(String requestString)