Interface MessagingConnector
-
- All Superinterfaces:
Component
- All Known Implementing Classes:
AbstractMessagingConnector,EWSConnector,ExchangeConnector,GraphConnector,ZimbraConnector
public interface MessagingConnector extends Component
This interface describe the methods used by the different mail servers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMessagingConnector.AttendeeInformationInternal class for attendee informationstatic classMessagingConnector.FreeBusyStatusEnum for free/busy statusstatic classMessagingConnector.ResponseTypeEnum for answer status
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringcreateEvent(String title, String description, String place, boolean isAllDay, ZonedDateTime startDate, ZonedDateTime endDate, EventRecurrenceTypeEnum recurrenceType, ZonedDateTime untilDate, Map<String,Boolean> attendees, UserIdentity organiser)Create an eventvoiddeleteEvent(String eventId, UserIdentity organiser)Delete an eventList<String>getAllowedPopulationIds()Get the list of population id allowed to the messaging connectorMap<String,MessagingConnector.AttendeeInformation>getAttendees(String eventId, UserIdentity organiser)Get the map of attendees for an eventList<CalendarEvent>getEvents(UserIdentity userIdentity, int maxDays, int maxEvents)Get the list of upcoming events from now for a given userintgetEventsCount(UserIdentity userIdentity, int maxDays)Return the number of upcoming eventsMap<String,MessagingConnector.FreeBusyStatus>getFreeBusy(Date startDate, Date endDate, boolean isAllDay, Set<String> attendees, UserIdentity organiser)Get free/busy status for attendees for a time windowintgetUnreadEmailCount(UserIdentity userIdentity)Return the number of unread mails for a given userList<EmailMessage>getUnreadEmails(UserIdentity userIdentity, int maxEmails)Return the unread emails for a given userbooleanisEventExist(String eventId, UserIdentity organiser)True if the event exist in the messaging connectorbooleanisUserExist(UserIdentity userIdentity)True if the user existvoidsetAttendees(String eventId, Map<String,Boolean> attendees, UserIdentity organiser)Set attendees for an eventvoidsetUserPassword(UserIdentity userIdentity, String password)Set a new password for the userbooleansupportInvitation()Tell if the messaging connector supports event invitationbooleansupportUserCredential(UserIdentity userIdentity)Check if a user credential should be savedvoidupdateEvent(String eventId, String title, String description, String place, boolean isAllDay, ZonedDateTime startDate, ZonedDateTime endDate, EventRecurrenceTypeEnum recurrenceType, ZonedDateTime untilDate, Map<String,Boolean> attendees, UserIdentity organiser)Update an eventbooleanuserCredentialNeeded(UserIdentity userIdentity)Check if the service needs user credential (some implementation can use a central API key or impersonation, some don't)
-
-
-
Method Detail
-
getAllowedPopulationIds
List<String> getAllowedPopulationIds()
Get the list of population id allowed to the messaging connector- Returns:
- the list of population id allowed to the messaging connector
-
getEvents
List<CalendarEvent> getEvents(UserIdentity userIdentity, int maxDays, int maxEvents) throws MessagingConnectorException
Get the list of upcoming events from now for a given user- Parameters:
userIdentity- the owner of the eventsmaxDays- The maximum number of days to search for from nowmaxEvents- the maximum number of events to retrieve- Returns:
- the next events
- Throws:
MessagingConnectorException- if failed to get events
-
getEventsCount
int getEventsCount(UserIdentity userIdentity, int maxDays) throws MessagingConnectorException
Return the number of upcoming events- Parameters:
userIdentity- the owner of the eventsmaxDays- The maximum number of days to search for from now- Returns:
- the number of upcoming events
- Throws:
MessagingConnectorException- if failed to get events' count
-
getUnreadEmails
List<EmailMessage> getUnreadEmails(UserIdentity userIdentity, int maxEmails) throws MessagingConnectorException
Return the unread emails for a given user- Parameters:
userIdentity- the recipient of the mailsmaxEmails- The max number of emails to return- Returns:
- a mail messsages
- Throws:
MessagingConnectorException- if failed to get mails
-
getUnreadEmailCount
int getUnreadEmailCount(UserIdentity userIdentity) throws MessagingConnectorException
Return the number of unread mails for a given user- Parameters:
userIdentity- the receiver of the mails- Returns:
- the number of unread mails
- Throws:
MessagingConnectorException- if failed to get unread mails ' count
-
supportInvitation
boolean supportInvitation() throws MessagingConnectorException
Tell if the messaging connector supports event invitation- Returns:
- true if the messaging connector supports event invitation
- Throws:
MessagingConnectorException- if failed to get events from server
-
isEventExist
boolean isEventExist(String eventId, UserIdentity organiser) throws MessagingConnectorException
True if the event exist in the messaging connector- Parameters:
eventId- the event idorganiser- the organiser- Returns:
- true if the event exist
- Throws:
MessagingConnectorException- if an error occurred
-
createEvent
String createEvent(String title, String description, String place, boolean isAllDay, ZonedDateTime startDate, ZonedDateTime endDate, EventRecurrenceTypeEnum recurrenceType, ZonedDateTime untilDate, Map<String,Boolean> attendees, UserIdentity organiser) throws MessagingConnectorException
Create an event- Parameters:
title- the event titledescription- the event descriptionplace- the event placeisAllDay- if the event is all daystartDate- the event start dateendDate- the event end daterecurrenceType- recurrence typeuntilDate- until date of the recurring eventattendees- the map of attendees (email -> optional or requested) to setorganiser- the event organiser- Returns:
- the id of the event created
- Throws:
MessagingConnectorException- if failed to get events from server
-
updateEvent
void updateEvent(String eventId, String title, String description, String place, boolean isAllDay, ZonedDateTime startDate, ZonedDateTime endDate, EventRecurrenceTypeEnum recurrenceType, ZonedDateTime untilDate, Map<String,Boolean> attendees, UserIdentity organiser) throws MessagingConnectorException
Update an event- Parameters:
eventId- the event id to deletetitle- the event titledescription- the event descriptionplace- the event placeisAllDay- if the event is all daystartDate- the event start dateendDate- the event end daterecurrenceType- recurrence typeuntilDate- until date of the recurring eventattendees- the map of attendees (email -> optional or requested) to setorganiser- the event organiser- Throws:
MessagingConnectorException- if failed to get events from server
-
deleteEvent
void deleteEvent(String eventId, UserIdentity organiser) throws MessagingConnectorException
Delete an event- Parameters:
eventId- the event id to deleteorganiser- the event organiser- Throws:
MessagingConnectorException- if failed to get events from server
-
getAttendees
Map<String,MessagingConnector.AttendeeInformation> getAttendees(String eventId, UserIdentity organiser) throws MessagingConnectorException
Get the map of attendees for an event- Parameters:
eventId- the event idorganiser- the event organiser- Returns:
- the map of attendees (email -> attendee information)
- Throws:
MessagingConnectorException- if failed to get events from server
-
setAttendees
void setAttendees(String eventId, Map<String,Boolean> attendees, UserIdentity organiser) throws MessagingConnectorException
Set attendees for an event- Parameters:
eventId- the event idattendees- the map of attendees (email -> optional or requested) to setorganiser- the event organiser- Throws:
MessagingConnectorException- if failed to get events from server
-
getFreeBusy
Map<String,MessagingConnector.FreeBusyStatus> getFreeBusy(Date startDate, Date endDate, boolean isAllDay, Set<String> attendees, UserIdentity organiser) throws MessagingConnectorException
Get free/busy status for attendees for a time window- Parameters:
startDate- the start dateendDate- the end dateisAllDay- true if is an allday eventattendees- the list of attendees emailorganiser- the event organiser- Returns:
- the map of attendees (email -> freeBusy status)
- Throws:
MessagingConnectorException- if failed to get events from server
-
isUserExist
boolean isUserExist(UserIdentity userIdentity) throws MessagingConnectorException
True if the user exist- Parameters:
userIdentity- the user identity- Returns:
- true if the user exist
- Throws:
MessagingConnectorException- if failed to get events from server
-
userCredentialNeeded
boolean userCredentialNeeded(UserIdentity userIdentity)
Check if the service needs user credential (some implementation can use a central API key or impersonation, some don't)- Parameters:
userIdentity- The useridentity involved in the demand- Returns:
- True if the service is configured to ask for user credential
-
supportUserCredential
boolean supportUserCredential(UserIdentity userIdentity)
Check if a user credential should be saved- Parameters:
userIdentity- The useridentity involved in the demand- Returns:
- true if this implementation supports user credential (and is configured to use them)
-
setUserPassword
void setUserPassword(UserIdentity userIdentity, String password) throws UserPreferencesException, MessagingConnectorException
Set a new password for the user- Parameters:
userIdentity- user that have a password changepassword- new password- Throws:
UserPreferencesException- An exception occured while saving the passwordMessagingConnectorException- Thrown when the messaging connector does not support user credentials
-
-