Interface MessagingConnector
- All Superinterfaces:
Component
- All Known Implementing Classes:
AbstractMessagingConnector,EWSConnector,ExchangeConnector,GraphConnector,ZimbraConnector
This interface describe the methods used by the different mail servers.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classInternal class for attendee informationstatic enumEnum for free/busy statusstatic enumEnum for answer status -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncreateEvent(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 eventGet the list of population id allowed to the messaging connectorgetAttendees(String eventId, UserIdentity organiser) Get the map of attendees for an eventgetEvents(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 eventsgetFreeBusy(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 usergetUnreadEmails(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 userbooleanTell 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)
-
Field Details
-
ROLE
The avalon role
-
-
Method Details
-
getAllowedPopulationIds
Get the list of population id allowed to the messaging connector- Returns:
- the list of population id allowed to the messaging connector
- Throws:
MessagingConnectorException- if failed to get populations
-
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
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
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
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
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 MessagingConnectorExceptionCreate 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 MessagingConnectorExceptionUpdate 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
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 MessagingConnectorExceptionSet 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
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
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
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
-