4 import java.util.Vector;
6 import javax.jws.WebMethod;
7 import javax.jws.WebService;
9 import domain.AdminUser;
12 import domain.Forecast;
13 //import domain.Booking;
14 import domain.Question;
15 import domain.RegularUser;
17 import exceptions.EventFinished;
18 import exceptions.QuestionAlreadyExist;
19 import exceptions.UserAlreadyExistException;
22 * Interface that specifies the business logic.
25 public interface BLFacade {
28 * This method creates a question for an event, with a question text and the
31 * @param event to which question is added
32 * @param question text of the question
33 * @param betMinimum minimum quantity of the bet
34 * @return the created question, or null, or an exception
35 * @throws EventFinished if current data is after data of the event
36 * @throws QuestionAlreadyExist if the same question already exists for the
40 Question createQuestion(Event event, String question, float betMinimum) throws EventFinished, QuestionAlreadyExist;
43 * This method retrieves the events of a given date
45 * @param date in which events are retrieved
46 * @return collection of events
49 public Vector<Event> getEvents(Date date);
51 public Vector<Event> getAllEvents();
53 public Vector<Question> getAllQuestions();
55 public boolean deleteEvent(Event evento);
58 * This method retrieves from the database the dates a month for which there are
61 * @param date of the month for which days with events want to be retrieved
62 * @return collection of dates
65 public Vector<Date> getEventsMonth(Date date);
68 * This method calls the data access to initialize the database with some events
69 * and questions. It is invoked only when the option "initialize" is declared in
70 * the tag dataBaseOpenMode of resources/config.xml file
73 public void initializeBD();
75 // public RegularUser login(String username, String pass)
76 // throws exceptions.IncorrectPassException, exceptions.UserDoesNotExistException;
78 // public boolean validoUsuario(String puser);
80 public RegularUser registrar(String user, String pass, String name, String lastName, String birthDate, String email,
81 String account, Integer numb, String address, float balance) throws UserAlreadyExistException;
83 public boolean insertEvent(Event pEvento);
85 public int getNumberEvents();
87 public boolean existEvent(Event event);
89 public int getNumberForecasts();
91 public boolean existForecast(Forecast f);
93 public boolean insertForecast(Question question, String forecast, float fee);
95 public Vector<Forecast> getForecasts();
97 public Vector<Forecast> getForecasts(Question pregunta);
99 public boolean editarPerfilUsuario(String pContraseña, String pUsername, String pNombre, String pApellido,
100 String pEmail, String pCuentaBancaria);
102 public boolean editarPerfilUsuarioSinPass(String pUsername, String pNombre, String pApellido, String pEmail,
103 String pCuentaBancaria);
105 public Vector<User> getAllUsers();
107 public Integer getMaxIdInDB();
109 public boolean doLogin(String username, String pass);
111 public boolean isAdmin(String pusername, String ppassword);
113 public RegularUser getRegularUserByUsername(String pusername);
115 public AdminUser getAdminUserByUsername(String pusername);
117 public int createApuesta(Forecast pselectedAnswer, RegularUser pselectedClient, Float pselectedAmount);
119 public boolean closeEvent(Event e, Question q, Forecast f);
121 public boolean anularApuesta(Bet pApuesta);
123 public Vector<Bet> getApuestasAbiertas(RegularUser pUser);
125 public Vector<Bet> getApuestasCerradas(RegularUser pUser);
127 public Vector<Bet> getApuestasGanadas(RegularUser pUser);
129 public Vector<Bet> getApuestasPerdidas(RegularUser pUser);
131 public Vector<Bet> getApuestasAnuladas(RegularUser pUser);
133 public Vector<Bet> getApuestasByUser(RegularUser user);
135 public boolean aplicarBonoBienvenida(String user);
137 public boolean recargarSaldo(String user, Float importe);
139 public boolean definirResultados(Event pselectedEvent, Question pselectedQuestion, Forecast pselectedForecast);
141 public Vector<Question> getOpenedQuestions(Event ev);
143 public boolean getEstadoEvento(Event ev);
145 public Vector<Event> getEventosMedioCerrados();