Interface CommandSender

All Known Subinterfaces:
ExportedObjectClient

public interface CommandSender
An interface to send commands to a remote server; but without knowing the details of the server or client that we're operating with.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
     
    boolean
     
    void
    sendCommand(@NotNull com.fishlib.base.Command command)
    Send the specified command, no response is expected.
    com.fishlib.base.Command
    sendCommandWithResponse(@NotNull com.fishlib.base.Command command)
    Send the specified command, synchronously waiting for the response.
  • Method Details

    • getRemoteHostName

      String getRemoteHostName()
      Returns:
      The remote host name, if appropriate
    • getRemotePort

      int getRemotePort()
      Returns:
      The remote port if appropriate, -1 otherwise
    • isValid

      boolean isValid()
      Returns:
      True if this CommandSender is valid for use (i.e. connected)
    • sendCommand

      void sendCommand(@NotNull @NotNull com.fishlib.base.Command command)
      Send the specified command, no response is expected.
      Parameters:
      command - the Command to send.
    • sendCommandWithResponse

      com.fishlib.base.Command sendCommandWithResponse(@NotNull @NotNull com.fishlib.base.Command command) throws IOException
      Send the specified command, synchronously waiting for the response.
      Parameters:
      command - the Command to send.
      Throws:
      IOException