org.springframework.webflow.samples.booking
Interface TravelService

All Known Implementing Classes:
JpaTravelService

public interface TravelService

A service interface for retrieving hotels and bookings from a backing repository. Also supports the ability to cancel a booking.


Method Summary
 Hotel addHotel(Hotel hotel)
           
 Preference addPreference(String userName, Preference preference)
          Create a new user preference
 void cancelBooking(Long id)
          Cancel an existing booking.
 Booking createBooking(Long hotelId, String userName)
          Create a new, transient hotel booking instance for the given user.
 void deletePreference(Long id)
           
 List<Booking> findBookings(String username)
          Find bookings made by the given user
 Hotel findHotelById(Long id)
          Find hotels by their identifier.
 List<Hotel> findHotels(SearchCriteria criteria)
          Find hotels available for booking by some criteria.
 Preference findPreferenceById(Long id)
           
 List<Preference> findPreferences(String userName)
           
 void savePreference(Preference preference)
           
 

Method Detail

findBookings

List<Booking> findBookings(String username)
Find bookings made by the given user

Parameters:
username - the user's name
Returns:
their bookings

findHotels

List<Hotel> findHotels(SearchCriteria criteria)
Find hotels available for booking by some criteria.

Parameters:
criteria - the search criteria
Returns:
a list of hotels meeting the criteria

findHotelById

Hotel findHotelById(Long id)
Find hotels by their identifier.

Parameters:
id - the hotel id
Returns:
the hotel

createBooking

Booking createBooking(Long hotelId,
                      String userName)
Create a new, transient hotel booking instance for the given user.

Parameters:
hotelId - the hotelId
userName - the user name
Returns:
the new transient booking instance

cancelBooking

void cancelBooking(Long id)
Cancel an existing booking.

Parameters:
id - the booking id

addPreference

Preference addPreference(String userName,
                         Preference preference)
Create a new user preference

Parameters:
preference - TODO
Returns:
the new preference instance

addHotel

Hotel addHotel(Hotel hotel)

findPreferences

List<Preference> findPreferences(String userName)
Parameters:
userName -
Returns:

savePreference

void savePreference(Preference preference)
Parameters:
preference -

deletePreference

void deletePreference(Long id)
Parameters:
preference -

findPreferenceById

Preference findPreferenceById(Long id)
Parameters:
id -
Returns:


Copyright © 2009 SpringSource, Inc. All Rights Reserved.