Class DataClient

java.lang.Object
net.ME1312.SubData.Client.DataClient
All Implemented Interfaces:
DataSender
Direct Known Subclasses:
SubDataClient

public abstract class DataClient extends Object implements DataSender
SubData Client API Class
  • Field Details

  • Constructor Details

    • DataClient

      public DataClient()
  • Method Details

    • getClient

      public abstract void getClient(UUID id, Consumer<ObjectMap<String>> callback)
      Grabs a Client from the Network
      Parameters:
      id - Client ID
    • getClients

      public abstract void getClients(Consumer<Map<UUID,ObjectMap<String>>> callback)
      Grabs all the Clients on the Network
    • ping

      public abstract void ping(Consumer<PingResponse> response)
      Ping the Server
      Specified by:
      ping in interface DataSender
      Parameters:
      response - Ping Response
    • ping

      public abstract void ping(UUID id, Consumer<PingResponse> response)
      Ping a remote Client
      Parameters:
      id - Client ID
      response - Ping Response
    • sendMessage

      public abstract void sendMessage(MessageOut... messages)
      Send a message to the Server
      Specified by:
      sendMessage in interface DataSender
      Parameters:
      messages - Messages to send
      See Also:
    • forwardMessage

      public abstract void forwardMessage(UUID id, MessageOut... messages)
      Forward a message to another Client
      Parameters:
      id - Client ID
      messages - Messages to send
      See Also:
    • getBlockSize

      public abstract int getBlockSize()
      Get SubData's default Block Size
      Returns:
      Block Size
    • tempBlockSize

      public abstract void tempBlockSize(Integer size)
      Set SubData's Block Size for the current message
      Parameters:
      size - Block Size (null for default)
    • getConnection

      @Deprecated public DataClient getConnection()
      Deprecated.
      The Client connection to the Server is this
      Get the Client that connects the Server to us
      Specified by:
      getConnection in interface DataSender
      Returns:
      This Client
    • getProtocol

      public abstract DataProtocol getProtocol()
      Get the Protocol for this Client
      Specified by:
      getProtocol in interface DataSender
      Returns:
      Client Protocol
    • getID

      public UUID getID()
      Get the ID of this Client
      Specified by:
      getID in interface DataSender
      Returns:
      Client ID
    • getAddress

      public abstract InetSocketAddress getAddress()
      Get Remote Address
      Returns:
      Address
    • newChannel

      public abstract DataClient newChannel() throws IOException
      Open an Async Data SubChannel
      Returns:
      New SubData Channel
      Throws:
      IOException
    • close

      public abstract void close() throws IOException
      Closes the connection
      Throws:
      IOException
    • waitFor

      public void waitFor() throws InterruptedException
      Wait for the connection to close
      Throws:
      InterruptedException
    • isClosed

      public abstract boolean isClosed()
      Get if the connection has been closed
      Returns:
      Closed Status