|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdavmail.exchange.ExchangeSession
davmail.exchange.ews.EwsExchangeSession
public class EwsExchangeSession
EWS Exchange adapter. Compatible with Exchange 2007 and hopefully 2010.
| Nested Class Summary | |
|---|---|
protected static class |
EwsExchangeSession.AttributeCondition
|
protected static class |
EwsExchangeSession.AutoDiscoverMethod
|
protected class |
EwsExchangeSession.Contact
|
protected class |
EwsExchangeSession.Event
|
protected class |
EwsExchangeSession.Folder
|
protected static class |
EwsExchangeSession.FolderPath
|
protected static class |
EwsExchangeSession.HeaderCondition
|
protected static class |
EwsExchangeSession.IsNullCondition
|
protected static class |
EwsExchangeSession.MultiCondition
|
protected static class |
EwsExchangeSession.NotCondition
|
| Nested classes/interfaces inherited from class davmail.exchange.ExchangeSession |
|---|
ExchangeSession.Condition, ExchangeSession.ContactPhoto, ExchangeSession.FreeBusy, ExchangeSession.Item, ExchangeSession.ItemResult, ExchangeSession.MessageList, ExchangeSession.MonoCondition, ExchangeSession.Operator |
| Field Summary | |
|---|---|
protected static String |
ARCHIVE_ROOT
|
protected static HashSet<String> |
EVENT_REQUEST_PROPERTIES
|
protected static HashSet<FieldURI> |
FOLDER_PROPERTIES
|
protected Map<String,String> |
folderIdMap
|
protected static HashMap<String,String> |
GALFIND_ATTRIBUTE_MAP
|
protected static HashSet<String> |
IGNORE_ATTRIBUTE_SET
|
protected static Map<String,String> |
importanceToPriorityMap
|
protected static Set<String> |
ITEM_PROPERTIES
Common item properties |
protected static Set<String> |
MESSAGE_TYPES
Message types. |
protected static int |
PAGE_SIZE
|
protected static Map<String,String> |
priorityToImportanceMap
|
protected static String |
USERS_ROOT
|
| Fields inherited from class davmail.exchange.ExchangeSession |
|---|
ADDRESSBOOK, alias, CALENDAR, CONTACT_ATTRIBUTES, CONTACTS, currentMailboxPath, DRAFTS, email, FREE_BUSY_INTERVAL, GMT_TIMEZONE, httpClient, IMAP_MESSAGE_ATTRIBUTES, INBOX, JUNK, lastSentMessageId, LOGGER, LOWER_CASE_INBOX, mailPath, PASSWORD_FIELDS, POP_MESSAGE_ATTRIBUTES, PUBLIC_ROOT, publicFolderUrl, rootPath, SENDMSG, SENT, serverVersion, TASKS, TOKEN_FIELDS, TRASH, UID_MESSAGE_ATTRIBUTES, UNSENT, USER_NAME_FIELDS, userName, vTimezone, YYYY_MM_DD_HH_MM_SS, YYYY_MM_DD_T_HHMMSS_Z |
| Constructor Summary | |
|---|---|
EwsExchangeSession(String url,
String userName,
String password)
|
|
| Method Summary | |
|---|---|
ExchangeSession.MultiCondition |
and(ExchangeSession.Condition... condition)
And search filter. |
protected void |
appendSubFolders(List<ExchangeSession.Folder> folders,
String parentFolderPath,
FolderId parentFolderId,
ExchangeSession.Condition condition,
boolean recursive)
|
protected EwsExchangeSession.Folder |
buildFolder(EWSMethod.Item item)
|
protected EwsExchangeSession.Contact |
buildGalfindContact(EWSMethod.Item response)
|
protected davmail.exchange.ews.EwsExchangeSession.Message |
buildMessage(EWSMethod.Item response)
|
protected List<FieldUpdate> |
buildProperties(Map<String,String> properties)
Message create/update properties |
protected void |
buildSessionInfo(org.apache.commons.httpclient.HttpMethod method)
|
protected void |
checkEndPointUrl(String endPointUrl)
Check endpoint url. |
ExchangeSession.Condition |
contains(String attributeName,
String value)
Contains condition. |
protected String |
convertCalendarDateToExchange(String vcalendarDateValue)
|
protected String |
convertDateFromExchange(String exchangeDateValue)
|
protected String |
convertDateFromExchangeToTaskDate(String exchangeDateValue)
|
protected String |
convertPriorityFromExchange(String exchangeImportanceValue)
|
protected String |
convertPriorityToExchange(String vTodoPriorityValue)
|
protected String |
convertTaskDateToZulu(String value)
|
void |
copyMessage(ExchangeSession.Message message,
String targetFolder)
Copy message to target folder |
int |
createFolder(String folderPath,
String folderClass,
Map<String,String> properties)
Create Exchange folder with given folder class. |
void |
createMessage(String folderPath,
String messageName,
HashMap<String,String> properties,
javax.mail.internet.MimeMessage mimeMessage)
Create message in specified folder. |
void |
deleteFolder(String folderPath)
Delete Exchange folder. |
void |
deleteItem(String folderPath,
String itemName)
Delete event named itemName in folder |
void |
deleteMessage(ExchangeSession.Message message)
Delete Exchange message. |
protected void |
executeMethod(EWSMethod ewsMethod)
|
String |
formatSearchDate(Date date)
Format date to exchange search format. |
protected org.apache.commons.httpclient.HttpMethod |
formLogin(org.apache.commons.httpclient.HttpClient httpClient,
org.apache.commons.httpclient.HttpMethod initmethod,
String userName,
String password)
|
Map<String,ExchangeSession.Contact> |
galFind(ExchangeSession.Condition condition,
Set<String> returningAttributes,
int sizeLimit)
Search global address list |
protected ExchangeSession.Condition |
getCalendarItemCondition(ExchangeSession.Condition dateCondition)
|
ExchangeSession.ContactPhoto |
getContactPhoto(ExchangeSession.Contact contact)
Retrieve contact photo attached to contact |
protected byte[] |
getContent(ExchangeSession.Message message)
Get raw MIME message content |
protected byte[] |
getContent(ItemId itemId)
Get item content. |
List<ExchangeSession.Event> |
getEventMessages(String folderPath)
Search calendar messages in provided folder. |
protected EWSMethod.Item |
getEwsItem(String folderPath,
String itemName)
|
protected String |
getEwsUrlFromAutoDiscover()
|
protected String |
getEwsUrlFromAutoDiscover(String autodiscoverHostname)
|
protected FolderId |
getFolderId(String folderPath)
|
protected FolderId |
getFolderIdIfExists(String folderPath)
|
protected String |
getFreeBusyData(String attendee,
String start,
String end,
int interval)
Get freebusy data string from Exchange. |
ExchangeSession.Item |
getItem(String folderPath,
String itemName)
Get item named eventName in folder |
protected Set<String> |
getItemProperties()
|
protected FolderId |
getSubFolderByName(FolderId parentFolderId,
String folderName)
|
protected FolderId |
getSubFolderIdIfExists(String mailbox,
String folderPath)
|
List<ExchangeSession.Folder> |
getSubFolders(String folderPath,
ExchangeSession.Condition condition,
boolean recursive)
Search folders under given folder matching filter. |
protected String |
getTimezoneidFromOptions()
|
ExchangeSession.Condition |
gt(String attributeName,
String value)
Greater than condition. |
ExchangeSession.Condition |
gte(String attributeName,
String value)
Greater than or equals condition. |
ExchangeSession.Condition |
headerIsEqualTo(String headerName,
String value)
MIME header equals condition. |
protected ExchangeSession.ItemResult |
internalCreateOrUpdateContact(String folderPath,
String itemName,
Map<String,String> properties,
String etag,
String noneMatch)
|
protected ExchangeSession.ItemResult |
internalCreateOrUpdateEvent(String folderPath,
String itemName,
String contentClass,
String icsBody,
String etag,
String noneMatch)
|
protected EwsExchangeSession.Folder |
internalGetFolder(String folderPath)
Get folder by path. |
ExchangeSession.Condition |
isEqualTo(String attributeName,
int value)
Equals condition. |
ExchangeSession.Condition |
isEqualTo(String attributeName,
String value)
Equals condition. |
ExchangeSession.Condition |
isFalse(String attributeName)
Is false condition. |
protected static boolean |
isItemId(String itemName)
|
boolean |
isMainCalendar(String folderPath)
Test if folderPath is main calendar. |
ExchangeSession.Condition |
isNull(String attributeName)
Is null condition. |
boolean |
isSharedFolder(String folderPath)
Test if folderPath is inside user mailbox. |
ExchangeSession.Condition |
isTrue(String attributeName)
Is true condition. |
protected void |
loadVtimezone()
|
ExchangeSession.Condition |
lt(String attributeName,
String value)
Lower than condition. |
ExchangeSession.Condition |
lte(String attributeName,
String value)
Lower than or equals condition. |
void |
moveFolder(String folderPath,
String targetFolderPath)
Move folder to target name. |
void |
moveItem(String sourcePath,
String targetPath)
Move item from source path to target path. |
void |
moveMessage(ExchangeSession.Message message,
String targetFolder)
Move message to target folder |
protected void |
moveToTrash(ExchangeSession.Message message)
|
ExchangeSession.Condition |
not(ExchangeSession.Condition condition)
Not search filter. |
ExchangeSession.MultiCondition |
or(ExchangeSession.Condition... condition)
Or search filter. |
protected Date |
parseDateFromExchange(String exchangeDateValue)
|
void |
processItem(String folderPath,
String itemName)
Mark event processed named eventName in folder |
List<ExchangeSession.Contact> |
searchContacts(String folderPath,
Set<String> attributes,
ExchangeSession.Condition condition,
int maxCount)
Search contacts in provided folder matching the search query. |
List<ExchangeSession.Event> |
searchEvents(String folderPath,
Set<String> attributes,
ExchangeSession.Condition condition)
Search calendar events or messages in provided folder matching the search query. |
protected List<EWSMethod.Item> |
searchItems(String folderPath,
Set<String> attributes,
ExchangeSession.Condition condition,
FolderQueryTraversal folderQueryTraversal,
int maxCount)
|
ExchangeSession.MessageList |
searchMessages(String folderPath,
Set<String> attributes,
ExchangeSession.Condition condition)
Search folder for messages matching conditions, with given attributes. |
int |
sendEvent(String icsBody)
Build and send the MIME message for the provided ICS event. |
void |
sendMessage(javax.mail.internet.MimeMessage mimeMessage)
Send Mime message. |
protected void |
sendMessage(String itemClass,
byte[] messageBody)
|
ExchangeSession.Condition |
startsWith(String attributeName,
String value)
Starts with condition. |
int |
updateFolder(String folderPath,
Map<String,String> properties)
Update Exchange folder properties. |
void |
updateMessage(ExchangeSession.Message message,
Map<String,String> properties)
Update given properties on message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final int PAGE_SIZE
protected static final String ARCHIVE_ROOT
protected static final Set<String> MESSAGE_TYPES
protected Map<String,String> folderIdMap
protected static final HashSet<FieldURI> FOLDER_PROPERTIES
protected static final Set<String> ITEM_PROPERTIES
protected static final HashSet<String> EVENT_REQUEST_PROPERTIES
protected static final String USERS_ROOT
protected static final HashMap<String,String> GALFIND_ATTRIBUTE_MAP
protected static final HashSet<String> IGNORE_ATTRIBUTE_SET
protected static final Map<String,String> importanceToPriorityMap
protected static final Map<String,String> priorityToImportanceMap
| Constructor Detail |
|---|
public EwsExchangeSession(String url,
String userName,
String password)
throws IOException
IOException| Method Detail |
|---|
protected org.apache.commons.httpclient.HttpMethod formLogin(org.apache.commons.httpclient.HttpClient httpClient,
org.apache.commons.httpclient.HttpMethod initmethod,
String userName,
String password)
throws IOException
formLogin in class ExchangeSessionIOException
protected void checkEndPointUrl(String endPointUrl)
throws IOException
endPointUrl - endpoint url
IOException - on error
protected void buildSessionInfo(org.apache.commons.httpclient.HttpMethod method)
throws DavMailException
buildSessionInfo in class ExchangeSessionDavMailException
protected String getEwsUrlFromAutoDiscover()
throws DavMailAuthenticationException
DavMailAuthenticationException
protected String getEwsUrlFromAutoDiscover(String autodiscoverHostname)
throws IOException
IOExceptionprotected List<FieldUpdate> buildProperties(Map<String,String> properties)
properties - flag values map
public void createMessage(String folderPath,
String messageName,
HashMap<String,String> properties,
javax.mail.internet.MimeMessage mimeMessage)
throws IOException
ExchangeSession
createMessage in class ExchangeSessionfolderPath - Exchange folder pathmessageName - message nameproperties - message properties (flags)mimeMessage - MIME message
IOException - when unable to create message
public void updateMessage(ExchangeSession.Message message,
Map<String,String> properties)
throws IOException
ExchangeSession
updateMessage in class ExchangeSessionmessage - Exchange messageproperties - Webdav properties map
IOException - on error
public void deleteMessage(ExchangeSession.Message message)
throws IOException
ExchangeSession
deleteMessage in class ExchangeSessionmessage - Exchange message
IOException - on error
protected void sendMessage(String itemClass,
byte[] messageBody)
throws IOException
IOException
public void sendMessage(javax.mail.internet.MimeMessage mimeMessage)
throws IOException,
javax.mail.MessagingException
ExchangeSession
sendMessage in class ExchangeSessionmimeMessage - MIME message
IOException - on error
javax.mail.MessagingException - on error
protected byte[] getContent(ExchangeSession.Message message)
throws IOException
ExchangeSession
getContent in class ExchangeSessionmessage - Exchange message
IOException - on error
protected byte[] getContent(ItemId itemId)
throws IOException
itemId - EWS item id
IOException - on error
protected davmail.exchange.ews.EwsExchangeSession.Message buildMessage(EWSMethod.Item response)
throws DavMailException
DavMailException
public ExchangeSession.MessageList searchMessages(String folderPath,
Set<String> attributes,
ExchangeSession.Condition condition)
throws IOException
ExchangeSession
searchMessages in class ExchangeSessionfolderPath - Exchange folder nameattributes - requested Webdav attributescondition - search filter
IOException - on error
protected List<EWSMethod.Item> searchItems(String folderPath,
Set<String> attributes,
ExchangeSession.Condition condition,
FolderQueryTraversal folderQueryTraversal,
int maxCount)
throws IOException
IOExceptionpublic ExchangeSession.MultiCondition and(ExchangeSession.Condition... condition)
ExchangeSession
and in class ExchangeSessioncondition - search conditions
public ExchangeSession.MultiCondition or(ExchangeSession.Condition... condition)
ExchangeSession
or in class ExchangeSessioncondition - search conditions
public ExchangeSession.Condition not(ExchangeSession.Condition condition)
ExchangeSession
not in class ExchangeSessioncondition - search condition
public ExchangeSession.Condition isEqualTo(String attributeName,
String value)
ExchangeSession
isEqualTo in class ExchangeSessionattributeName - logical Exchange attribute namevalue - attribute value
public ExchangeSession.Condition isEqualTo(String attributeName,
int value)
ExchangeSession
isEqualTo in class ExchangeSessionattributeName - logical Exchange attribute namevalue - attribute value
public ExchangeSession.Condition headerIsEqualTo(String headerName,
String value)
ExchangeSession
headerIsEqualTo in class ExchangeSessionheaderName - MIME header namevalue - attribute value
public ExchangeSession.Condition gte(String attributeName,
String value)
ExchangeSession
gte in class ExchangeSessionattributeName - logical Exchange attribute namevalue - attribute value
public ExchangeSession.Condition lte(String attributeName,
String value)
ExchangeSession
lte in class ExchangeSessionattributeName - logical Exchange attribute namevalue - attribute value
public ExchangeSession.Condition lt(String attributeName,
String value)
ExchangeSession
lt in class ExchangeSessionattributeName - logical Exchange attribute namevalue - attribute value
public ExchangeSession.Condition gt(String attributeName,
String value)
ExchangeSession
gt in class ExchangeSessionattributeName - logical Exchange attribute namevalue - attribute value
public ExchangeSession.Condition contains(String attributeName,
String value)
ExchangeSession
contains in class ExchangeSessionattributeName - logical Exchange attribute namevalue - attribute value
public ExchangeSession.Condition startsWith(String attributeName,
String value)
ExchangeSession
startsWith in class ExchangeSessionattributeName - logical Exchange attribute namevalue - attribute value
public ExchangeSession.Condition isNull(String attributeName)
ExchangeSession
isNull in class ExchangeSessionattributeName - logical Exchange attribute name
public ExchangeSession.Condition isTrue(String attributeName)
ExchangeSession
isTrue in class ExchangeSessionattributeName - logical Exchange attribute name
public ExchangeSession.Condition isFalse(String attributeName)
ExchangeSession
isFalse in class ExchangeSessionattributeName - logical Exchange attribute name
protected EwsExchangeSession.Folder buildFolder(EWSMethod.Item item)
public List<ExchangeSession.Folder> getSubFolders(String folderPath,
ExchangeSession.Condition condition,
boolean recursive)
throws IOException
ExchangeSession
getSubFolders in class ExchangeSessionfolderPath - Exchange folder namecondition - search filterrecursive - deep search if true
IOException - on error
protected void appendSubFolders(List<ExchangeSession.Folder> folders,
String parentFolderPath,
FolderId parentFolderId,
ExchangeSession.Condition condition,
boolean recursive)
throws IOException
IOException
protected EwsExchangeSession.Folder internalGetFolder(String folderPath)
throws IOException
internalGetFolder in class ExchangeSessionfolderPath - folder path
IOException - on error
public int createFolder(String folderPath,
String folderClass,
Map<String,String> properties)
throws IOException
ExchangeSession
createFolder in class ExchangeSessionfolderPath - logical folder namefolderClass - folder classproperties - folder properties
IOException - on error
public int updateFolder(String folderPath,
Map<String,String> properties)
throws IOException
ExchangeSession
updateFolder in class ExchangeSessionfolderPath - logical folder nameproperties - folder properties
IOException - on error
public void deleteFolder(String folderPath)
throws IOException
ExchangeSession
deleteFolder in class ExchangeSessionfolderPath - logical folder name
IOException - on error
public void moveMessage(ExchangeSession.Message message,
String targetFolder)
throws IOException
ExchangeSession
moveMessage in class ExchangeSessionmessage - Exchange messagetargetFolder - target folder
IOException - on error
public void copyMessage(ExchangeSession.Message message,
String targetFolder)
throws IOException
ExchangeSession
copyMessage in class ExchangeSessionmessage - Exchange messagetargetFolder - target folder
IOException - on error
public void moveFolder(String folderPath,
String targetFolderPath)
throws IOException
ExchangeSession
moveFolder in class ExchangeSessionfolderPath - current folder name/pathtargetFolderPath - target folder name/path
IOException - on error
public void moveItem(String sourcePath,
String targetPath)
throws IOException
ExchangeSession
moveItem in class ExchangeSessionsourcePath - item source pathtargetPath - item target path
IOException - on error
protected void moveToTrash(ExchangeSession.Message message)
throws IOException
moveToTrash in class ExchangeSessionIOException
public List<ExchangeSession.Contact> searchContacts(String folderPath,
Set<String> attributes,
ExchangeSession.Condition condition,
int maxCount)
throws IOException
ExchangeSession
searchContacts in class ExchangeSessionfolderPath - Exchange folder pathattributes - requested attributescondition - Exchange search querymaxCount - maximum item count
IOException - on errorprotected ExchangeSession.Condition getCalendarItemCondition(ExchangeSession.Condition dateCondition)
getCalendarItemCondition in class ExchangeSession
public List<ExchangeSession.Event> getEventMessages(String folderPath)
throws IOException
ExchangeSession
getEventMessages in class ExchangeSessionfolderPath - Exchange folder path
IOException - on error
public List<ExchangeSession.Event> searchEvents(String folderPath,
Set<String> attributes,
ExchangeSession.Condition condition)
throws IOException
ExchangeSession
searchEvents in class ExchangeSessionfolderPath - Exchange folder pathattributes - requested attributescondition - Exchange search query
IOException - on errorprotected Set<String> getItemProperties()
getItemProperties in class ExchangeSession
protected EWSMethod.Item getEwsItem(String folderPath,
String itemName)
throws IOException
IOException
public ExchangeSession.Item getItem(String folderPath,
String itemName)
throws IOException
ExchangeSession
getItem in class ExchangeSessionfolderPath - Exchange folder pathitemName - event name
IOException - on error
public ExchangeSession.ContactPhoto getContactPhoto(ExchangeSession.Contact contact)
throws IOException
ExchangeSession
getContactPhoto in class ExchangeSessioncontact - address book contact
IOException - on error
public void deleteItem(String folderPath,
String itemName)
throws IOException
ExchangeSession
deleteItem in class ExchangeSessionfolderPath - Exchange folder pathitemName - item name
IOException - on error
public void processItem(String folderPath,
String itemName)
throws IOException
ExchangeSession
processItem in class ExchangeSessionfolderPath - Exchange folder pathitemName - item name
IOException - on error
public int sendEvent(String icsBody)
throws IOException
ExchangeSession
sendEvent in class ExchangeSessionicsBody - event in iCalendar format
IOException - on error
protected ExchangeSession.ItemResult internalCreateOrUpdateContact(String folderPath,
String itemName,
Map<String,String> properties,
String etag,
String noneMatch)
throws IOException
internalCreateOrUpdateContact in class ExchangeSessionIOException
protected ExchangeSession.ItemResult internalCreateOrUpdateEvent(String folderPath,
String itemName,
String contentClass,
String icsBody,
String etag,
String noneMatch)
throws IOException
internalCreateOrUpdateEvent in class ExchangeSessionIOExceptionpublic boolean isSharedFolder(String folderPath)
ExchangeSession
isSharedFolder in class ExchangeSessionfolderPath - absolute folder path
public boolean isMainCalendar(String folderPath)
ExchangeSession
isMainCalendar in class ExchangeSessionfolderPath - absolute folder path
protected String getFreeBusyData(String attendee,
String start,
String end,
int interval)
throws IOException
ExchangeSession
getFreeBusyData in class ExchangeSessionattendee - attendee email addressstart - start date in Exchange zulu formatend - end date in Exchange zulu formatinterval - freebusy interval in minutes
IOException - on errorprotected void loadVtimezone()
loadVtimezone in class ExchangeSessionprotected String getTimezoneidFromOptions()
protected FolderId getFolderId(String folderPath)
throws IOException
IOException
protected FolderId getFolderIdIfExists(String folderPath)
throws IOException
IOException
protected FolderId getSubFolderIdIfExists(String mailbox,
String folderPath)
throws IOException
IOException
protected FolderId getSubFolderByName(FolderId parentFolderId,
String folderName)
throws IOException
IOException
protected void executeMethod(EWSMethod ewsMethod)
throws IOException
IOExceptionprotected EwsExchangeSession.Contact buildGalfindContact(EWSMethod.Item response)
public Map<String,ExchangeSession.Contact> galFind(ExchangeSession.Condition condition,
Set<String> returningAttributes,
int sizeLimit)
throws IOException
ExchangeSession
galFind in class ExchangeSessioncondition - search filterreturningAttributes - returning attributessizeLimit - size limit
IOException - on error
protected Date parseDateFromExchange(String exchangeDateValue)
throws DavMailException
DavMailException
protected String convertDateFromExchange(String exchangeDateValue)
throws DavMailException
DavMailException
protected String convertCalendarDateToExchange(String vcalendarDateValue)
throws DavMailException
DavMailException
protected String convertDateFromExchangeToTaskDate(String exchangeDateValue)
throws DavMailException
DavMailExceptionprotected String convertTaskDateToZulu(String value)
public String formatSearchDate(Date date)
formatSearchDate in class ExchangeSessiondate - date object
protected static boolean isItemId(String itemName)
protected String convertPriorityFromExchange(String exchangeImportanceValue)
protected String convertPriorityToExchange(String vTodoPriorityValue)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||