The booking service
Before we delve into how to handle security with Spring, let's first discuss the component of our sample property management system that we will use in this chapter: the booking service.
As the name suggests, this component will provide the necessary functionality to take and manage bookings in our sample property management system. Let's consider the following Java interface:
public interface BookingService { /** * Looks up the booking with the given identifier. * * @param bookingId the booking identifier to look up * @return the booking with the given ID */ public Booking getBooking(long bookingId); /** * Answers all bookings for the given date range. * * @param dateRange the date range to retrieve bookings for * @return the bookings in the given date range */ public List<Booking> getBookings(DateRange dateRange); /** * Processes the given booking * * @param request the booking request * @return the result of the request ...