oogp2p
Class ClientAdministrator

java.lang.Object
  extended byoogp2p.ClientAdministrator

public class ClientAdministrator
extends java.lang.Object

ClientAdministrator.java Contains all the Clients the person is connected to. Responsible for sending Nettables via the network model. Created: Thu Apr 24 15:55:41 2003

Version:
Author:

Field Summary
private  Client myClient
           
private  java.util.Vector myConnectedClients
           
 
Constructor Summary
ClientAdministrator()
           
ClientAdministrator(Client c)
           
 
Method Summary
 void broadcastToAll(Nettable nettable)
          Broadcasts to all nettables.
 Client connect(java.net.InetAddress ipaddr)
           
 boolean connectedTo(java.net.InetAddress inetAddr)
          Checks to see if already connected to a given Server
 Client getClient(java.net.InetAddress inetAddr)
          Returns the Client object that is connected to the given InetAddress
 Client getClient(java.lang.String connectedIPaddr)
          DEPRECATED Returns the Client object that is connected to the given IP address All calls to this should be replaced by getClient(InetAddress) below
 java.net.InetAddress getmyIP()
           
 java.lang.String getmyName()
           
 boolean sendNettable(java.net.InetAddress clientIP, Nettable n)
          Sends a Nettable to the given clientIP.
 void sendToAllConsoles(java.lang.String text)
          Sends text to all the console windows.
 void sendToConsole(java.lang.String text, java.net.InetAddress ipAddr)
           
 void setClientName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myConnectedClients

private java.util.Vector myConnectedClients

myClient

private Client myClient
Constructor Detail

ClientAdministrator

public ClientAdministrator()

ClientAdministrator

public ClientAdministrator(Client c)
Method Detail

connect

public Client connect(java.net.InetAddress ipaddr)

getmyName

public java.lang.String getmyName()

setClientName

public void setClientName(java.lang.String name)

getmyIP

public java.net.InetAddress getmyIP()

getClient

public Client getClient(java.lang.String connectedIPaddr)
DEPRECATED Returns the Client object that is connected to the given IP address All calls to this should be replaced by getClient(InetAddress) below


getClient

public Client getClient(java.net.InetAddress inetAddr)
Returns the Client object that is connected to the given InetAddress


connectedTo

public boolean connectedTo(java.net.InetAddress inetAddr)
Checks to see if already connected to a given Server


sendToConsole

public void sendToConsole(java.lang.String text,
                          java.net.InetAddress ipAddr)

sendToAllConsoles

public void sendToAllConsoles(java.lang.String text)
Sends text to all the console windows.

Parameters:
text - -- text to display

broadcastToAll

public void broadcastToAll(Nettable nettable)
Broadcasts to all nettables.

Parameters:
nettable - -- nettable to broadcast

sendNettable

public boolean sendNettable(java.net.InetAddress clientIP,
                            Nettable n)
Sends a Nettable to the given clientIP. If not connected to the given IP, then it will attempt to connect to it and send the nettable.

Parameters:
clientIP - -- IP of client to send to
n - -- nettable to send
Returns:
-- whether or not the nettable was sent successfully