com.glasskeylabs.gubcast
Class Gubclient

java.lang.Object
  |
  +--com.glasskeylabs.gubcast.Gubclient

public class Gubclient
extends java.lang.Object

A Gubclient object encapsulates everything that Gubcaster needs to know about a single Gubcast protocol client (Gubcast applet). Gubclients are constructed by Gubcaster and delivered to the Gubregistry for retention and future use by the application. The application provides these retained Gubclient objects to Gubcaster in order to push Web content to the corresponding applets. Each client is uniquely identified by the combination of (a) the IP address of the computer it's running on and (b) the TCP port number on which it listens for connections from Gubcaster. This unique ID is expressed as a string so that you can use it as the key when storing a Gubclient object in a hash table. The getID() instance method returns the ID for a given Gubclient. The composeID() class method returns an ID string for a given IP address and port number; you typically use it in the unregisterClient() method of a Gubregistry to construct the key for removing the unregistered client from a hash table.


Method Summary
static java.lang.String composeID(java.net.InetAddress host, int portNbr)
          Constructs a Gubclient unique ID string.
 java.lang.String getClientName()
          Returns the name by which the client applet characterizes itself.
 java.net.InetAddress getHost()
          Returns the Internet address of the host computer the client is running on.
 java.lang.String getID()
          Returns the client's unique ID string.
 java.net.InetAddress getLocalInterface()
          Returns the Internet address through which the server must contact the client in order to push content to it without violating applet security rules.
 int getPortNbr()
          Returns the TCP port number on which the client listens for Gubcast messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

composeID

public static java.lang.String composeID(java.net.InetAddress host,
                                         int portNbr)
Constructs a Gubclient unique ID string.
Parameters:
host - The Internet address of the host computer the client is running on.
portNbr - The TCP port number on which the client listens for Gubcast messages.

getID

public java.lang.String getID()
Returns the client's unique ID string.

getClientName

public java.lang.String getClientName()
Returns the name by which the client applet characterizes itself. This name cannot be relied on as a unique client identifier, but it typically has application significance. You specify client names in the HTML that you use to deliver the Gubcast applet.

getHost

public java.net.InetAddress getHost()
Returns the Internet address of the host computer the client is running on.

getPortNbr

public int getPortNbr()
Returns the TCP port number on which the client listens for Gubcast messages.

getLocalInterface

public java.net.InetAddress getLocalInterface()
Returns the Internet address through which the server must contact the client in order to push content to it without violating applet security rules. This may vary from client to client in the event that the server is multihomed.