Package za.co.wethinkcode.robots.client
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 TypeMethodDescriptionvoidConnects to the Robot Worlds server on specified ip address and portvoidDisconnect from serverbooleanChecks if client is connected to servercom.fasterxml.jackson.databind.JsonNodesendRequest(String requestJsonString) Sends a request presented by the Json object to the serversendRequestAsString(String requestString)
-
Method Details
-
connect
Connects to the Robot Worlds server on specified ip address and port- Parameters:
ipAddress- either `localhost` or actual IP addressport- 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
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
-