Class Client

java.lang.Object
ucar.unidata.collab.Client
Direct Known Subclasses:
CollabClient

public class Client extends Object
A generic client object.
Author:
Metapps development team
  • Constructor Details

    • Client

      public Client()
      Instantiates a new client.
    • Client

      public Client(String host)
      Create a new Client connection, connection to the given hostname which is of the form: hostname[:optional port number]. If alsoCreateServer is true then also create a server.
      Parameters:
      host - the host
    • Client

      public Client(String host, int thePort)
      Create a new Client connection, connection to the given hostname which is of the form: hostname[:optional port number]. If alsoCreateServer is true then also create a server.
      Parameters:
      host - the host
      thePort - the the port
    • Client

      public Client(Socket socket) throws IOException
      Instantiates a new client.
      Parameters:
      socket - the socket
      Throws:
      IOException - Signals that an I/O exception has occurred.
  • Method Details

    • debug

      public void debug(String msg)
      Debug
      Parameters:
      msg - debug message
    • isConnectionOk

      public boolean isConnectionOk()
      Is this client currently connected.
      Returns:
      Is this client currently connected.
    • handleServerMessage

      protected void handleServerMessage(String message)
      Handle the message rcvd from the server.
      Parameters:
      message - message from server
    • read

      protected String read() throws IOException
      Read.
      Returns:
      the string
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • close

      public void close()
      _more_
    • write

      public void write(String message)
      Write.
      Parameters:
      message - the message
    • logException

      protected void logException(String msg, Exception exc)
      Log exception.
      Parameters:
      msg - the msg
      exc - the exc
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setHostname

      public void setHostname(String value)
      Set the Hostname property.
      Parameters:
      value - The new value for Hostname
    • getHostname

      public String getHostname()
      Get the Hostname property.
      Returns:
      The Hostname
    • setValid

      public void setValid(boolean value)
      Set the Valid property.
      Parameters:
      value - The new value for Valid
    • getValid

      public boolean getValid()
      Get the Valid property.
      Returns:
      The Valid
    • setOkToSend

      public void setOkToSend(boolean value)
      Set the OkToSend property.
      Parameters:
      value - The new value for OkToSend
    • getOkToSend

      public boolean getOkToSend()
      Get the OkToSend property.
      Returns:
      The OkToSend
    • setOkToReceive

      public void setOkToReceive(boolean value)
      Set the OkToReceive property.
      Parameters:
      value - The new value for OkToReceive
    • getOkToReceive

      public boolean getOkToReceive()
      Get the OkToReceive property.
      Returns:
      The OkToReceive
    • main

      public static void main(String[] args)
      The main method.
      Parameters:
      args - the arguments