de.kosi.model.tournament
Interface Tournament

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
PairTournament
All Known Implementing Classes:
TournamentImpl

public interface Tournament
extends java.io.Serializable

This is the interface to a tournament of Bridge. There will be pair tournaments and team tournaments be possible. A tournament must manage a list of participants. A tournament will have a certain movement that decides when which users will play which game. These games then will be created by the tournament and the users will be notified by their listeners that there is a game for them to play.
Tournaments have a certain time interval for registering. After that period must be a definite date when the tournament starts and thereafter a (not definite) date when the tournament is finished.
Every user can create a tournament. He will then be the owner of the tournament who is allowed to set the options for it and can invite and kick users. A tournament should provide a chat channel where all participants of a tournament can communicate together.

ChangeLog:

 $Log: Tournament.java,v $
 Revision 1.4  2001/08/02 10:44:30  jiriki
 Worked on Tournament

 Revision 1.3  2001/08/02 09:33:53  jiriki
 Worked on tournament

 Revision 1.2  2001/07/19 11:42:12  jiriki
 - Fixed Bug in TrickPane.
 - Started implementation of tournament.

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

 Revision 1.4  2001/04/20 15:10:14  login
 updated docs

 Revision 1.3  2001/04/10 16:32:17  login
 Commented the interface de.kosi.model.tournament.Tournament

 Revision 1.2  2001/04/05 14:11:52  login
 Worked on Tournament

 Revision 1.1  2001/03/05 20:55:22  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.3  2001/02/11 18:34:51  login
 updated documentation


 

Version:
$Revision: 1.4 $ ($Date: 2001/08/02 10:44:30 $)
Author:
Timo, Niklas, Ole

Field Summary
static int APPLICATION
          This constant refers to the application phase of a tournament.
static int EXECUTION
          This constant refers to the execution phase of a tournament.
static int FINISHED
          This constant refers to the finished state of the tournament.
static int PREPARATION
          This constant refers to the preparation phase of a tournament.
 
Method Summary
 void addTournamentListener(TournamentListener listener)
          Add a tournament listener.
 java.util.Calendar getApplicationDeadline()
          Returns the deadline of the application phase.
 ChatChannel getChatChannel()
          Returns the chat channel of this tournament.
 TournamentConfiguration getConfiguration()
          Get the configuration for this tournament.
 long getMatchTimeout()
          Returns the timeout for matches.
 java.lang.String getOwnerName()
          Returns the tournament's owner's login name.
 java.util.Calendar getStartDate()
          Returns the start date of the tournament.
 int getStatus()
          Returns the tournament's state (APPLICATION, PREPARATION, EXECUTION or FINISHED).
 boolean isOwner()
          Return wether the User calling the method is the owner of this tournament.
 void removeTournamentListener(TournamentListener listener)
          Remove a tournament listener.
 void setApplicationDeadline(java.util.Calendar calendar)
          Sets the application deadline of the tournament.
 void setMatchTimeout(long timeout)
          Set the timeout for matches.
 void setStartDate(java.util.Calendar calendar)
          Sets the start date of the tournament.
 

Field Detail

APPLICATION

public static final int APPLICATION
This constant refers to the application phase of a tournament.

PREPARATION

public static final int PREPARATION
This constant refers to the preparation phase of a tournament.

EXECUTION

public static final int EXECUTION
This constant refers to the execution phase of a tournament.

FINISHED

public static final int FINISHED
This constant refers to the finished state of the tournament.
Method Detail

getChatChannel

public ChatChannel getChatChannel()
                           throws java.rmi.RemoteException
Returns the chat channel of this tournament.
Returns:
A chat channel or null when the tournament contains no chat channel.
Throws:
java.rmi.RemoteException - If the remote call of this method fails.

getStartDate

public java.util.Calendar getStartDate()
                                throws java.rmi.RemoteException
Returns the start date of the tournament. At that time the state of the tournament will be set to EXECUTION.
Returns:
A calendar.
Throws:
java.rmi.RemoteException - If the remote call fails.

setStartDate

