|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExchangeItem
Base interface for all Exchange items. Specific sub-interfaces like ExchangeContact
,
ExchangeMail
or ExchangeCalendarItem
represents concrete typed Exchange items.
The ExchangeFolder
object contains
methods to create Exchange items in a specific folder: createItem(ItemType)
,
createContact()
, createMail()
, etc.
Example code that iterates over items in the Contacts folder:
Exchange exchange = new Exchange("hostname", "username", "password");
ItemsCollection items = exchange.getContactsFolder().getItems();
for(ExchangeItem item : items)
{
System.out.println(item.getItemId());
}
Method Summary | |
---|---|
ExchangeItem |
copyTo(ExchangeFolder folder)
Creates a copy of this item in the specified folder. |
ExchangeItem |
copyTo(ExchangeFolder folder,
boolean searchCopiedItem)
|
void |
delete(boolean moveToDeletedItems)
Deletes this item. |
AttachmentsCollection |
getAttachments()
Returns a collection containing attachments attached to this item. |
java.lang.String |
getBody()
Returns the body of this item. |
java.lang.String |
getBodyAsText()
Returns the body of this item in text format in the case an HTML body type is used. |
BodyType |
getBodyType()
Returns the type of the body of this item (Text or HTML). |
java.util.List<java.lang.String> |
getCategories()
Returns a list of Strings that identify to which categories an item in the mailbox belongs. |
java.lang.String |
getCulture()
|
java.util.Date |
getDateTimeCreated()
Returns the date and time that this item was created. |
java.util.Date |
getDateTimeReceived()
Returns the date and time that this item was received in a mailbox. |
java.util.Date |
getDateTimeSent()
Returns the date and time that this item was sent. |
java.lang.String |
getDisplayCc()
Returns the display string that is used for the contents of the CC box. |
java.lang.String |
getDisplayTo()
Returns the display string that is used for the contents of the To box. |
ExtendedProperties |
getExtendedProperties()
|
ImportanceChoices |
getImportance()
Returns the importance of this item. |
java.lang.String |
getInReplyTo()
Represents the identifier of the item to which this item is a reply. |
java.util.List<InternetHeader> |
getInternetMessageHeaders()
Returns a list of all Internet message headers of this item. |
java.lang.String |
getItemClass()
Returns the message class of this item. |
java.lang.String |
getItemId()
Returns a unique identifier for this item. |
java.lang.String |
getItemIdChangeKey()
Returns the change key for this item. |
ItemType |
getItemType()
Returns the type of this item or null if the type is unknown. |
java.lang.String |
getLastModifiedName()
Returns the display name of the last user who modified this item. |
java.util.Date |
getLastModifiedTime()
Returns the date and time when this item has been modified for the last time. |
java.lang.String |
getMimeContent()
Returns the native Multipurpose Internet Mail Extensions (MIME) stream. |
byte[] |
getMimeContentBytes()
Returns the native Multipurpose Internet Mail Extensions (MIME) stream as a bytes array. |
java.lang.String |
getMimeContentCharacterSet()
Returns the ISO name of the character set used in the MIME message. |
java.io.Reader |
getMimeContentReader()
Returns the native Multipurpose Internet Mail Extensions (MIME) stream. |
java.io.InputStream |
getMimeContentStream()
Returns the native Multipurpose Internet Mail Extensions (MIME) stream. |
ExchangeFolder |
getParentFolder()
Returns the parent folder containing this item. |
java.lang.String |
getParentFolderId()
Returns the unique identifier of the parent folder containing this item. |
java.lang.String |
getParentFolderIdChangeKey()
Returns the change key of the parent folder containing this item. |
java.util.Date |
getReminderDueBy()
Returns the date and time when this event occurs. |
int |
getReminderMinutesBeforeStart()
Returns the number of minutes before the reminder due date when the reminder will be displayed. |
java.util.List<ResponseMailType> |
getResponsesTypes()
|
SensitivityChoices |
getSensitivity()
Returns the sensitivity level of this item. |
int |
getSize()
Returns the size in bytes of this item. |
java.lang.String |
getSubject()
Returns the subject of this item. |
boolean |
hasVisibleAttachments()
Returns true if this item has at least one visible attachment, false otherwise. |
boolean |
isDraft()
Returns true if this item is a draft and has not yet been sent, false otherwise. |
boolean |
isFromMe()
Indicates whether a user sent this item to itself. |
boolean |
isReminderSet()
Returns true is a reminder is set for this item. |
boolean |
isResend()
Returns true if this item item had previously been sent. |
boolean |
isStored()
Returns true if this item exists in the Exchange store; false if this item was never saved or was deleted. |
boolean |
isSubmitted()
Returns true if this item has been submitted to the Outbox default folder. |
void |
moveTo(ExchangeFolder folder)
Moves this item to the specified folder. |
void |
moveTo(ExchangeFolder folder,
boolean searchMovedItem)
|
void |
save()
Saves all the changes made to this item in the Exchange store. |
void |
save(boolean overwriteIfConflict)
Saves all the changes made to this item in the Exchange store. |
void |
saveTo(java.io.File file)
Saves the content of this message to the specified file in RFC-822 format (EML format). |
void |
setBody(java.lang.String body)
Sets the body of this item. |
void |
setBody(java.lang.String body,
BodyType type)
Sets the body of this item in Text or HTML format depending on the type specified. |
void |
setCategories(java.util.List<java.lang.String> categories)
Sets the list of categories to which an item belongs. |
void |
setCulture(java.lang.String culture)
|
void |
setImportance(ImportanceChoices importance)
Sets the importance of this item. |
void |
setMimeContent(byte[] mimeContent)
Sets the MIME content. |
void |
setMimeContent(java.io.InputStream mimeContent)
Sets the MIME content. |
void |
setMimeContent(java.lang.String mimeContent)
Sets the MIME content. |
void |
setReminder(java.util.Date reminderDueBy,
boolean isReminderSet,
int remindMinutesBeforeStart)
Sets a reminder for this item. |
void |
setSensitivity(SensitivityChoices sensitivity)
Sets the sensitivity level of this item. |
void |
setSubject(java.lang.String subject)
Sets the subject of this item. |
Method Detail |
---|
java.io.InputStream getMimeContentStream() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.io.Reader getMimeContentReader() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.lang.String getMimeContent() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.byte[] getMimeContentBytes() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.lang.String getMimeContentCharacterSet() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void setMimeContent(java.lang.String mimeContent) throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void setMimeContent(byte[] mimeContent) throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void setMimeContent(java.io.InputStream mimeContent) throws ExchangeServiceException, java.io.IOException
ExchangeServiceException
- if any errors occur during the communication with Exchange.
java.io.IOException
java.lang.String getItemId()
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.lang.String getItemIdChangeKey()
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.lang.String getParentFolderId() throws ExchangeServiceException
getParentFolder()
to get the parent folder's ExchangeFolder object.
ExchangeServiceException
- if any errors occur during the communication with Exchange.getParentFolder()
java.lang.String getParentFolderIdChangeKey() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.ExchangeFolder getParentFolder() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.lang.String getItemClass() throws ExchangeServiceException
"IPM.Appointment" for appointments.
"IPM.Contact" for contacts.
"IPM.Activity" for Journal entries.
"IPM.Note" for e-mail messages.
"IPM.StickyNote" for Outlook sticky notes.
"IPM.Task" for tasks.
ExchangeServiceException
- if any errors occur during the communication with Exchange.ItemType getItemType() throws ExchangeServiceException
getItemClass()
.
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.lang.String getSubject() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void setSubject(java.lang.String subject) throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.SensitivityChoices getSensitivity() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void setSensitivity(SensitivityChoices sensitivity) throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.lang.String getBody() throws ExchangeServiceException
getBodyType()
.
ExchangeServiceException
- if any errors occur during the communication with Exchange.BodyType getBodyType() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void setBody(java.lang.String body) throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void setBody(java.lang.String body, BodyType type) throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.lang.String getBodyAsText() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.AttachmentsCollection getAttachments() throws ExchangeServiceException
To add new attachments to this item, use the method AttachmentsCollection.add
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.util.Date getDateTimeReceived() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.int getSize() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.util.List<java.lang.String> getCategories() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void setCategories(java.util.List<java.lang.String> categories) throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.ImportanceChoices getImportance() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void setImportance(ImportanceChoices importance) throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.lang.String getInReplyTo() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.boolean isSubmitted() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.boolean isDraft() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.boolean isFromMe() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.boolean isResend() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.util.List<InternetHeader> getInternetMessageHeaders() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.util.Date getDateTimeSent() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.util.Date getDateTimeCreated() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.util.List<ResponseMailType> getResponsesTypes() throws ExchangeServiceException
ExchangeServiceException
java.util.Date getReminderDueBy() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void setReminder(java.util.Date reminderDueBy, boolean isReminderSet, int remindMinutesBeforeStart) throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.boolean isReminderSet() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.int getReminderMinutesBeforeStart() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.lang.String getDisplayCc() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.lang.String getDisplayTo() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.boolean hasVisibleAttachments() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.ExtendedProperties getExtendedProperties() throws ExchangeServiceException
ExchangeServiceException
java.lang.String getCulture() throws ExchangeServiceException
ExchangeServiceException
void setCulture(java.lang.String culture) throws ExchangeServiceException
ExchangeServiceException
java.lang.String getLastModifiedName() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.java.util.Date getLastModifiedTime() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void save(boolean overwriteIfConflict) throws ExchangeServiceException
overwriteIfConflict
- if true and a conflict occurs the item will be always overwritten, otherwise an exception will be thrown in case of a conflict.
ExchangeServiceException
- if any errors occur during the communication with Exchange.void save() throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void delete(boolean moveToDeletedItems) throws ExchangeServiceException
moveToDeletedItems
- specifies whether the item is simply moved to the Deleted Items folder or definitely deleted.
ExchangeServiceException
- if any errors occur during the communication with Exchange.void moveTo(ExchangeFolder folder) throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.void moveTo(ExchangeFolder folder, boolean searchMovedItem) throws ExchangeServiceException
ExchangeServiceException
ExchangeItem copyTo(ExchangeFolder folder) throws ExchangeServiceException
ExchangeServiceException
- if any errors occur during the communication with Exchange.ExchangeItem copyTo(ExchangeFolder folder, boolean searchCopiedItem) throws ExchangeServiceException
ExchangeServiceException
void saveTo(java.io.File file) throws ExchangeServiceException, java.io.IOException
This method also saves all the changes made to this item in the Exchange store. In case of a conflict, the item won't be saved and an exception will be thrown by this method.
ExchangeServiceException
- if any errors occur during the communication with Exchange.
java.io.IOException
- if errors occur when writing to the specified file.boolean isStored() throws ExchangeServiceException
ExchangeServiceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |