com.ltu.smd116.dbp
Class BookingDBP


public class BookingDBP

Stereotype DBP

Constructor Summary
BookingDBP()
           

Method Summary
 booleandeleteBooking(BookingContainer booking)
          Method used to delete a booking.
 intdoBooking(BookingContainer booking)
          Method used when a new booking is done.
 BookingContainergetBooking(int id)
          Method used to get the booking that corresponds to the given id.
 SortedVectorsearchBookingByDate(Date date, int hours)
          Method used to search for bookings made within a specific time period.
 SortedVectorsearchBookingByDate(Date startDate, Date stopDate)
          Method used to search for bookings made a specific date.
 SortedVectorsearchBookingByService(ServiceContainer service)
          Method used to search for bookings made for a specific service.
 SortedVectorsearchBookingByUser(UserContainer user)
          Method used to search for bookings made by a specific user.
 booleanupdateBooking(BookingContainer booking)
          Method used to update an existing booking.

Constructor Detail

BookingDBP

public BookingDBP()
Method Detail

deleteBooking

public boolean deleteBooking(BookingContainer booking)
throws BookingException
Method used to delete a booking.
Parameters:
booking - is a BookingContainer containing the booking
Returns: true if the deletion is executed correctly.

doBooking

public int doBooking(BookingContainer booking)
throws BookingException
Method used when a new booking is done.
Parameters:
booking - is a BookingContainer containing all info about the booking
Returns: the id of the booking.

getBooking

public BookingContainer getBooking(int id)
throws BookingException
Method used to get the booking that corresponds to the given id.
Parameters:
id - - the unique id for the booking searched for.
Returns: the BookingContainer containing all info about the booking.

searchBookingByDate

public SortedVector searchBookingByDate(Date date, int hours)
throws BookingException
Method used to search for bookings made within a specific time period.
Parameters:
date - is the starttime of the search interval.
hours - defines how many hours the interval should be.
Returns: a SortedVector with all the search results.

searchBookingByDate

public SortedVector searchBookingByDate(Date startDate, Date stopDate)
throws BookingException
Method used to search for bookings made a specific date.
Parameters:
startDate - is the start of the search interval.
stopDate - is the end of the search interval.
Returns: a SortedVector with all the search results.

searchBookingByService

public SortedVector searchBookingByService(ServiceContainer service)
throws BookingException
Method used to search for bookings made for a specific service.
Parameters:
service - is a ServiceContainer containing the service info.
Returns: a SortedVector with all the search results.

searchBookingByUser

public SortedVector searchBookingByUser(UserContainer user)
throws BookingException
Method used to search for bookings made by a specific user.
Parameters:
user - is a UserContainer containing the user info.
Returns: a SortedVector with all the search results.

updateBooking

public boolean updateBooking(BookingContainer booking)
throws BookingException
Method used to update an existing booking.
Parameters:
booking - is a BookingContainer containing the booking
Returns: true if the update is executed correctly.