Ejemplo n.º 1
0
 /**
  * Remove all memberships of this profile within this organiosation or subordinate organisations
  *
  * @param profile
  * @param session
  */
 public void removeMember(Profile profile, Session session) {
   log.info("removeMember: profileid=" + profile.getId() + " org=" + getOrgId());
   List<GroupMembership> toDelete = new ArrayList<>();
   if (profile.getMemberships() != null) {
     for (GroupMembership m : profile.getMemberships()) {
       Organisation memberWithin = m.getWithinOrg();
       if (memberWithin.isWithin(this)) {
         log.info(
             "Remove membership of user: "******" from org: "
                 + memberWithin.getOrgId());
         toDelete.add(m);
       }
     }
   }
   for (GroupMembership m : toDelete) {
     m.delete(session);
   }
 }
Ejemplo n.º 2
0
 @FreeBusyQuery
 public List<SchedulingResponseItem> freeBusyQuery(Profile profile, String icalQuery)
     throws NotAuthorizedException {
   ICalFormatter.FreeBusyRequest r = formatter.parseFreeBusyRequest(icalQuery);
   log.info(
       "queryFreeBusy: attendees="
           + r.getAttendeeLines().size()
           + " - "
           + r.getAttendeeMailtos().size());
   List<SchedulingResponseItem> list = new ArrayList<>();
   try {
     for (String attendeeMailto : r.getAttendeeMailtos()) {
       MailboxAddress add = MailboxAddress.parse(attendeeMailto);
       Profile attendee = findUserFromMailto(add);
       if (attendee == null) {
         log.warn("Attendee not found: " + attendeeMailto);
         SchedulingResponseItem item =
             new SchedulingResponseItem(
                 "mailto:" + attendeeMailto, ITip.StatusResponse.RS_INVALID_37, null);
         list.add(item);
       } else {
         log.info("Found attendee: " + attendee.getName());
         // Now locate events and build an ical response
         String ical = buildFreeBusyAttendeeResponse(attendee, r, add.domain, attendeeMailto);
         SchedulingResponseItem item =
             new SchedulingResponseItem(
                 "mailto:" + attendeeMailto, ITip.StatusResponse.RS_SUCCESS_20, ical);
         list.add(item);
       }
     }
   } catch (NotAuthorizedException ex) {
     throw ex;
   } catch (BadRequestException ex) {
     throw new RuntimeException(ex);
   }
   return list;
 }
Ejemplo n.º 3
0
 @CalendarInvitations
 public List<AttendeeRequest> getAttendeeRequests(Profile user) {
   log.info("getAttendeeRequests: " + user.getName());
   return calendarService.getAttendeeRequests(user, false);
 }