Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public List<Appointment> findAppointmentsForSearchFilter(SearchFilter filter) throws MSExchangeServiceException {
- ExchangeService service = new ExchangeService();
- try {
- List<Appointment> apptList = new ArrayList<>();
- service = config.buildExchangeService();
- ItemView itemView = new ItemView(Integer.MAX_VALUE);
- FindItemsResults<Item> findResults = service.findItems(WellKnownFolderName.Calendar, filter, itemView);
- List<String> idList = getAppointmentIDListFromItemList(findResults.getItems());
- for (String id : idList) {
- apptList.add(findAppointmentById(id));
- }
- service.close();
- return apptList;
- } catch (ExchangeServiceNotBuiltException ex) {
- throw new MSExchangeServiceException();
- } catch (ServiceLocalException ex) {
- logger.error("Error during fetching appointment IDs");
- logger.trace("{}", ex);
- throw new MSExchangeServiceException();
- } catch (Exception ex) {
- logger.warn("Error during getting appointment list");
- logger.trace("{}", ex);
- throw new MSExchangeServiceException();
- } finally {
- service.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment