RRRRHHHH_Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
package businessLogic; import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; import java.util.Date; import java.util.Vector; import javax.mail.MessagingException; import com.db4o.ObjectContainer; import com.db4o.ObjectSet; import common.BookingInterface; import dataAccess.DB4oManager; import domain.Booking; import domain.Client; import domain.Offer; import domain.RuralHouse; import exceptions.OfferCanNotBeBooked; public final class BookingManager extends UnicastRemoteObject implements BookingInterface { /** * */ private static final long serialVersionUID = 1L; dataAccess.DB4oManager dbMngr; public BookingManager() throws RemoteException { super(); try { this.dbMngr = DB4oManager.getInstance(); } catch (Exception e) { e.printStackTrace(); } } public void denyBooking(Booking b) throws RemoteException{ this.dbMngr.removeBooking(b); } public void acceptBooking(Booking b) throws RemoteException{ b.getOffer().setBooked(true); b.getOffer().getBookings().clear(); b.getOffer().getBookings().add(b); this.dbMngr.acceptBooking(b.getOffer()); try { MailManager.getInstance().Send(b.getClient().getMailAccount(), "Your booking has been accepted","Here should be the bill"); } catch (MessagingException e) { e.printStackTrace(); } } /** * This method creates a book with a corresponding parameters * * @param First * day, last day, house number and telephone * @return a book */ public Vector<Booking> createBooking(RuralHouse ruralHouse, Date firstDate, Date lastDate, Client client) throws OfferCanNotBeBooked,RemoteException { return dbMngr.createBooking(ruralHouse, firstDate, lastDate, client); } @Override public Vector<Booking> getOffersbookings(Offer o) throws RemoteException { return dbMngr.getOfBok(o); } } |
Commits for RRRRHHHH_CoderuralHouses/src/businessLogic/BookingManager.java
Revision | Author | Commited | Message |
---|---|---|---|
3a0296 ... Diff | pinene | Wed 20 May, 2015 16:57:47 +0000 | bookings were made to be taken from server per time they are searched |
ccac99 ... Diff | pinene | Wed 20 May, 2015 16:42:17 +0000 | Merge branch ‘master’ of ssh://xp-dev.com/RRRRHHHH_Code Conflicts: |
d30bcc ... Diff | pinene | Wed 20 May, 2015 16:32:33 +0000 | cleaning |
4bc36b ... Diff | camjan | Tue 19 May, 2015 23:23:13 +0000 | Merge branch ‘master’ of https://xp-dev.com/git/RRRRHHHH_Code Conflicts: |
fca164 ... Diff | camjan | Tue 19 May, 2015 14:51:35 +0000 | Some improvements done, owner deletion started, some bugs remain there |
4f8bcc ... Diff | epinzolas001 | Mon 18 May, 2015 09:49:54 +0000 | Merge conflicts solutioned |
6a5d4d ... Diff | camjan | Sun 17 May, 2015 20:35:45 +0000 | Booking confirmation and e-mail service added. Some bugs to be solved. |
7bf57b ... Diff | camjan | Sun 17 May, 2015 11:59:22 +0000 | Possibility of registering new owners added |
0f75b2 ... Diff | camjan | Sat 16 May, 2015 14:34:49 +0000 | Username is saved hashed and password hashed and salted |
520867 ... | pinene | Sun 19 Apr, 2015 14:09:12 +0000 | tmp |