use of com.zimbra.soap.mail.message.ModifyAppointmentResponse in project zm-mailbox by Zimbra.
the class TestJaxb method organizerChangeTimeForMeeting.
/**
* @param hit - From search response - represents the organizer's calendar copy
* @throws ServiceException
*/
private ZMessage organizerChangeTimeForMeeting(ZMailbox attendeeBox, ZMailbox organizerBox, ZDateTime newStart, ZDateTime newEnd, AppointmentHitInfo hit, String subject) throws Exception {
String organizerEmail = organizerBox.getName();
InviteComponent inviteComp = new InviteComponent();
inviteComp.addAttendee(CalendarAttendee.createForAddressDisplaynameRolePartstatRsvp(attendeeBox.getName(), getCN(attendeeBox), "REQ", "NE", true));
/* Note Tentative, not Needs action */
inviteComp.setStatus("CONF");
inviteComp.setFreeBusy("B");
inviteComp.setCalClass("PUB");
inviteComp.setTransparency("O");
inviteComp.setIsDraft(false);
inviteComp.setIsAllDay(false);
inviteComp.setDtStart(DtTimeInfo.createForDatetimeAndZone(newStart.getDateTime(), newStart.getTimeZoneId()));
inviteComp.setDtEnd(DtTimeInfo.createForDatetimeAndZone(newEnd.getDateTime(), newEnd.getTimeZoneId()));
inviteComp.setName(subject);
inviteComp.setLocation("room 101");
inviteComp.setOrganizer(CalOrganizer.createForAddress(organizerEmail));
InvitationInfo invite = new InvitationInfo();
invite.setUid(hit.getUid());
invite.setInviteComponent(inviteComp);
MimePartInfo mimePart = MimePartInfo.createForContentType("multipart/alternative");
String bodyText = String.format("The following meeting has been modified:\n\n%s", subject);
mimePart.addMimePart(MimePartInfo.createForContentTypeAndContent("text/plain", bodyText));
Msg msg = new Msg();
msg.setFolderId(hit.getFolderId());
msg.setInvite(invite);
EmailAddrInfo attendeeAddr = EmailAddrInfo.createForAddressPersonalAndAddressType(attendeeBox.getName(), getCN(attendeeBox), "t");
msg.addEmailAddress(attendeeAddr);
msg.setSubject(subject);
msg.setMimePart(mimePart);
ModifyAppointmentRequest maReq = ModifyAppointmentRequest.createForIdModseqRevCompnumMsg(hit.getInvId(), hit.getModifiedSequence(), hit.getRevision(), hit.getComponentNum(), msg);
ModifyAppointmentResponse maResp = organizerBox.invokeJaxb(maReq);
Assert.assertNotNull("JAXB ModifyAppointmentResponse", maResp);
return TestUtil.waitForMessage(attendeeBox, String.format("subject:\"%s\"", subject));
}
Aggregations