ucar.unidata.collab
Class Client

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

public class Client
extends Object

A generic client object.

Version:
$Revision: 1.15 $Date: 2005/09/21 17:13:21 $
Author:
Metapps development team

Constructor Summary
Client()
          _more_
Client(Socket socket)
          _more_
Client(String host)
          Create a new Client connection, connection to the given hostname which is of the form: hostname[:optional port number].
Client(String host, int thePort)
          Create a new Client connection, connection to the given hostname which is of the form: hostname[:optional port number].
 
Method Summary
 void close()
          _more_
 void debug(String msg)
          _more_
 String getHostname()
          Get the Hostname property.
 boolean getOkToReceive()
          Get the OkToReceive property.
 boolean getOkToSend()
          Get the OkToSend property.
 boolean getValid()
          Get the Valid property.
protected  void handleServerMessage(String message)
          Handle the message rcvd from the server.
 boolean isConnectionOk()
          Is this client currently connected.
protected  void logException(String msg, Exception exc)
          _more_
static void main(String[] args)
          _more_
protected  String read()
          _more_
 void setHostname(String value)
          Set the Hostname property.
 void setOkToReceive(boolean value)
          Set the OkToReceive property.
 void setOkToSend(boolean value)
          Set the OkToSend property.
 void setValid(boolean value)
          Set the Valid property.
 String toString()
          _more_
 void write(String message)
          _more_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Client

public Client()
_more_


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 -

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 -
thePort -

Client

public Client(Socket socket)
       throws IOException
_more_

Parameters:
socket -
Throws:
IOException
Method Detail

debug

public void debug(String msg)
_more_

Parameters:
msg -

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 -

read

protected String read()
               throws IOException
_more_

Returns:
_more_
Throws:
IOException

close

public void close()
_more_


write

public void write(String message)
_more_

Parameters:
message -

logException

protected void logException(String msg,
                            Exception exc)
_more_

Parameters:
msg -
exc -

toString

public String toString()
_more_

Overrides:
toString in class Object
Returns:
_more_

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)
_more_

Parameters:
args -