de.kosi.model
Interface Foyer

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
FoyerImpl

public interface Foyer
extends java.rmi.Remote

Foyer is the root interface of KoSI. When a client connects to a server, the first object it gets is the Foyer.

ChangeLog:

 $Log: Foyer.java,v $
 Revision 1.7  2001/07/19 11:42:12  jiriki
 - Fixed Bug in TrickPane.
 - Started implementation of tournament.

 Revision 1.6  2001/06/08 15:27:33  tanni
 new foyer with a nice splitpane

 Revision 1.5  2001/06/05 10:09:35  jiriki
 Implemented online-user list in foyer.

 Revision 1.4  2001/05/09 20:50:35  jiriki
 Removed Bugs 422366 and 422375.

 Revision 1.3  2001/05/09 18:55:21  jiriki
 Removed Bug 422612.

 Revision 1.2  2001/05/09 10:02:44  betacarotine
 Removed Bug 421326.

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

 Revision 1.19  2001/04/27 12:49:35  login
 Added Locale in user creation, improved game stopwatch

 Revision 1.18  2001/04/17 19:30:08  wombat
 Updated Documentation

 Revision 1.17  2001/04/08 17:07:12  wombat
 Account Erstellung eingebaut

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

 Revision 1.15  2001/04/08 14:30:44  wombat
 Anfang Implementierung der selbst-alertierung

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

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

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

 Revision 1.11  2001/03/05 20:55:21  login
 - Game (und zugehoerige Klassen) soweit fertig
 - package de.kosi.model.tournament angelegt
 - Pair angelegt
 - Round angelegt
 - Movement-Interface angelegt
 - KosiMovement fertig!!! :-)
 - KosiMovementTest um das KosiMovement zu testen
       (kann mit KOSI/kosimovementtest  aufgerufen werden)
 - Tournament und TournamentImpl in das package de.kosi.model.tournament
       verschoben
 - buildfile fuer die neuen klassen angepasst

 Revision 1.10  2001/03/01 20:31:32  wombat
 Worked on table implementation / updated documentation

 Revision 1.9  2001/03/01 14:43:00  wombat
 Worked on table implementation.

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

 Revision 1.7  2001/02/07 16:54:04  wombat
 Updated Documentation

 

Version:
$Revision: 1.7 $ ($Date: 2001/07/19 11:42:12 $)

Method Summary
 void createAccount(java.lang.String username, java.lang.String email, java.util.Locale locale, int strength, java.util.TimeZone timeZone, java.lang.String biddingSystem)
          Create a new user account.
 Table createTable(TableListener listener, int direction, boolean publicTable)
          This method creates a new Table.
 Tournament createTournament(java.lang.String classname)
          This method creates a new Tournament.
 AdminInterface getAdminInterface()
          Returns a reference to the admiistrativ interface of the server.
 User getCurrentUser()
          Returns the user currently logged in.
 DistributedList getOnlineUserList()
          Returns the List of users currently logged in.
 DistributedList getTableList()
          Returns the List of currently available Tables.
 DistributedList getTournamentList()
          Returns the List of currently available Tournaments.
 User getUser(java.lang.String loginname)
          Returns a reference to a user with a given name.
 Session login(java.lang.String loginname, java.lang.String password, FoyerListener listener)
          Log into the Foyer.
 void logout()
          Log out of the Foyer.
 

Method Detail

login

public Session login(java.lang.String loginname,
                     java.lang.String password,
                     FoyerListener listener)
              throws KosiAccessException,
                     java.rmi.RemoteException
Log into the Foyer. This creates a new Session for the user.
Parameters:
loginname - the user to log in.
password - the password of the user.
listener - Listener to inform the user of important events.
Returns:
a new Session for the user.
Throws:
java.rmi.RemoteException - if the remote call fails.
KosiAccessException - if the user has given wrong credentials. And may not enter the Foyer as a registered user.

logout

public void logout()
            throws java.rmi.RemoteException,
                   InvalidSessionException
Log out of the Foyer. This ends the current session.
Throws:
java.rmi.RemoteException - if the remote call fails.
InvalidSessionException - if not called from within a valid session.

