ucar.unidata.idv.collab
Class CollabClient

java.lang.Object
  extended by ucar.unidata.collab.Client
      extended by ucar.unidata.idv.collab.CollabClient

public class CollabClient
extends Client

This provides IDV specific extensions to the Client class to support the collaboration mechanism with the IDV. In particular it has a name (the name of the client) and a flag to show if this is the Client object that represents the local user. In the future this could hold more information: contact info, etc.

Version:
$Revision: 1.5 $Date: 2005/05/13 18:30:36 $
Author:
IDV development team

Constructor Summary
CollabClient()
          Create a dummy version of this object.
CollabClient(CollabManager collabManager, Socket socket)
          Create this client with the already existing socket.
CollabClient(CollabManager collabManager, String hostName, int port)
          Create the client and have it try to connect to a Server at the given hostname and port.
 
Method Summary
 boolean getIsLocal()
          Get the IsLocal property.
 String getName()
          Get the Name property.
 void handleServerMessage(String msg)
          Route the message to the CollabManager
 void setIsLocal(boolean value)
          Set the isLocal property.
 void setName(String value)
          Set the Name property.
 
Methods inherited from class ucar.unidata.collab.Client
close, debug, getHostname, getOkToReceive, getOkToSend, getValid, isConnectionOk, logException, main, read, setHostname, setOkToReceive, setOkToSend, setValid, toString, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollabClient

public CollabClient()
Create a dummy version of this object. This is used for doing event replays. It is not connected to any server, etc.


CollabClient

public CollabClient(CollabManager collabManager,
                    String hostName,
                    int port)
             throws IOException
Create the client and have it try to connect to a Server at the given hostname and port. It will not try to read anything, that is left to the Server You can check if the connection was successful with Client.isConnectionOk()

Parameters:
collabManager - Reference to the singleton CollabManager
hostName - Host to connect to
port - Port on host to connect to
Throws:
IOException

CollabClient

public CollabClient(CollabManager collabManager,
                    Socket socket)
             throws IOException
Create this client with the already existing socket.

Parameters:
collabManager - Reference to the singleton CollabManager
socket - The socket
Throws:
IOException
Method Detail

handleServerMessage

public void handleServerMessage(String msg)
Route the message to the CollabManager

Overrides:
handleServerMessage in class Client
Parameters:
msg - The message

setName

public void setName(String value)
Set the Name property.

Parameters:
value - The new value for Name

getName

public String getName()
Get the Name property.

Returns:
The Name

setIsLocal

public void setIsLocal(boolean value)
Set the isLocal property. This is used to determine if this Client object represents the local client or a remote client

Parameters:
value - The new value for isLocal

getIsLocal

public boolean getIsLocal()
Get the IsLocal property.

Returns:
The IsLocal