de.kosi
Class AbstractClient

java.lang.Object
  |
  +--de.kosi.AbstractClient
All Implemented Interfaces:
FoyerListener, java.rmi.Remote
Direct Known Subclasses:
AdminClient, Client, ComputerPlayerClient, StressClient

public abstract class AbstractClient
extends java.lang.Object
implements FoyerListener

AbstractClient provides an starting point for implementing clients. It contains the code all clients will need.

ChangeLog:

 $Log: AbstractClient.java,v $
 Revision 1.5  2001/08/30 14:10:36  tanni
 removed 1 NullPointerE

 Revision 1.4  2001/05/22 16:05:24  jiriki
 Made files more compliant to Coding Conventions.

 Revision 1.3  2001/05/22 10:16:02  jiriki
 - Removed old unused Client class
 - Removed unused import statements.

 Revision 1.2  2001/04/30 19:08:33  jiriki
 Improved Exception handling of AdminClient

 Revision 1.1.1.1  2001/04/29 18:05:15  jiriki
 Imported sources from zola.

 Revision 1.12  2001/04/08 14:42:37  wombat
 Foyer chat entfernt.

 Revision 1.11  2001/03/21 13:26:36  wombat
 - Removed bugs in Table
 - began implementation of stree client
 - updated documentation

 Revision 1.10  2001/03/19 21:50:49  wombat
 - Worked on admin client.
 - improved shutdown sequence
 - removed bugs in login/logout sequence

 Revision 1.9  2001/03/14 13:46:33  wombat
 Worked on Admin Tool. Removed deadlock while killing session

 Revision 1.8  2001/02/25 23:16:05  wombat
 - deadlock vermeidung umgestellt.
 - ListenerList erstellt

 Revision 1.7  2001/02/19 23:21:16  wombat
 Added SSL Support, Implement DistributedListFilter

 Revision 1.6  2001/02/06 14:57:32  wombat
 Updated documentation

 Revision 1.5  2001/02/06 14:29:09  wombat
 Updated documentation

 

Version:
$Revision: 1.5 $ ($Date: 2001/08/30 14:10:36 $)
Author:
PG KoSI

Constructor Summary
AbstractClient()
          Create a new Client.
 
Method Summary
 void connect(java.lang.String hostname)
          Connect to a KoSI server.
 void disconnect()
          Called when the server disconnects the client.
 void disconnectFromServer()
          Disconnect from the server.
 Foyer getFoyer()
          Returns the Foyer.
 void login(java.lang.String username, java.lang.String password)
          Login to the server.
 void logout()
          Logout.
 void ping()
          Called when the client is pinged.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.kosi.model.FoyerListener
invite, invite, notify, notify, notify
 

Constructor Detail

AbstractClient

public AbstractClient()
Create a new Client.
Method Detail

getFoyer

public Foyer getFoyer()
Returns the Foyer.
Returns:
Foyer or null if not connected.

ping

public void ping()
Called when the client is pinged.
Specified by:
ping in interface FoyerListener
Following copied from interface: de.kosi.model.FoyerListener
Throws:
java.rmi.RemoteException - If the remote call of this method fails.

connect

public void connect(java.lang.String hostname)
             throws java.rmi.RemoteException,
                    java.rmi.NotBoundException,
                    java.net.MalformedURLException
Connect to a KoSI server.
Parameters:
hostname - host to connect to.
Throws:
java.rmi.RemoteException - if an RMI Exception occurs.
java.rmi.NotBoundException - if the foyer does not exist on the server.
java.net.MalformedURLException - if the hostname is malformed.

disconnect

public void disconnect()
Called when the server disconnects the client.
Specified by:
disconnect in interface FoyerListener
Following copied from interface: de.kosi.model.FoyerListener
Throws:
java.rmi.RemoteException - If the remote call of this method fails.

disconnectFromServer

public void disconnectFromServer()
Disconnect from the server.

login

public void login(java.lang.String username,
                  java.lang.String password)
           throws java.rmi.RemoteException,
                  KosiAccessException
Login to the server. This methos may only be called after successfully connecting.
Parameters:
username - username to use to login.
password - password for this username.
Throws:
java.rmi.RemoteException - if the remote call fails.
KosiAccessException - if the access to th server is denied.

logout

public void logout()
            throws java.rmi.RemoteException,
                   InvalidSessionException
Logout.
Throws:
java.rmi.RemoteException - if the remote call fails.
InvalidSessionException - if there is no valid session.