String getEventResponse(UserPresence presence, String eventContent) { Object event = eventFactory.createEvent(eventContent); if (event instanceof DndEvent) { DndEvent dndEvent = (DndEvent) event; return dndEvent.buildEventResponse(presence); } else if (event instanceof ForwardEvent) { ForwardEvent fwdEvent = (ForwardEvent) event; return fwdEvent.buildEventResponse(presence); } return null; }
MultipartMimeContentImpl getInitialMultipartContent( ContentTypeHeader contentTypeHeader, UserPresence presence) throws ParseException, InvalidArgumentException { MultipartMimeContentImpl multipartMimeContent = new MultipartMimeContentImpl(contentTypeHeader); multipartMimeContent.addContent(createContent(DndEvent.getDndEvent(presence))); multipartMimeContent.addContent(createContent(ForwardEvent.getForwardImmediateEvent(presence))); multipartMimeContent.addContent(createContent(ForwardEvent.getForwardOnBusyEvent(presence))); multipartMimeContent.addContent(createContent(ForwardEvent.getForwardNoAnswerEvent(presence))); return multipartMimeContent; }