Package davmail.exchange.graph
Class GraphExchangeSession
java.lang.Object
davmail.exchange.ExchangeSession
davmail.exchange.graph.GraphExchangeSession
Implement ExchangeSession based on Microsoft Graph
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classprotected static classprotected classGraph folder is identified by mailbox and idprotected classprotected classprotected static classprotected static classprotected classprotected static classExtend message list to support delta syncstatic enumNested classes/interfaces inherited from class davmail.exchange.ExchangeSession
ExchangeSession.Condition, ExchangeSession.ContactPhoto, ExchangeSession.FreeBusy, ExchangeSession.Item, ExchangeSession.ItemResult, ExchangeSession.MonoCondition, ExchangeSession.Operator -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final HashSet<GraphField> protected static final HashSet<GraphField> protected static final HashSet<GraphField> EVENT_ATTRIBUTES to retrieve all fields including modified occurrences, EVENT_LIST_ATTRIBUTES for searchprotected static final HashSet<GraphField> Default folder properties listprotected Map<String, GraphExchangeSession.FolderId> Map people attributes to LDAPprotected static final HashSet<GraphField> protected static final HashSet<GraphField> Common item properties, not used over Graphprotected static final intprotected static final Stringprotected static final StringFields inherited from class davmail.exchange.ExchangeSession
ADDRESSBOOK, alias, ARCHIVE, CALENDAR, CONTACTS, currentMailboxPath, DISTRIBUTION_LIST_ATTRIBUTES, DRAFTS, email, FORWARD, FORWARDED_ICON, FREE_BUSY_INTERVAL, GMT_TIMEZONE, importanceToPriorityMap, INBOX, JUNK, lastRcptToRecipients, lastSentMessageId, LOGGER, LOWER_CASE_INBOX, MAILBOX_BASE, mailPath, MIXED_CASE_INBOX, POP_MESSAGE_ATTRIBUTES, priorityToImportanceMap, PUBLIC_ROOT, publicFolderUrl, REPLIED_ICON, REPLYTOALL, REPLYTOSENDER, rootPath, SENDMSG, SENT, serverVersion, SPECIAL, TASKS, TRASH, UID_MESSAGE_ATTRIBUTES, UNSENT, userName, vTimezone, YYYY_MM_DD_HH_MM_SS, YYYY_MM_DD_T_HHMMSS_Z -
Constructor Summary
ConstructorsConstructorDescriptionGraphExchangeSession(HttpClientAdapter httpClient, O365Token token, String userName) -
Method Summary
Modifier and TypeMethodDescriptionand(ExchangeSession.Condition... conditions) And search filter.protected voidappendSubFolders(List<ExchangeSession.Folder> folders, String parentFolderPath, GraphExchangeSession.FolderId parentFolderId, ExchangeSession.Condition condition, boolean recursive) protected GraphExchangeSession.ContactbuildContact(String folderPath, String itemName, Map<String, String> properties, String etag, String noneMatch) protected GraphExchangeSession.ContactbuildGalfindContact(org.codehaus.jettison.json.JSONObject response) protected voidbuildSessionInfo(URI uri) protected voidvoidclose()Close session.Contains condition.protected StringconvertClassToExchange(String eventClass) Convert iCalendar CLASS value to Graph sensitivity value.protected static StringconvertDateFromExchange(String exchangeDateValue) Lightweight conversion method to avoid full string to date and back conversions.protected static StringconvertHtmlToText(String htmlText) protected StringconvertItemNameToEML(String itemName) convert vcf extension to EML.protected StringconvertItemNameToItemId(String itemName) protected static StringconvertShowAs(String status, String busyStatus) Convert iCalendar STATUS and X-MICROSOFT-CDO-BUSYSTATUS to Graph showAs.voidcopyMessage(ExchangeSession.Message message, String targetFolder) Copy message to target folderintCreate Exchange folder with given folder class.createMessage(String folderPath, String messageName, HashMap<String, String> properties, javax.mail.internet.MimeMessage mimeMessage) Create a message in the specified folder.voiddeleteFolder(String folderPath) Delete Exchange folder.voiddeleteItem(String folderPath, String itemName) Delete event named itemName in foldervoiddeleteMessage(ExchangeSession.Message message) Delete Exchange message.protected GraphExchangeSession.GraphIteratorexecuteSearchRequest(GraphRequestBuilder httpRequestBuilder) Exists condition.formatSearchDate(Date date) Format date to exchange search format.galFind(ExchangeSession.Condition condition, Set<String> returningAttributes, int sizeLimit) Search global address listgetAllContacts(String folderPath, boolean includeDistList) Search contacts in provided folder.getAllDistributionLists(String folderPath) getAllEvents(String folderPath) Search calendar events in provided folder.protected StringgetCalendarEmail(String folderPath) Get email from current calendarprotected ExchangeSession.ConditiongetCalendarItemCondition(ExchangeSession.Condition dateCondition) protected javax.mail.internet.MimePartgetCalendarMimePart(javax.mail.internet.MimeMultipart multiPart) getContactPhoto(ExchangeSession.Contact contact) Retrieve contact photo attached to contactprotected byte[]getContent(ExchangeSession.Message message) Get raw MIME message contentprotected StringgetDeltaLink(GraphExchangeSession.FolderId folderId) Get deltaLink on folder for delta synchronization.protected org.codehaus.jettison.json.JSONObjectgetDistListIfExists(GraphExchangeSession.FolderId folderId, String itemName) protected org.codehaus.jettison.json.JSONObjectgetEventByIdIfExists(GraphExchangeSession.FolderId folderId, String itemId) protected org.codehaus.jettison.json.JSONObjectgetEventIfExists(GraphExchangeSession.FolderId folderId, String itemName) getEventMessages(String folderPath) Override getEventMessages: inbox processing is deprecated, O365 auto scheduling is always enabled, return empty list.protected GraphExchangeSession.FolderIdgetFolderId(String folderPath) Compute folderId from folderNameprotected StringgetFreeBusyData(String attendee, String start, String end, int interval) Get freebusy data string from Exchange.protected byte[]getICS(InputStream mimeInputStream) Load ICS content from MIME message input streamGet item named eventName in folderprotected GraphExchangeSession.MessagegetMessage(GraphExchangeSession.FolderId folderId, String messageId) protected StringgetMessageHeader(javax.mail.internet.MimeMessage mimeMessage, String headerName) Get message header value from MIME message.getSubCalendarFolders(String folderName, boolean recursive) Search calendar folders under given folder.getSubContactFolders(String folderPath, boolean recursive) Get contact sub folders.protected GraphExchangeSession.FolderIdgetSubFolderByName(GraphExchangeSession.FolderId currentFolderId, String folderName) Search subfolder by name, return null when no folders foundgetSubFolders(String folderPath, ExchangeSession.Condition condition, boolean recursive) Search folders under given folder matching filter.Greater than condition.Greater than or equals condition.headerIsEqualTo(String headerName, String value) MIME header equals condition.protected ExchangeSession.ItemResultinternalCreateOrUpdateEvent(String folderPath, String itemName, String contentClass, String icsBody, String etag, String noneMatch) protected GraphExchangeSession.FolderinternalGetFolder(String folderPath) protected booleanisCalendarContentType(String contentType) Equals condition.Equals condition.booleanOverride isExpired check with a lightweight Graph request.Is false condition.protected static booleanCheck if itemName is long and base64 encoded.booleanisMainCalendar(String folderPath) Test if folderPath is main calendar.booleanisMainContactFolder(String folderPath) Is null condition.booleanisSharedFolder(String folderPath) Test if folderPath is inside user mailbox.Is true condition.protected voidLower than condition.Lower than or equals condition.voidmoveFolder(String folderPath, String targetFolderPath) Move folder to target name.voidMove item from source path to target path.voidmoveMessage(ExchangeSession.Message message, String targetFolder) Move message to target folderprotected voidmoveToTrash(ExchangeSession.Message message) not(ExchangeSession.Condition condition) Not search filter.or(ExchangeSession.Condition... conditions) Or search filter.voidprocessItem(String folderPath, String itemName) Mark event processed named eventName in folderbooleanrefreshFolder(ExchangeSession.Folder currentFolder) Check folder ctag and reload messages as needed.searchContacts(String folderPath, Set<String> attributes, ExchangeSession.Condition condition, int maxCount) Search contacts in provided folder matching the search query.searchEvents(String folderPath, boolean fullEvent, ExchangeSession.Condition condition) Graph implementation of event search, does not rely on provided attribute list.searchEvents(String folderPath, Set<String> attributes, ExchangeSession.Condition condition) Search calendar events or messages in provided folder matching the search query.searchMessages(String folderName, Set<String> attributes, ExchangeSession.Condition condition) Search folder for messages matching conditions, with given attributes.searchTasksOnly(String folderPath) Tasks folders are no longer supported, reroute to todos.intBuild and send the MIME message for the provided ICS event.voidsendMessage(byte[] byteArray) voidsendMessage(javax.mail.internet.MimeMessage mimeMessage) Send Mime message.startsWith(String attributeName, String value) Starts with condition.booleanCheck if the backend supports native people/directory search (e.g.intupdateFolder(String folderName, Map<String, String> properties) Update Exchange folder properties.voidupdateMessage(ExchangeSession.Message message, Map<String, String> properties) Update given properties on message.protected voidupdateMessageList(GraphExchangeSession.FolderId folderId, GraphExchangeSession.MessageList messageList) Leverage delta sync to only load modified messagesMethods inherited from class davmail.exchange.ExchangeSession
clearVTimezone, convertBDayToZulu, convertClassFromExchange, convertContactProperties, convertFlagsToKeywords, convertFlagToKeyword, convertKeywordToFlag, convertPriorityFromExchange, convertPriorityToExchange, convertResentHeader, convertZuluDateToBday, copyMessages, createCalendarFolder, createContactFolder, createMessageFolder, createOrUpdateContact, createOrUpdateItem, decodeKeyword, encodeKeyword, getADPhoto, getAlias, getAliasFromLogin, getAllMessageUidAndSize, getAllRecipients, getContactPhoneField, getEmail, getExchangeDateFormat, getExchangeZuluDateFormat, getExchangeZuluDateFormatMillisecond, getFolder, getFreebusy, getPastDelayCondition, getRangeCondition, getServerVersion, getSubfolderPath, getSubFolders, getTimezoneId, getVcardBdayFormat, getVTimezone, getZuluDateFormat, moveMessages, parseDate, purgeOldestFolderMessages, purgeOldestTrashAndSentMessages, searchEvents, searchEvents, searchEventsOnly, searchMessages, searchMessages, sendMessage
-
Field Details
-
PAGE_SIZE
protected static final int PAGE_SIZE- See Also:
-
urlcompnameToIdMap
-
wellKnownFolderMap
-
IMAP_MESSAGE_ATTRIBUTES
-
IMAP_MESSAGE_DELTA_ATTRIBUTES
-
CONTACT_ATTRIBUTES
-
EVENT_LIST_ATTRIBUTES
EVENT_ATTRIBUTES to retrieve all fields including modified occurrences, EVENT_LIST_ATTRIBUTES for search -
EVENT_ATTRIBUTES
-
FOLDER_PROPERTIES
Default folder properties list -
USERS_ROOT
- See Also:
-
ARCHIVE_ROOT
- See Also:
-
folderIdCache
-
ITEM_PROPERTIES
Common item properties, not used over Graph -
EVENT_REQUEST_PROPERTIES
-
CALENDAR_ITEM_REQUEST_PROPERTIES
-
TEXT_CALENDAR
- See Also:
-
APPLICATION_ICS
- See Also:
-
GALFIND_ATTRIBUTE_MAP
Map people attributes to LDAP
-
-
Constructor Details
-
GraphExchangeSession
public GraphExchangeSession(HttpClientAdapter httpClient, O365Token token, String userName) throws IOException - Throws:
IOException
-
-
Method Details
-
isExpired
Override isExpired check with a lightweight Graph request. The session is expired if the http client is closed or the token check fails, network level errors are rethrown to avoid reauthentication.- Overrides:
isExpiredin classExchangeSession- Returns:
- true if the session expired
- Throws:
IOException- on network error
-
checkToken
- Throws:
IOException
-
convertShowAs
Convert iCalendar STATUS and X-MICROSOFT-CDO-BUSYSTATUS to Graph showAs. Graph showAs values: free, tentative, busy, oof, workingElsewhere, unknown (case sensitive).- Parameters:
status- iCalendar STATUS value, may be nullbusyStatus- X-MICROSOFT-CDO-BUSYSTATUS value, may be null- Returns:
- Graph showAs value or null if no usable value is provided
-
convertHtmlToText
-
convertClassToExchange
Convert iCalendar CLASS value to Graph sensitivity value.- Parameters:
eventClass- iCalendar CLASS (PUBLIC, PRIVATE, CONFIDENTIAL)- Returns:
- Graph sensitivity value (normal, private, confidential)
-
close
public void close()Description copied from class:ExchangeSessionClose session. Shutdown http client connection manager- Specified by:
closein classExchangeSession
-
formatSearchDate
Format date to exchange search format. TODO: review- Specified by:
formatSearchDatein classExchangeSession- Parameters:
date- date object- Returns:
- formatted search date
-
buildSessionInfo
- Specified by:
buildSessionInfoin classExchangeSession- Throws:
IOException
-
createMessage
public ExchangeSession.Message createMessage(String folderPath, String messageName, HashMap<String, String> properties, javax.mail.internet.MimeMessage mimeMessage) throws IOExceptionDescription copied from class:ExchangeSessionCreate a message in the specified folder. Will overwrite an existing message with the same subject in the same folder- Specified by:
createMessagein classExchangeSession- Parameters:
folderPath- Exchange folder pathmessageName- message nameproperties- message properties (flags)mimeMessage- MIME message- Throws:
IOException- when unable to create message
-
getMessageHeader
Get message header value from MIME message. Warn on error, do not throw exception.- Parameters:
mimeMessage- MIME messageheaderName- header name- Returns:
- header value
-
getMessage
protected GraphExchangeSession.Message getMessage(GraphExchangeSession.FolderId folderId, String messageId) throws IOException - Throws:
IOException
-
convertDateFromExchange
Lightweight conversion method to avoid full string to date and back conversions. Note: Duplicate from EWSEchangeSession, added nanosecond handling See datetimetimezone- Parameters:
exchangeDateValue- date returned from O365- Returns:
- converted date
- Throws:
DavMailException- on error
-
updateMessage
public void updateMessage(ExchangeSession.Message message, Map<String, String> properties) throws IOExceptionDescription copied from class:ExchangeSessionUpdate given properties on message.- Specified by:
updateMessagein classExchangeSession- Parameters:
message- Exchange messageproperties- Webdav properties map- Throws:
IOException- on error
-
deleteMessage
Description copied from class:ExchangeSessionDelete Exchange message.- Specified by:
deleteMessagein classExchangeSession- Parameters:
message- Exchange message- Throws:
IOException- on error
-
getContent
Description copied from class:ExchangeSessionGet raw MIME message content- Specified by:
getContentin classExchangeSession- Parameters:
message- Exchange message- Returns:
- message body
- Throws:
IOException- on error
-
searchMessages
public ExchangeSession.MessageList searchMessages(String folderName, Set<String> attributes, ExchangeSession.Condition condition) throws IOException Description copied from class:ExchangeSessionSearch folder for messages matching conditions, with given attributes.- Specified by:
searchMessagesin classExchangeSession- Parameters:
folderName- Exchange folder nameattributes- requested Webdav attributescondition- search filter- Returns:
- message list
- Throws:
IOException- on error
-
and
Description copied from class:ExchangeSessionAnd search filter.- Specified by:
andin classExchangeSession- Parameters:
conditions- search conditions- Returns:
- condition
-
or
Description copied from class:ExchangeSessionOr search filter.- Specified by:
orin classExchangeSession- Parameters:
conditions- search conditions- Returns:
- condition
-
not
Description copied from class:ExchangeSessionNot search filter.- Specified by:
notin classExchangeSession- Parameters:
condition- search condition- Returns:
- condition
-
isEqualTo
Description copied from class:ExchangeSessionEquals condition.- Specified by:
isEqualToin classExchangeSession- Parameters:
attributeName- logical Exchange attribute namevalue- attribute value- Returns:
- condition
-
isEqualTo
Description copied from class:ExchangeSessionEquals condition.- Specified by:
isEqualToin classExchangeSession- Parameters:
attributeName- logical Exchange attribute namevalue- attribute value- Returns:
- condition
-
headerIsEqualTo
Description copied from class:ExchangeSessionMIME header equals condition.- Specified by:
headerIsEqualToin classExchangeSession- Parameters:
headerName- MIME header namevalue- attribute value- Returns:
- condition
-
gte
Description copied from class:ExchangeSessionGreater than or equals condition.- Specified by:
gtein classExchangeSession- Parameters:
attributeName- logical Exchange attribute namevalue- attribute value- Returns:
- condition
-
gt
Description copied from class:ExchangeSessionGreater than condition.- Specified by:
gtin classExchangeSession- Parameters:
attributeName- logical Exchange attribute namevalue- attribute value- Returns:
- condition
-
lt
Description copied from class:ExchangeSessionLower than condition.- Specified by:
ltin classExchangeSession- Parameters:
attributeName- logical Exchange attribute namevalue- attribute value- Returns:
- condition
-
lte
Description copied from class:ExchangeSessionLower than or equals condition.- Specified by:
ltein classExchangeSession- Parameters:
attributeName- logical Exchange attribute namevalue- attribute value- Returns:
- condition
-
contains
Description copied from class:ExchangeSessionContains condition.- Specified by:
containsin classExchangeSession- Parameters:
attributeName- logical Exchange attribute namevalue- attribute value- Returns:
- condition
-
startsWith
Description copied from class:ExchangeSessionStarts with condition.- Specified by:
startsWithin classExchangeSession- Parameters:
attributeName- logical Exchange attribute namevalue- attribute value- Returns:
- condition
-
isNull
Description copied from class:ExchangeSessionIs null condition.- Specified by:
isNullin classExchangeSession- Parameters:
attributeName- logical Exchange attribute name- Returns:
- condition
-
exists
Description copied from class:ExchangeSessionExists condition.- Specified by:
existsin classExchangeSession- Parameters:
attributeName- logical Exchange attribute name- Returns:
- condition
-
isTrue
Description copied from class:ExchangeSessionIs true condition.- Specified by:
isTruein classExchangeSession- Parameters:
attributeName- logical Exchange attribute name- Returns:
- condition
-
isFalse
Description copied from class:ExchangeSessionIs false condition.- Specified by:
isFalsein classExchangeSession- Parameters:
attributeName- logical Exchange attribute name- Returns:
- condition
-
getSubCalendarFolders
public List<ExchangeSession.Folder> getSubCalendarFolders(String folderName, boolean recursive) throws IOException Description copied from class:ExchangeSessionSearch calendar folders under given folder.- Overrides:
getSubCalendarFoldersin classExchangeSession- Parameters:
folderName- Exchange folder namerecursive- deep search if true- Returns:
- list of folders
- Throws:
IOException- on error
-
getSubContactFolders
public List<ExchangeSession.Folder> getSubContactFolders(String folderPath, boolean recursive) throws IOException Description copied from class:ExchangeSessionGet contact sub folders.- Overrides:
getSubContactFoldersin classExchangeSession- Parameters:
folderPath- Exchange folder namerecursive- deep search if true- Returns:
- list of folders
- Throws:
IOException- on error
-
getSubFolders
public List<ExchangeSession.Folder> getSubFolders(String folderPath, ExchangeSession.Condition condition, boolean recursive) throws IOException Description copied from class:ExchangeSessionSearch folders under given folder matching filter.- Specified by:
getSubFoldersin classExchangeSession- Parameters:
folderPath- Exchange folder namecondition- search filterrecursive- deep search if true- Returns:
- list of folders
- Throws:
IOException- on error
-
appendSubFolders
protected void appendSubFolders(List<ExchangeSession.Folder> folders, String parentFolderPath, GraphExchangeSession.FolderId parentFolderId, ExchangeSession.Condition condition, boolean recursive) throws IOException - Throws:
IOException
-
sendMessage
public void sendMessage(javax.mail.internet.MimeMessage mimeMessage) throws IOException, javax.mail.MessagingException Description copied from class:ExchangeSessionSend Mime message.- Specified by:
sendMessagein classExchangeSession- Parameters:
mimeMessage- MIME message- Throws:
IOException- on errorjavax.mail.MessagingException- on error
-
sendMessage
- Throws:
IOException
-
refreshFolder
Description copied from class:ExchangeSessionCheck folder ctag and reload messages as needed.- Overrides:
refreshFolderin classExchangeSession- Parameters:
currentFolder- current folder- Returns:
- true if folder changed
- Throws:
IOException- on error
-
internalGetFolder
- Specified by:
internalGetFolderin classExchangeSession- Throws:
IOException
-
getFolderId
Compute folderId from folderName- Parameters:
folderPath- folder name (path)- Returns:
- folder id
- Throws:
IOException
-
getDeltaLink
Get deltaLink on folder for delta synchronization.- Parameters:
folderId- folder id- Returns:
- delta link
- Throws:
IOException- on error
-
updateMessageList
protected void updateMessageList(GraphExchangeSession.FolderId folderId, GraphExchangeSession.MessageList messageList) throws IOException Leverage delta sync to only load modified messages- Parameters:
messageList- current messages- Throws:
IOException- on error
-
getSubFolderByName
protected GraphExchangeSession.FolderId getSubFolderByName(GraphExchangeSession.FolderId currentFolderId, String folderName) throws IOException Search subfolder by name, return null when no folders found- Parameters:
currentFolderId- parent folder idfolderName- child folder name- Returns:
- child folder id if exists
- Throws:
IOException- on error
-
createFolder
public int createFolder(String folderPath, String folderClass, Map<String, String> properties) throws IOExceptionDescription copied from class:ExchangeSessionCreate Exchange folder with given folder class.- Specified by:
createFolderin classExchangeSession- Parameters:
folderPath- logical folder namefolderClass- folder classproperties- folder properties- Returns:
- status
- Throws:
IOException- on error
-
updateFolder
Description copied from class:ExchangeSessionUpdate Exchange folder properties.- Specified by:
updateFolderin classExchangeSession- Parameters:
folderName- logical folder nameproperties- folder properties- Returns:
- status
- Throws:
IOException- on error
-
deleteFolder
Description copied from class:ExchangeSessionDelete Exchange folder.- Specified by:
deleteFolderin classExchangeSession- Parameters:
folderPath- logical folder name- Throws:
IOException- on error
-
copyMessage
Description copied from class:ExchangeSessionCopy message to target folder- Specified by:
copyMessagein classExchangeSession- Parameters:
message- Exchange messagetargetFolder- target folder- Throws:
IOException- on error
-
moveMessage
Description copied from class:ExchangeSessionMove message to target folder- Specified by:
moveMessagein classExchangeSession- Parameters:
message- Exchange messagetargetFolder- target folder- Throws:
IOException- on error
-
moveFolder
Description copied from class:ExchangeSessionMove folder to target name.- Specified by:
moveFolderin classExchangeSession- Parameters:
folderPath- current folder name/pathtargetFolderPath- target folder name/path- Throws:
IOException- on error
-
moveItem
Description copied from class:ExchangeSessionMove item from source path to target path.- Specified by:
moveItemin classExchangeSession- Parameters:
sourcePath- item source pathtargetPath- item target path- Throws:
IOException- on error
-
moveToTrash
- Specified by:
moveToTrashin classExchangeSession- Throws:
IOException
-
getItemProperties
- Specified by:
getItemPropertiesin classExchangeSession
-
getAllContacts
public List<ExchangeSession.Contact> getAllContacts(String folderPath, boolean includeDistList) throws IOException Description copied from class:ExchangeSessionSearch contacts in provided folder.- Overrides:
getAllContactsin classExchangeSession- Parameters:
folderPath- Exchange folder pathincludeDistList- include distribution lists- Returns:
- list of contacts
- Throws:
IOException- on error
-
getAllDistributionLists
- Throws:
IOException
-
searchContacts
public List<ExchangeSession.Contact> searchContacts(String folderPath, Set<String> attributes, ExchangeSession.Condition condition, int maxCount) throws IOException Description copied from class:ExchangeSessionSearch contacts in provided folder matching the search query.- Specified by:
searchContactsin classExchangeSession- Parameters:
folderPath- Exchange folder pathattributes- requested attributescondition- Exchange search querymaxCount- maximum item count- Returns:
- list of contacts
- Throws:
IOException- on error
-
getAllEvents
Search calendar events in provided folder.- Overrides:
getAllEventsin classExchangeSession- Parameters:
folderPath- Exchange folder path- Returns:
- list of calendar events
- Throws:
IOException- on error
-
getEventMessages
Override getEventMessages: inbox processing is deprecated, O365 auto scheduling is always enabled, return empty list.- Specified by:
getEventMessagesin classExchangeSession- Parameters:
folderPath- Exchange folder path- Returns:
- empty list, O365 handles inbox scheduling automatically
- Throws:
IOException- on error
-
getCalendarItemCondition
protected ExchangeSession.Condition getCalendarItemCondition(ExchangeSession.Condition dateCondition) - Specified by:
getCalendarItemConditionin classExchangeSession
-
searchTasksOnly
Tasks folders are no longer supported, reroute to todos.- Overrides:
searchTasksOnlyin classExchangeSession- Parameters:
folderPath- Exchange folder path- Returns:
- todos as events
- Throws:
IOException- on error
-
searchEvents
public List<ExchangeSession.Event> searchEvents(String folderPath, Set<String> attributes, ExchangeSession.Condition condition) throws IOException Description copied from class:ExchangeSessionSearch calendar events or messages in provided folder matching the search query.- Specified by:
searchEventsin classExchangeSession- Parameters:
folderPath- Exchange folder pathattributes- requested attributescondition- Exchange search query- Returns:
- list of calendar messages as Event objects
- Throws:
IOException- on error
-
searchEvents
public List<ExchangeSession.Event> searchEvents(String folderPath, boolean fullEvent, ExchangeSession.Condition condition) throws IOException Graph implementation of event search, does not rely on provided attribute list. Based on fullEvent flag, will just list minimal information or return full event content- Parameters:
folderPath- folder pathfullEvent- retrieve full events bodycondition- search condition- Returns:
- event list
- Throws:
IOException- on error
-
isCalendarContentType
-
getCalendarMimePart
protected javax.mail.internet.MimePart getCalendarMimePart(javax.mail.internet.MimeMultipart multiPart) throws IOException, javax.mail.MessagingException - Throws:
IOExceptionjavax.mail.MessagingException
-
getICS
protected byte[] getICS(InputStream mimeInputStream) throws IOException, javax.mail.MessagingException Load ICS content from MIME message input stream- Parameters:
mimeInputStream- mime message input stream- Returns:
- mime message ics attachment body
- Throws:
IOException- on errorjavax.mail.MessagingException- on error
-
getItem
Description copied from class:ExchangeSessionGet item named eventName in folder- Specified by:
getItemin classExchangeSession- Parameters:
folderPath- Exchange folder pathitemName- event name- Returns:
- event object
- Throws:
IOException- on error
-
convertItemNameToEML
Description copied from class:ExchangeSessionconvert vcf extension to EML.- Overrides:
convertItemNameToEMLin classExchangeSession- Parameters:
itemName- item name- Returns:
- EML item name
-
convertItemNameToItemId
-
getEventIfExists
protected org.codehaus.jettison.json.JSONObject getEventIfExists(GraphExchangeSession.FolderId folderId, String itemName) throws IOException - Throws:
IOException
-
getEventByIdIfExists
protected org.codehaus.jettison.json.JSONObject getEventByIdIfExists(GraphExchangeSession.FolderId folderId, String itemId) throws IOException - Throws:
IOException
-
getDistListIfExists
protected org.codehaus.jettison.json.JSONObject getDistListIfExists(GraphExchangeSession.FolderId folderId, String itemName) throws IOException - Throws:
IOException
-
getContactPhoto
public ExchangeSession.ContactPhoto getContactPhoto(ExchangeSession.Contact contact) throws IOException Description copied from class:ExchangeSessionRetrieve contact photo attached to contact- Specified by:
getContactPhotoin classExchangeSession- Parameters:
contact- address book contact- Returns:
- contact photo
- Throws:
IOException- on error
-
deleteItem
Description copied from class:ExchangeSessionDelete event named itemName in folder- Specified by:
deleteItemin classExchangeSession- Parameters:
folderPath- Exchange folder pathitemName- item name- Throws:
IOException- on error
-
processItem
Description copied from class:ExchangeSessionMark event processed named eventName in folder- Specified by:
processItemin classExchangeSession- Parameters:
folderPath- Exchange folder pathitemName- item name- Throws:
IOException- on error
-
sendEvent
Description copied from class:ExchangeSessionBuild and send the MIME message for the provided ICS event.- Specified by:
sendEventin classExchangeSession- Parameters:
icsBody- event in iCalendar format- Returns:
- HTTP status
- Throws:
IOException- on error
-
buildContact
protected GraphExchangeSession.Contact buildContact(String folderPath, String itemName, Map<String, String> properties, String etag, String noneMatch) throws IOException- Specified by:
buildContactin classExchangeSession- Throws:
IOException
-
internalCreateOrUpdateEvent
protected ExchangeSession.ItemResult internalCreateOrUpdateEvent(String folderPath, String itemName, String contentClass, String icsBody, String etag, String noneMatch) throws IOException - Specified by:
internalCreateOrUpdateEventin classExchangeSession- Throws:
IOException
-
isMainCalendar
Description copied from class:ExchangeSessionTest if folderPath is main calendar.- Specified by:
isMainCalendarin classExchangeSession- Parameters:
folderPath- absolute folder path- Returns:
- true if folderPath is a public or shared folder
- Throws:
IOException
-
isMainContactFolder
- Throws:
IOException
-
getCalendarEmail
Description copied from class:ExchangeSessionGet email from current calendar- Specified by:
getCalendarEmailin classExchangeSession- Parameters:
folderPath- calendar folder path- Returns:
- calendar mailbox
- Throws:
IOException
-
buildGalfindContact
protected GraphExchangeSession.Contact buildGalfindContact(org.codehaus.jettison.json.JSONObject response) -
supportsPeopleSearch
public boolean supportsPeopleSearch()Description copied from class:ExchangeSessionCheck if the backend supports native people/directory search (e.g. Graph People API). When true, the LDAP layer can issue a single broad search instead of iterating A-to-Z.- Overrides:
supportsPeopleSearchin classExchangeSession- Returns:
- true if backend supports native people search
-
galFind
public Map<String,ExchangeSession.Contact> galFind(ExchangeSession.Condition condition, Set<String> returningAttributes, int sizeLimit) throws IOException Description copied from class:ExchangeSessionSearch global address list- Specified by:
galFindin classExchangeSession- Parameters:
condition- search filterreturningAttributes- returning attributessizeLimit- size limit- Returns:
- matching contacts from gal
- Throws:
IOException- on error
-
getFreeBusyData
protected String getFreeBusyData(String attendee, String start, String end, int interval) throws IOException Description copied from class:ExchangeSessionGet freebusy data string from Exchange.- Specified by:
getFreeBusyDatain classExchangeSession- Parameters:
attendee- attendee email addressstart- start date in Exchange zulu formatend- end date in Exchange zulu formatinterval- freebusy interval in minutes- Returns:
- freebusy data or null
- Throws:
IOException- on error
-
loadVtimezone
protected void loadVtimezone()- Specified by:
loadVtimezonein classExchangeSession
-
executeSearchRequest
protected GraphExchangeSession.GraphIterator executeSearchRequest(GraphRequestBuilder httpRequestBuilder) throws IOException - Throws:
IOException
-
isItemId
Check if itemName is long and base64 encoded. User-generated item names are usually short- Parameters:
itemName- item name- Returns:
- true if itemName is an EWS item id
-