上QQ阅读APP看书,第一时间看更新
The CalendarService interface
Our application contains a CalendarService interface that can be used to access and store our domain objects. The code for CalendarService is as follows:
//src/main/java/com/packtpub/springsecurity/service/CalendarService.java
public interface CalendarService {
CalendarUser getUser(int id);
CalendarUser findUserByEmail(String email);
List<CalendarUser> findUsersByEmail(String partialEmail);
int createUser(CalendarUser user);
Event getEvent(int eventId);
int createEvent(Event event);
List<Event> findForUser(int userId);
List<Event> getEvents();
}
We won't go over the methods used in CalendarService, but they should be fairly straightforward. If you would like details about what each method does, please consult the Javadoc in the sample code.