3 import java.util.Vector;
4 import java.util.ArrayList;
11 //import domain.Booking;
12 import domain.Question;
15 import domain.Forecast;
16 import exceptions.EventFinished;
17 import exceptions.QuestionAlreadyExist;
18 import exceptions.UserAlreadyExistException;
20 import javax.jws.WebMethod;
21 import javax.jws.WebService;
24 * Interface that specifies the business logic.
27 public interface BLFacade {
31 * This method creates a question for an event, with a question text and the minimum bet
33 * @param event to which question is added
34 * @param question text of the question
35 * @param betMinimum minimum quantity of the bet
36 * @return the created question, or null, or an exception
37 * @throws EventFinished if current data is after data of the event
38 * @throws QuestionAlreadyExist if the same question already exists for the event
40 @WebMethod Question createQuestion(Event event, String question, float betMinimum) throws EventFinished, QuestionAlreadyExist;
44 * This method retrieves the events of a given date
46 * @param date in which events are retrieved
47 * @return collection of events
49 @WebMethod public Vector<Event> getEvents(Date date);
52 * This method retrieves from the database the dates a month for which there are events
54 * @param date of the month for which days with events want to be retrieved
55 * @return collection of dates
57 @WebMethod public Vector<Date> getEventsMonth(Date date);
60 * This method calls the data access to initialize the database with some events and questions.
61 * It is invoked only when the option "initialize" is declared in the tag dataBaseOpenMode of resources/config.xml file
63 @WebMethod public void initializeBD();
66 public User login(String username, String pass) throws exceptions.IncorrectPassException, exceptions.UserDoesNotExistException;
68 // public boolean validoUsuario(String puser);
70 public User registrar(String user,String pass,String name,String lastName,String birthDate,String email,String account,Integer numb,String address) throws UserAlreadyExistException;
72 public boolean insertEvent(Event pEvento);
73 public int getNumberEvents();
74 public boolean existEvent(Event event);
75 public int getNumberForecasts();
76 public boolean existForecast(Forecast f);
77 public boolean insertForecast(Forecast f);