public class ExchangeConnector extends AbstractMessagingConnector
MessagingConnector.AttendeeInformation, MessagingConnector.FreeBusyStatus, MessagingConnector.ResponseType
Modifier and Type | Field and Description |
---|---|
private UserManager |
_userManager
The user manager
|
_cryptoHelper, _currentUserProvider, _userPopulationDAO, _userPref
ROLE
Constructor and Description |
---|
ExchangeConnector() |
Modifier and Type | Method and Description |
---|---|
private MessagingConnectorException.ExceptionType |
_getExceptionType(Throwable exception)
get the type of exception from the Throwable
|
private microsoft.exchange.webservices.data.core.ExchangeService |
_getImpersonatedService(UserIdentity userIdentity) |
private MessagingConnector.ResponseType |
_getResponseStatus(microsoft.exchange.webservices.data.core.enumeration.property.MeetingResponseType meetingResponseType) |
private microsoft.exchange.webservices.data.core.ExchangeService |
_getSimpleService(UserIdentity userIdentity) |
private microsoft.exchange.webservices.data.core.ExchangeService |
_initService(String userName,
String password) |
private void |
_setAttendees(microsoft.exchange.webservices.data.core.service.item.Appointment appointment,
Map<String,Boolean> attendees) |
private void |
_setDataEvent(microsoft.exchange.webservices.data.core.ExchangeService service,
microsoft.exchange.webservices.data.core.service.item.Appointment appointment,
String title,
String description,
String place,
boolean isAllDay,
Date startDate,
Date endDate,
EventRecurrenceTypeEnum recurrenceType,
Date untilDate,
Map<String,Boolean> attendees) |
private void |
_setRecurrence(microsoft.exchange.webservices.data.core.service.item.Appointment appointment,
Date startDate,
EventRecurrenceTypeEnum recurrenceType,
Date untilDate) |
protected microsoft.exchange.webservices.data.core.ExchangeService |
getService(UserIdentity userIdentity)
Get the service of connexion to the server exchange
|
protected static String |
html2text(String html)
Converts a given html String into a plain text String
|
String |
internalCreateEvent(String title,
String description,
String place,
boolean isAllDay,
Date startDate,
Date endDate,
EventRecurrenceTypeEnum recurrenceType,
Date untilDate,
Map<String,Boolean> attendees,
UserIdentity organiser)
Create an event
|
void |
internalDeleteEvent(String eventId,
UserIdentity organiser)
Delete an event
|
Map<String,MessagingConnector.AttendeeInformation> |
internalGetAttendees(String eventId,
UserIdentity organiser)
Get the map of attendees for an event
|
protected List<EmailMessage> |
internalGetEmails(UserIdentity userIdentity,
int maxEmails)
Get emails (no caching)
|
protected int |
internalGetEmailsCount(UserIdentity userIdentity)
Get emails count (no caching)
|
protected List<CalendarEvent> |
internalGetEvents(UserIdentity userIdentity,
int maxDays,
int maxEvents)
Get upcoming events (no caching)
|
protected int |
internalGetEventsCount(UserIdentity userIdentity,
int maxDays)
Get upcoming events count (no caching)
|
Map<String,MessagingConnector.FreeBusyStatus> |
internalGetFreeBusy(Date startDate,
Date endDate,
boolean isAllDay,
Set<String> attendees,
UserIdentity organiser)
Get free/busy status for attendees for a time window
|
boolean |
internalIsEventExist(String eventId,
UserIdentity organiser)
True if the event exist in the messaging connector
|
void |
internalSetAttendees(String eventId,
Map<String,Boolean> attendees,
UserIdentity organiser)
Set attendees for an event
|
void |
internalUpdateEvent(String eventId,
String title,
String description,
String place,
boolean isAllDay,
Date startDate,
Date endDate,
EventRecurrenceTypeEnum recurrenceType,
Date untilDate,
Map<String,Boolean> attendees,
UserIdentity organiser)
Update an event
|
boolean |
isUserExist(UserIdentity userIdentity)
True if the user exist
|
void |
service(ServiceManager manager) |
boolean |
supportInvitation()
Tell if the messaging connector supports event invitation
|
boolean |
supportUserCredential()
Check if a user credential should be saved
|
createEvent, deleteEvent, getAllowedPopulationIds, getAttendees, getEvents, getEventsCount, getFreeBusy, getUnreadEmailCount, getUnreadEmails, getUserCryptedPassword, getUserPassword, initialize, isAllowed, isEventExist, setAttendees, setUserPassword, updateEvent, userCredentialNeeded
getLogger, setLogger
private UserManager _userManager
public ExchangeConnector()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
service
in class AbstractMessagingConnector
ServiceException
protected microsoft.exchange.webservices.data.core.ExchangeService getService(UserIdentity userIdentity) throws URISyntaxException
userIdentity
- The user identityURISyntaxException
- if an error occurredpublic boolean supportUserCredential()
MessagingConnector
supportUserCredential
in interface MessagingConnector
supportUserCredential
in class AbstractMessagingConnector
private microsoft.exchange.webservices.data.core.ExchangeService _getSimpleService(UserIdentity userIdentity)
private microsoft.exchange.webservices.data.core.ExchangeService _getImpersonatedService(UserIdentity userIdentity)
private microsoft.exchange.webservices.data.core.ExchangeService _initService(String userName, String password)
protected List<CalendarEvent> internalGetEvents(UserIdentity userIdentity, int maxDays, int maxEvents) throws MessagingConnectorException
AbstractMessagingConnector
internalGetEvents
in class AbstractMessagingConnector
userIdentity
- The user identitymaxDays
- The maximum number of days to search formaxEvents
- The maximum number of events to retrieveMessagingConnectorException
- if failed to get events from serverprotected int internalGetEventsCount(UserIdentity userIdentity, int maxDays) throws MessagingConnectorException
AbstractMessagingConnector
internalGetEventsCount
in class AbstractMessagingConnector
userIdentity
- The user identitymaxDays
- The maximum number of days to search forMessagingConnectorException
- if failed to get events from serverprotected List<EmailMessage> internalGetEmails(UserIdentity userIdentity, int maxEmails) throws MessagingConnectorException
AbstractMessagingConnector
internalGetEmails
in class AbstractMessagingConnector
userIdentity
- The user identitymaxEmails
- The maximum number of emails to retrieveMessagingConnectorException
- if failed to get events from serverprotected int internalGetEmailsCount(UserIdentity userIdentity) throws MessagingConnectorException
AbstractMessagingConnector
internalGetEmailsCount
in class AbstractMessagingConnector
userIdentity
- The user identityMessagingConnectorException
- if failed to get events from serverpublic boolean supportInvitation() throws MessagingConnectorException
MessagingConnector
supportInvitation
in interface MessagingConnector
supportInvitation
in class AbstractMessagingConnector
MessagingConnectorException
- if failed to get events from serverpublic boolean internalIsEventExist(String eventId, UserIdentity organiser) throws MessagingConnectorException
AbstractMessagingConnector
internalIsEventExist
in class AbstractMessagingConnector
eventId
- the event idorganiser
- the organiserMessagingConnectorException
- if an error occurredpublic String internalCreateEvent(String title, String description, String place, boolean isAllDay, Date startDate, Date endDate, EventRecurrenceTypeEnum recurrenceType, Date untilDate, Map<String,Boolean> attendees, UserIdentity organiser) throws MessagingConnectorException
AbstractMessagingConnector
internalCreateEvent
in class AbstractMessagingConnector
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 organiserMessagingConnectorException
- if failed to get events from serverpublic void internalUpdateEvent(String eventId, String title, String description, String place, boolean isAllDay, Date startDate, Date endDate, EventRecurrenceTypeEnum recurrenceType, Date untilDate, Map<String,Boolean> attendees, UserIdentity organiser) throws MessagingConnectorException
AbstractMessagingConnector
internalUpdateEvent
in class AbstractMessagingConnector
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 organiserMessagingConnectorException
- if failed to get events from serverprivate void _setDataEvent(microsoft.exchange.webservices.data.core.ExchangeService service, microsoft.exchange.webservices.data.core.service.item.Appointment appointment, String title, String description, String place, boolean isAllDay, Date startDate, Date endDate, EventRecurrenceTypeEnum recurrenceType, Date untilDate, Map<String,Boolean> attendees) throws Exception
Exception
private void _setRecurrence(microsoft.exchange.webservices.data.core.service.item.Appointment appointment, Date startDate, EventRecurrenceTypeEnum recurrenceType, Date untilDate) throws Exception
Exception
public void internalDeleteEvent(String eventId, UserIdentity organiser) throws MessagingConnectorException
AbstractMessagingConnector
internalDeleteEvent
in class AbstractMessagingConnector
eventId
- the event id to deleteorganiser
- the event organiserMessagingConnectorException
- if failed to get events from serverpublic Map<String,MessagingConnector.AttendeeInformation> internalGetAttendees(String eventId, UserIdentity organiser) throws MessagingConnectorException
AbstractMessagingConnector
internalGetAttendees
in class AbstractMessagingConnector
eventId
- the event idorganiser
- the event organiserMessagingConnectorException
- if failed to get events from serverpublic void internalSetAttendees(String eventId, Map<String,Boolean> attendees, UserIdentity organiser) throws MessagingConnectorException
AbstractMessagingConnector
internalSetAttendees
in class AbstractMessagingConnector
eventId
- the event idattendees
- the map of attendees (email -> optional or requested) to setorganiser
- the event organiserMessagingConnectorException
- if failed to get events from serverpublic Map<String,MessagingConnector.FreeBusyStatus> internalGetFreeBusy(Date startDate, Date endDate, boolean isAllDay, Set<String> attendees, UserIdentity organiser) throws MessagingConnectorException
AbstractMessagingConnector
internalGetFreeBusy
in class AbstractMessagingConnector
startDate
- the start dateendDate
- the end dateisAllDay
- true if is an allday eventattendees
- the list of attendees emailorganiser
- the event organiserMessagingConnectorException
- if failed to get events from serverpublic boolean isUserExist(UserIdentity userIdentity) throws MessagingConnectorException
MessagingConnector
isUserExist
in interface MessagingConnector
isUserExist
in class AbstractMessagingConnector
userIdentity
- the user identityMessagingConnectorException
- if failed to get events from serverprivate MessagingConnector.ResponseType _getResponseStatus(microsoft.exchange.webservices.data.core.enumeration.property.MeetingResponseType meetingResponseType)
private void _setAttendees(microsoft.exchange.webservices.data.core.service.item.Appointment appointment, Map<String,Boolean> attendees) throws Exception
Exception
protected static String html2text(String html)
html
- the html String that will be convertedprivate MessagingConnectorException.ExceptionType _getExceptionType(Throwable exception)
exception
- exception thrown by Exchange APIMessagingConnectorException.ExceptionType