Betty v1.1.0

christophedelory.betty
Class ProcessingEngine

java.lang.Object
  extended by christophedelory.betty.ProcessingEngine

public final class ProcessingEngine
extends Object

The main processing algorithm for player scores and ranks, and bets.

Version:
$Revision$
Author:
Christophe Delory

Method Summary
static boolean isChampionshipClosed(LocalChampionship dbChampionship)
          Checks if the specified phase is closed, namely if all of its phases are closed.
static boolean isEventClosed(LocalEvent dbEvent)
          Checks if the specified event is closed, namely if all player results have been entered.
static boolean isPhaseClosed(LocalPhase dbPhase)
          Checks if the specified phase is closed, namely if all of its events are closed.
static void processChampionship(LocalChampionship dbChampionship)
          Processes all events and phases of the specified championship: scores, ranks, bets.
static void processEvent(LocalEvent dbEvent)
          Processes the specified event: scores, ranks, bets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

processChampionship

public static void processChampionship(LocalChampionship dbChampionship)
                                throws Exception
Processes all events and phases of the specified championship: scores, ranks, bets.

Parameters:
dbChampionship - a championship. Should not be null.
Throws:
NullPointerException - if dbChampionship is null.
Exception - if any error occurs during the processing step.
See Also:
processEvent(LocalEvent)

processEvent

public static void processEvent(LocalEvent dbEvent)
                         throws Exception
Processes the specified event: scores, ranks, bets. Traverses up to the championship level if needed.

Parameters:
dbEvent - a championship phase's event. Should not be null.
Throws:
NullPointerException - if dbEvent is null.
Exception - if any error occurs during the processing step.
See Also:
isEventClosed(LocalEvent), processEventRanks(LocalEvent), processEventBets(LocalEvent), processPhase(LocalPhase)

isEventClosed

public static boolean isEventClosed(LocalEvent dbEvent)
                             throws NamingException,
                                    FinderException
Checks if the specified event is closed, namely if all player results have been entered.

Parameters:
dbEvent - a championship phase's event. Should not be null.
Returns:
true if the event is closed, false otherwise.
Throws:
NullPointerException - if dbEvent is null.
NamingException - if a naming exception is encountered.
FinderException - in case of failure to find any requested EJB object(s).
EJBException - if any exception occured during the execution of this method.
See Also:
isPhaseClosed(LocalPhase), isChampionshipClosed(LocalChampionship)

isPhaseClosed

public static boolean isPhaseClosed(LocalPhase dbPhase)
                             throws NamingException,
                                    FinderException
Checks if the specified phase is closed, namely if all of its events are closed.

Parameters:
dbPhase - a championship's phase. Should not be null.
Returns:
true if the phase is closed, false otherwise.
Throws:
NullPointerException - if dbPhase is null.
NamingException - if a naming exception is encountered.
FinderException - in case of failure to find any requested EJB object(s).
EJBException - if any exception occured during the execution of this method.
See Also:
isEventClosed(LocalEvent), isChampionshipClosed(LocalChampionship)

isChampionshipClosed

public static boolean isChampionshipClosed(LocalChampionship dbChampionship)
                                    throws NamingException,
                                           FinderException
Checks if the specified phase is closed, namely if all of its phases are closed.

Parameters:
dbChampionship - a championship. Should not be null.
Returns:
true if the championship is closed, false otherwise.
Throws:
NullPointerException - if dbChampionship is null.
NamingException - if a naming exception is encountered.
FinderException - in case of failure to find any requested EJB object(s).
EJBException - if any exception occured during the execution of this method.
See Also:
isPhaseClosed(LocalPhase), isEventClosed(LocalEvent)

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.