VersiĆ³n del proyecto de Apuestas tras la iteraciĆ³n 1
[ISBets21MAUBRY] / eclipse-workspace / ISBets21BRYMAUJONUNA / src / main / java / businessLogic / BLFacade.java
1 package businessLogic;
2
3 import java.util.Vector;
4 import java.util.ArrayList;
5 import java.util.Date;
6
7
8
9
10
11 //import domain.Booking;
12 import domain.Question;
13 import domain.User;
14 import domain.Event;
15 import domain.Forecast;
16 import exceptions.EventFinished;
17 import exceptions.QuestionAlreadyExist;
18 import exceptions.UserAlreadyExistException;
19
20 import javax.jws.WebMethod;
21 import javax.jws.WebService;
22
23 /**
24  * Interface that specifies the business logic.
25  */
26 @WebService
27 public interface BLFacade  {
28           
29
30         /**
31          * This method creates a question for an event, with a question text and the minimum bet
32          * 
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
39          */
40         @WebMethod Question createQuestion(Event event, String question, float betMinimum) throws EventFinished, QuestionAlreadyExist;
41         
42         
43         /**
44          * This method retrieves the events of a given date 
45          * 
46          * @param date in which events are retrieved
47          * @return collection of events
48          */
49         @WebMethod public Vector<Event> getEvents(Date date);
50         
51         /**
52          * This method retrieves from the database the dates a month for which there are events
53          * 
54          * @param date of the month for which days with events want to be retrieved 
55          * @return collection of dates
56          */
57         @WebMethod public Vector<Date> getEventsMonth(Date date);
58         
59         /**
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
62          */     
63         @WebMethod public void initializeBD();
64         
65         
66         public User login(String username, String pass) throws exceptions.IncorrectPassException, exceptions.UserDoesNotExistException;
67         
68 //      public boolean validoUsuario(String puser);
69
70         public User registrar(String user,String pass,String name,String lastName,String birthDate,String email,String account,Integer numb,String address) throws UserAlreadyExistException;
71
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);
78         
79 }