return redirectToFailureHandler(NO_OAUTH_ACCESS_TOKEN);
}
LOG.info("Completing the reservation request for a user: " + request.getReserveName());
Calendar c = null;
try {
String authHeader = manager.createAuthorizationHeader(accessToken, "GET",
socialService.getCurrentURI().toString());
socialService.replaceHeader("Authorization", authHeader);
c = socialService.get(Calendar.class);
} catch (RuntimeException ex) {
return redirectToFailureHandler(CALENDAR_ACCESS_PROBLEM);
}
CalendarEntry entry = c.getEntry(request.getHour());
if (entry.getEventDescription() == null || entry.getEventDescription().trim().isEmpty()) {
String address = restaurantService.post(new Form().set("name", request.getReserveName())
.set("phone", request.getContactPhone())
.set("hour", request.getHour()),
String.class);