public void setStartDate(java.util.Calendar calendar)
                  throws java.rmi.RemoteException,
                         KosiAccessException,
                         InvalidSessionException
Sets the start date of the tournament. At that time the state of the tournament will be set to EXECUTION.
Parameters:
calendar - The calendar of the respective start date.
Throws:
java.rmi.RemoteException - If the remote call fails.
KosiAccessException - If the method was called by an unauthorized user. Only the server and the tournament's owner may set the start date.
InvalidSessionException - If this method was called from an invalid session context.

getApplicationDeadline

public java.util.Calendar getApplicationDeadline()
                                          throws java.rmi.RemoteException
Returns the deadline of the application phase. At that time the state of the tournament changes to PREPARATION.
Returns:
The calendar of the desired deadline.
Throws:
java.rmi.RemoteException - If the remote call fails.

setApplicationDeadline

public void setApplicationDeadline(java.util.Calendar calendar)
                            throws java.rmi.RemoteException,
                                   KosiAccessException,
                                   InvalidSessionException
Sets the application deadline of the tournament. At that time the state of the tournament changes to PREPARATION.
Parameters:
calendar - The calendar of the respective application deadline.
Throws:
java.rmi.RemoteException - If the remote call fails.
KosiAccessException - If the method was called by an unauthorized user. Only the server and the tournament's owner may set the start date.
InvalidSessionException - If this method was called from an invalid session context.

getMatchTimeout

public long getMatchTimeout()
                     throws java.rmi.RemoteException
Returns the timeout for matches. When the timeout expires all matches are ended.
Returns:
Timeout in milliseconds.
Throws:
java.rmi.RemoteException - If the remote call fails.

setMatchTimeout

public void setMatchTimeout(long timeout)
                     throws java.rmi.RemoteException,
                            KosiAccessException,
                            InvalidSessionException
Set the timeout for matches. When the timeout expires all matches are ended.
Parameters:
timeout - Timeout in milliseconds.
Throws:
KosiAccessException - If not called by the owner of this tournament.
InvalidSessionException - If not called from a valid session context.
java.rmi.RemoteException - If the remote call fails.

getOwnerName

public java.lang.String getOwnerName()
                              throws java.rmi.RemoteException
Returns the tournament's owner's login name.
Returns:
The tournament's owner's login name.
Throws:
java.rmi.RemoteException - If the remote call fails.

isOwner

public boolean isOwner()
                throws java.rmi.RemoteException,
                       InvalidSessionException
Return wether the User calling the method is the owner of this tournament.
Returns:
The tournament's owner's login name.
Throws:
java.rmi.RemoteException - If the remote call fails.
InvalidSessionException - If not called from a valid session context.

getStatus

public int getStatus()
              throws java.rmi.RemoteException
Returns the tournament's state (APPLICATION, PREPARATION, EXECUTION or FINISHED).
Returns:
The tournaments state (APPLICATION, PREPARATION, EXECUTION or FINISHED).
Throws:
java.rmi.RemoteException - If the remote call fails.

addTournamentListener

public void addTournamentListener(TournamentListener listener)
                           throws java.rmi.RemoteException,
                                  InvalidSessionException
Add a tournament listener.
Parameters:
listener - The listener to add.
Throws:
java.rmi.RemoteException - If the remote call fails.
InvalidSessionException - If this method was called from an invalid session context.

removeTournamentListener

public void removeTournamentListener(TournamentListener listener)
                              throws java.rmi.RemoteException,
                                     InvalidSessionException
Remove a tournament listener.
Parameters:
listener - The listener to remove.
Throws:
java.rmi.RemoteException - If the remote call fails.
InvalidSessionException - If this method was called from an invalid session context.

getConfiguration

public TournamentConfiguration getConfiguration()
                                         throws java.rmi.RemoteException,
                                                InvalidSessionException,
                                                KosiAccessException
Get the configuration for this tournament.
Returns:
The tournament configuration.
Throws:
java.rmi.RemoteException - If the remote call fails.
InvalidSessionException - If this method was called from
KosiAccessException - If not called by the owner of this tournament.