createAccount

public void createAccount(java.lang.String username,
                          java.lang.String email,
                          java.util.Locale locale,
                          int strength,
                          java.util.TimeZone timeZone,
                          java.lang.String biddingSystem)
                   throws java.rmi.RemoteException,
                          java.lang.IllegalArgumentException
Create a new user account. The password for this account is mailed to the provided email address.
Parameters:
username - Username for the new account.
email - EMail address of the user.
locale - Locale for the user.
strength - Strength of the user (one of the User.STRENGHT_* constants).
timeZone - Time zone the user lives in.
biddingSystem - Bidding system. This is used to set up first conventions for the user.
Throws:
java.rmi.RemoteException - If the temote call fails.
java.lang.IllegalArgumentException - If the username or the email address are not valid.

createTournament

public Tournament createTournament(java.lang.String classname)
                            throws java.rmi.RemoteException,
                                   KosiAccessException,
                                   InvalidSessionException,
                                   TournamentException
This method creates a new Tournament.
Returns:
a new Tournament.
Throws:
java.rmi.RemoteException - if the remote call fails.
KosiAccessException - if the user is not allowed to create a tournament.
InvalidSessionException - if not called from within a valid session.
TournamentException - If an exception occurs, while creating the tournament.

createTable

public Table createTable(TableListener listener,
                         int direction,
                         boolean publicTable)
                  throws KosiAccessException,
                         java.rmi.RemoteException,
                         InvalidSessionException,
                         TableException,
                         UserAlreadyPlayingException
This method creates a new Table.
Parameters:
listener - listener TableListener for the owner creating this table.
direction - direction the user want to play in (one of the Player constants).
publicTable - wether this Table is a public table.
Returns:
a new Table.
Throws:
java.rmi.RemoteException - if the remote call fails.
KosiAccessException - if the user is not allowed to create a table.
InvalidSessionException - if not called from within a valid session.
TableException - if an error occurs while creatingthe table.
UserAlreadyPlayingException - If the user calling this method is already playing.

getTournamentList

public DistributedList getTournamentList()
                                  throws java.rmi.RemoteException,
                                         KosiAccessException
Returns the List of currently available Tournaments.
Returns:
DistributedList containing Tournaments.
Throws:
KosiAccessException - if the user is not allowed to access this list.
java.rmi.RemoteException - if the remote call fails.

getTableList

public DistributedList getTableList()
                             throws java.rmi.RemoteException,
                                    KosiAccessException
Returns the List of currently available Tables.
Returns:
DistributedList containing Tables.
Throws:
KosiAccessException - if the user is not allowed to access this list.
java.rmi.RemoteException - if the remote call fails.

getOnlineUserList

public DistributedList getOnlineUserList()
                                  throws java.rmi.RemoteException,
                                         InvalidSessionException
Returns the List of users currently logged in.
Returns:
DistributedList containing User objects.
Throws:
InvalidSessionException - if not called from within a valid session.
java.rmi.RemoteException - if the remote call fails.

getUser

public User getUser(java.lang.String loginname)
             throws java.rmi.RemoteException,
                    InvalidSessionException
Returns a reference to a user with a given name.
Parameters:
loginname - Loginname of the user.
Returns:
a reference to the user object.
Throws:
java.rmi.RemoteException - if the remote call fails.
InvalidSessionException - if not called from within a valid session.

getCurrentUser

public User getCurrentUser()
                    throws java.rmi.RemoteException,
                           InvalidSessionException
Returns the user currently logged in.
Returns:
The user currently logged in.
Throws:
java.rmi.RemoteException - if the remote call fails.
InvalidSessionException - if not called from within a valid session.

getAdminInterface

public AdminInterface getAdminInterface()
                                 throws java.rmi.RemoteException,
                                        KosiAccessException,
                                        InvalidSessionException
Returns a reference to the admiistrativ interface of the server.
Returns:
A reference to the administrative interface.
Throws:
java.rmi.RemoteException - If the remote call fails.
KosiAccessException - If called by an user, that is not an administrator.
InvalidSessionException - if not called from within a valid session.