Class ExchangeService
- java.lang.Object
-
- microsoft.exchange.webservices.data.core.ExchangeServiceBase
-
- microsoft.exchange.webservices.data.core.ExchangeService
-
- All Implemented Interfaces:
Closeable,AutoCloseable,IAutodiscoverRedirectionUrl
public class ExchangeService extends ExchangeServiceBase implements IAutodiscoverRedirectionUrl
Represents a binding to the Exchange Web Services.
-
-
Field Summary
-
Fields inherited from class microsoft.exchange.webservices.data.core.ExchangeServiceBase
externalHttpClient, externalHttpPoolingClient, httpClient, httpContext, httpPoolingClient
-
-
Constructor Summary
Constructors Constructor Description ExchangeService()Initializes a new instance of theExchangeServiceclass, targeting the specified version of EWS and scoped to the to the system's current time zone.ExchangeService(ExchangeVersion requestedServerVersion)Initializes a new instance of theExchangeServiceclass, targeting the specified version of EWS and scoped to the system's current time zone.ExchangeService(ExchangeVersion requestedServerVersion, org.apache.http.impl.client.CloseableHttpClient httpClient, org.apache.http.impl.client.CloseableHttpClient httpPoolingClient)Initializes a new instance of theExchangeServiceclass, targeting the specified version of EWS and scoped to the system's current time zone.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<DelegateUserResponse>addDelegates(Mailbox mailbox, MeetingRequestsDeliveryScope meetingRequestsDeliveryScope, Iterable<DelegateUser> delegateUsers)Adds delegates to a specific mailbox.Collection<DelegateUserResponse>addDelegates(Mailbox mailbox, MeetingRequestsDeliveryScope meetingRequestsDeliveryScope, DelegateUser... delegateUsers)Adds delegates to a specific mailbox.booleanautodiscoverRedirectionUrlValidationCallback(String redirectionUrl)Autodiscover redirection url validation callback.voidautodiscoverUrl(String emailAddress)Initializes the Url property to the Exchange Web Services URL for the specified e-mail address by calling the Autodiscover service.voidautodiscoverUrl(String emailAddress, IAutodiscoverRedirectionUrl validateRedirectionUrlCallback)Initializes the Url property to the Exchange Web Services URL for the specified e-mail address by calling the Autodiscover service.IAsyncResultbeginGetEvents(AsyncCallback callback, Object state, String subscriptionId, String watermark)Begins an asynchronous request to retrieve the latest events associated with a pull subscription.AsyncRequestResultbeginSubscribeToPullNotifications(AsyncCallback callback, Object state, Iterable<FolderId> folderIds, int timeout, String watermark, EventType... eventTypes)Begins an asynchronous request to subscribes to pull notification.IAsyncResultbeginSubscribeToPullNotificationsOnAllFolders(AsyncCallback callback, Object state, int timeout, String watermark, EventType... eventTypes)Begins an asynchronous request to subscribe to pull notification on all folder in the authenticated user's mailbox.IAsyncResultbeginSubscribeToPushNotifications(AsyncCallback callback, Object state, Iterable<FolderId> folderIds, URI url, int frequency, String watermark, EventType... eventTypes)Begins an asynchronous request to subscribe to push notification.IAsyncResultbeginSubscribeToPushNotificationsOnAllFolders(AsyncCallback callback, Object state, URI url, int frequency, String watermark, EventType... eventTypes)Begins an asynchronous request to subscribe to push notification on all folder in the authenticated user's mailbox.IAsyncResultbeginSubscribeToStreamingNotifications(AsyncCallback callback, Object state, Iterable<FolderId> folderIds, EventType... eventTypes)Begins an asynchronous request to subscribe to streaming notification.IAsyncResultbeginSubscribeToStreamingNotificationsOnAllFolders(AsyncCallback callback, Object state, EventType... eventTypes)Begins an asynchronous request to subscribe to streaming notification on all folder in the authenticated user's mailbox.IAsyncResultbeginSyncFolderHierarchy(AsyncCallback callback, Object state, FolderId syncFolderId, PropertySet propertySet, String syncState)Begins an asynchronous request to synchronize the sub-folder of a specific folder.IAsyncResultbeginSyncFolderItems(AsyncCallback callback, Object state, FolderId syncFolderId, PropertySet propertySet, Iterable<ItemId> ignoredItemIds, int maxChangesReturned, SyncFolderItemsScope syncScope, String syncState)Begins an asynchronous request to synchronize the item of a specific folder.IAsyncResultbeginUnsubscribe(AsyncCallback callback, Object state, String subscriptionId)Begins an asynchronous request to unsubscribe from a subscription.<TFolder extends Folder>
TFolderbindToFolder(Class<TFolder> cls, FolderId folderId, PropertySet propertySet)Binds to folder.FolderbindToFolder(FolderId folderId, PropertySet propertySet)Binds to a folder.<TItem extends Item>
TItembindToItem(Class<TItem> c, ItemId itemId, PropertySet propertySet)Bind to item.ItembindToItem(ItemId itemId, PropertySet propertySet)Binds to multiple item in a single call to EWS.ServiceResponseCollection<GetItemResponse>bindToItems(Iterable<ItemId> itemIds, PropertySet propertySet)Binds to multiple item in a single call to EWS.AlternateIdBaseconvertId(AlternateIdBase id, IdFormat destinationFormat)Converts Id from one format to another in a single call to EWS.ServiceResponseCollection<ConvertIdResponse>convertIds(Iterable<AlternateIdBase> ids, IdFormat destinationFormat)Converts multiple Ids from one format to another in a single call to EWS.FoldercopyFolder(FolderId folderId, FolderId destinationFolderId)Copies a folder.ItemcopyItem(ItemId itemId, FolderId destinationFolderId)Copies an item.ServiceResponseCollection<MoveCopyItemResponse>copyItems(Iterable<ItemId> itemIds, FolderId destinationFolderId)Copies multiple item in a single call to EWS.ServiceResponseCollection<MoveCopyItemResponse>copyItems(Iterable<ItemId> itemIds, FolderId destinationFolderId, boolean returnNewItemIds)Copies multiple item in a single call to EWS.ServiceResponseCollection<ServiceResponse>copyItemsInConversations(Iterable<HashMap<ConversationId,Date>> idLastSyncTimePairs, FolderId contextFolderId, FolderId destinationFolderId)Copies the item in the specified conversation to the specified destination folder.ServiceResponseCollection<CreateAttachmentResponse>createAttachments(String parentItemId, Iterable<Attachment> attachments)Creates attachments.voidcreateFolder(Folder folder, FolderId parentFolderId)Creates a folder.voidcreateItem(Item item, FolderId parentFolderId, MessageDisposition messageDisposition, SendInvitationsMode sendInvitationsMode)Creates an item.ServiceResponseCollection<ServiceResponse>createItems(Collection<Item> items, FolderId parentFolderId, MessageDisposition messageDisposition, SendInvitationsMode sendInvitationsMode)Creates multiple item in a single EWS call.voidcreateUserConfiguration(UserConfiguration userConfiguration)Creates the user configuration.ServiceResponseCollection<DeleteAttachmentResponse>deleteAttachments(Iterable<Attachment> attachments)Deletes attachments.voiddeleteFolder(FolderId folderId, DeleteMode deleteMode)Deletes a folder.voiddeleteItem(ItemId itemId, DeleteMode deleteMode, SendCancellationsMode sendCancellationsMode, AffectedTaskOccurrence affectedTaskOccurrences)Deletes an item.ServiceResponseCollection<ServiceResponse>deleteItems(Iterable<ItemId> itemIds, DeleteMode deleteMode, SendCancellationsMode sendCancellationsMode, AffectedTaskOccurrence affectedTaskOccurrences)Deletes multiple item in a single call to EWS.ServiceResponseCollection<ServiceResponse>deleteItemsInConversations(Iterable<HashMap<ConversationId,Date>> idLastSyncTimePairs, FolderId contextFolderId, DeleteMode deleteMode)Deletes the item in the specified conversation.voiddeleteUserConfiguration(String name, FolderId parentFolderId)Creates a UserConfiguration.ServiceResponseCollection<ServiceResponse>disableAlwaysCategorizeItemsInConversations(Iterable<ConversationId> conversationId, boolean processSynchronously)Sets up a conversation so that any item received within that conversation is no longer categorized.ServiceResponseCollection<ServiceResponse>disableAlwaysDeleteItemsInConversations(Iterable<ConversationId> conversationId, boolean processSynchronously)Sets up a conversation so that any item received within that conversation is no longer moved to Deleted Items folder.ServiceResponseCollection<ServiceResponse>disableAlwaysMoveItemsInConversations(Iterable<ConversationId> conversationIds, boolean processSynchronously)Sets up a conversation so that any item received within that conversation is no longer moved to a specific folder.voidemptyFolder(FolderId folderId, DeleteMode deleteMode, boolean deleteSubFolders)Empties a folder.ServiceResponseCollection<ServiceResponse>enableAlwaysCategorizeItemsInConversations(Iterable<ConversationId> conversationId, Iterable<String> categories, boolean processSynchronously)Sets up a conversation so that any item received within that conversation is always categorized.ServiceResponseCollection<ServiceResponse>enableAlwaysDeleteItemsInConversations(Iterable<ConversationId> conversationId, boolean processSynchronously)Sets up a conversation so that any item received within that conversation is always moved to Deleted Items folder.ServiceResponseCollection<ServiceResponse>enableAlwaysMoveItemsInConversations(Iterable<ConversationId> conversationId, FolderId destinationFolderId, boolean processSynchronously)Sets up a conversation so that any item received within that conversation is always moved to a specific folder.GetEventsResultsendGetEvents(IAsyncResult asyncResult)Ends an asynchronous request to retrieve the latest events associated with a pull subscription.PullSubscriptionendSubscribeToPullNotifications(IAsyncResult asyncResult)Ends an asynchronous request to subscribe to pull notification in the authenticated user's mailbox.PushSubscriptionendSubscribeToPushNotifications(IAsyncResult asyncResult)Ends an asynchronous request to subscribe to push notification in the authenticated user's mailbox.StreamingSubscriptionendSubscribeToStreamingNotifications(IAsyncResult asyncResult)Ends an asynchronous request to subscribe to push notification in the authenticated user's mailbox.ChangeCollection<FolderChange>endSyncFolderHierarchy(IAsyncResult asyncResult)Ends an asynchronous request to synchronize the specified folder hierarchy of the mailbox this Service is connected to.ChangeCollection<ItemChange>endSyncFolderItems(IAsyncResult asyncResult)Ends an asynchronous request to synchronize the item of a specific folder.voidendUnsubscribe(IAsyncResult asyncResult)Ends an asynchronous request to unsubscribe from a subscription.protected DocumentexecuteDiagnosticMethod(String verb, Node parameter)Executes the diagnostic method.ExpandGroupResultsexpandGroup(String smtpAddress)Expands a group by retrieving a list of its members.ExpandGroupResultsexpandGroup(String address, String routingType)Expands a group by retrieving a list of its members.ExpandGroupResultsexpandGroup(EmailAddress emailAddress)Expands a group by retrieving a list of its members.ExpandGroupResultsexpandGroup(ItemId groupId)Expands a group by retrieving a list of its members.ExportItemsResponseexportItem(ItemId itemId)ServiceResponseCollection<ExportItemsResponse>exportItems(Iterable<ItemId> itemIds)FindItemsResults<Appointment>findAppointments(WellKnownFolderName parentFolderName, CalendarView calendarView)Obtains a list of appointments by searching the contents of a specific folder.FindItemsResults<Appointment>findAppointments(FolderId parentFolderId, CalendarView calendarView)Obtains a list of appointments by searching the contents of a specific folder.Collection<Conversation>findConversation(ConversationIndexedItemView view, FolderId folderId)Retrieves a collection of all Conversations in the specified Folder.FindFoldersResultsfindFolders(WellKnownFolderName parentFolderName, SearchFilter searchFilter, FolderView view)Obtains a list of folder by searching the sub-folder of the specified folder.FindFoldersResultsfindFolders(WellKnownFolderName parentFolderName, FolderView view)Obtains a list of folder by searching the sub-folder of the specified folder.FindFoldersResultsfindFolders(FolderId parentFolderId, SearchFilter searchFilter, FolderView view)Obtains a list of folder by searching the sub-folder of the specified folder.FindFoldersResultsfindFolders(FolderId parentFolderId, FolderView view)Obtains a list of folder by searching the sub-folder of the specified folder.protected <TItem extends Item>
ServiceResponseCollection<FindItemResponse<TItem>>findItems(Class<TItem> cls, FolderId parentFolderId, SearchFilter searchFilter, ViewBase view, Grouping groupBy)Obtains a grouped list of item by searching the contents of a specific folder.<TItem extends Item>
ServiceResponseCollection<FindItemResponse<TItem>>findItems(Iterable<FolderId> parentFolderIds, SearchFilter searchFilter, String queryString, ViewBase view, Grouping groupBy, ServiceErrorHandling errorHandlingMode)Finds item.FindItemsResults<Item>findItems(WellKnownFolderName parentFolderName, String queryString, ItemView view)Obtains a list of item by searching the contents of a specific folder.GroupedFindItemsResults<Item>findItems(WellKnownFolderName parentFolderName, String queryString, ItemView view, Grouping groupBy)Obtains a grouped list of item by searching the contents of a specific folder.FindItemsResults<Item>findItems(WellKnownFolderName parentFolderName, SearchFilter searchFilter, ItemView view)Obtains a list of item by searching the contents of a specific folder.GroupedFindItemsResults<Item>findItems(WellKnownFolderName parentFolderName, SearchFilter searchFilter, ItemView view, Grouping groupBy)Obtains a grouped list of item by searching the contents of a specific folder.FindItemsResults<Item>findItems(WellKnownFolderName parentFolderName, ItemView view)Obtains a list of item by searching the contents of a specific folder.FindItemsResults<Item>findItems(FolderId parentFolderId, String queryString, ItemView view)Obtains a list of item by searching the contents of a specific folder.GroupedFindItemsResults<Item>findItems(FolderId parentFolderId, String queryString, ItemView view, Grouping groupBy)Obtains a grouped list of item by searching the contents of a specific folder.FindItemsResults<Item>findItems(FolderId parentFolderId, SearchFilter searchFilter, ItemView view)Obtains a list of item by searching the contents of a specific folder.GroupedFindItemsResults<Item>findItems(FolderId parentFolderId, SearchFilter searchFilter, ItemView view, Grouping groupBy)Obtains a grouped list of item by searching the contents of a specific folder.FindItemsResults<Item>findItems(FolderId parentFolderId, ItemView view)Obtains a list of item by searching the contents of a specific folder.GroupedFindItemsResults<Item>findItems(FolderId parentFolderId, ItemView view, Grouping groupBy)Obtains a grouped list of item by searching the contents of a specific folder.voidgetAttachment(Attachment attachment, BodyType bodyType, Iterable<PropertyDefinitionBase> additionalProperties)Gets the attachment.protected ServiceResponseCollection<GetAttachmentResponse>getAttachments(Attachment[] attachments, BodyType bodyType, Iterable<PropertyDefinitionBase> additionalProperties)Gets attachments.DateTimePrecisiongetDateTimePrecision()Gets the DateTime precision for DateTime values returned from Exchange Web Services.DelegateInformationgetDelegates(Mailbox mailbox, boolean includePermissions, Iterable<UserId> userIds)Retrieves the delegates of a specific mailbox.DelegateInformationgetDelegates(Mailbox mailbox, boolean includePermissions, UserId... userIds)Retrieves the delegates of a specific mailbox.booleangetEnableScpLookup()Gets or sets a value indicating whether the AutodiscoverUrl method should perform SCP (Service Connection Point) record lookup when determining the Autodiscover service URL.GetEventsResultsgetEvents(String subscriptionId, String waterMark)Retrieves the latests events associated with a pull subscription.booleangetExchange2007CompatibilityMode()Returns true whether Exchange2007 compatibility mode is enabled, false otherwise.IFileAttachmentContentHandlergetFileAttachmentContentHandler()Gets the file attachment content handler.ImpersonatedUserIdgetImpersonatedUserId()Gets the impersonated user id.RuleCollectiongetInboxRules()Retrieves inbox rules of the authenticated user.RuleCollectiongetInboxRules(String mailboxSmtpAddress)Retrieves the inbox rules of the specified user.DategetPasswordExpirationDate(String mailboxSmtpAddress)Get the password expiration dateLocalegetPreferredCulture()Gets the preferred culture.EmailAddressCollectiongetRoomLists()Retrieves a collection of all room lists in the organization.Collection<EmailAddress>getRooms(EmailAddress emailAddress)Retrieves a collection of all room lists in the specified room list in the organization.Collection<TimeZoneDefinition>getServerTimeZones()Retrieves the definitions of all server-side time zones.Collection<TimeZoneDefinition>getServerTimeZones(Iterable<String> timeZoneIds)Retrieves the definitions of the specified server-side time zones.UnifiedMessaginggetUnifiedMessaging()Provides access to the Unified Messaging functionalities.URIgetUrl()Gets the URL of the Exchange Web Services.GetUserAvailabilityResultsgetUserAvailability(Iterable<AttendeeInfo> attendees, TimeWindow timeWindow, AvailabilityData requestedData)Gets detailed information about the availability of a set of users, rooms, and resources within a specified time window.GetUserAvailabilityResultsgetUserAvailability(Iterable<AttendeeInfo> attendees, TimeWindow timeWindow, AvailabilityData requestedData, AvailabilityOptions options)Gets detailed information about the availability of a set of users, rooms, and resources within a specified time window.UserConfigurationgetUserConfiguration(String name, FolderId parentFolderId, UserConfigurationProperties properties)Creates a UserConfiguration.OofSettingsgetUserOofSettings(String smtpAddress)Gets Out of Office (OOF) settings for a specific user.List<Item>internalCreateResponseObject(ServiceObject responseObject, FolderId parentFolderId, MessageDisposition messageDisposition)Create response object.ServiceResponseCollection<ServiceResponse>internalLoadPropertiesForItems(Iterable<Item> items, PropertySet propertySet, ServiceErrorHandling errorHandling)Loads the property of multiple item in a single call to EWS.voidloadPropertiesForFolder(Folder folder, PropertySet propertySet)Load specified property for a folder.ServiceResponseCollection<ServiceResponse>loadPropertiesForItems(Iterable<Item> items, PropertySet propertySet)Loads the property of multiple item in a single call to EWS.voidloadPropertiesForUserConfiguration(UserConfiguration userConfiguration, UserConfigurationProperties properties)Loads the property of the specified userConfiguration.FoldermoveFolder(FolderId folderId, FolderId destinationFolderId)Move a folder.ItemmoveItem(ItemId itemId, FolderId destinationFolderId)Copies multiple item in a single call to EWS.ServiceResponseCollection<MoveCopyItemResponse>moveItems(Iterable<ItemId> itemIds, FolderId destinationFolderId)Moves multiple item in a single call to EWS.ServiceResponseCollection<MoveCopyItemResponse>moveItems(Iterable<ItemId> itemIds, FolderId destinationFolderId, boolean returnNewItemIds)Moves multiple item in a single call to EWS.ServiceResponseCollection<ServiceResponse>moveItemsInConversations(Iterable<HashMap<ConversationId,Date>> idLastSyncTimePairs, FolderId contextFolderId, FolderId destinationFolderId)Moves the item in the specified conversation to the specified destination folder.HttpWebRequestprepareHttpPoolingWebRequest()Prepares a http web request from a pooling connection manager, used for subscriptions.HttpWebRequestprepareHttpWebRequest()Prepare http web request.voidprocessHttpErrorResponse(HttpWebRequest httpWebResponse, Exception webException)Processes an HTTP error response.Collection<DelegateUserResponse>removeDelegates(Mailbox mailbox, Iterable<UserId> userIds)Removes delegates on a specific mailbox.Collection<DelegateUserResponse>removeDelegates(Mailbox mailbox, UserId... userIds)Removes delegates on a specific mailbox.NameResolutionCollectionresolveName(String nameToResolve)Finds contacts in the user's Contacts folder and the Global Address List (in that order) that have names that match the one passed as a parameter.NameResolutionCollectionresolveName(String nameToResolve, Iterable<FolderId> parentFolderIds, ResolveNameSearchLocation searchScope, boolean returnContactDetails)Finds contacts in the user's Contacts folder and the Global Address List (in that order) that have names that match the one passed as a parameter.NameResolutionCollectionresolveName(String nameToResolve, Iterable<FolderId> parentFolderIds, ResolveNameSearchLocation searchScope, boolean returnContactDetails, PropertySet contactDataPropertySet)Finds contacts in the Global Address List and/or in specific contact folder that have names that match the one passed as a parameter.NameResolutionCollectionresolveName(String nameToResolve, ResolveNameSearchLocation searchScope, boolean returnContactDetails)Finds contacts in the user's Contacts folder and the Global Address List (in that order) that have names that match the one passed as a parameter.NameResolutionCollectionresolveName(String nameToResolve, ResolveNameSearchLocation searchScope, boolean returnContactDetails, PropertySet contactDataPropertySet)Finds contacts in the Global Address List that have names that match the one passed as a parameter.voidsendItem(Item item, FolderId savedCopyDestinationFolderId)Send item.voidsetDateTimePrecision(DateTimePrecision d)Sets the DateTime precision for DateTime values Web Services.voidsetEnableScpLookup(boolean value)voidsetExchange2007CompatibilityMode(boolean value)Set the flag indicating if the Exchange2007 compatibility mode is enabled.voidsetFileAttachmentContentHandler(IFileAttachmentContentHandler fileAttachmentContentHandler)Sets the file attachment content handler.voidsetImpersonatedUserId(ImpersonatedUserId impersonatedUserId)Sets the impersonated user id.voidsetPreferredCulture(Locale preferredCulture)Sets the preferred culture.voidsetPreferredCulture(DateTimePrecision dateTimePrecision)Sets the DateTime precision for DateTime values returned from Exchange Web Services.ServiceResponseCollection<ServiceResponse>setReadStateForItemsInConversations(Iterable<HashMap<ConversationId,Date>> idLastSyncTimePairs, FolderId contextFolderId, boolean isRead)Sets the read state for item in conversation.voidsetUrl(URI url)Sets the URL of the Exchange Web Services.voidsetUserOofSettings(String smtpAddress, OofSettings oofSettings)Sets Out of Office (OOF) settings for a specific user.PullSubscriptionsubscribeToPullNotifications(Iterable<FolderId> folderIds, int timeout, String watermark, EventType... eventTypes)Subscribes to pull notification.PullSubscriptionsubscribeToPullNotificationsOnAllFolders(int timeout, String watermark, EventType... eventTypes)Subscribes to pull notification on all folder in the authenticated user's mailbox.PushSubscriptionsubscribeToPushNotifications(Iterable<FolderId> folderIds, URI url, int frequency, String watermark, EventType... eventTypes)Subscribes to push notification.PushSubscriptionsubscribeToPushNotificationsOnAllFolders(URI url, int frequency, String watermark, EventType... eventTypes)Subscribes to push notification on all folder in the authenticated user's mailbox.StreamingSubscriptionsubscribeToStreamingNotifications(Iterable<FolderId> folderIds, EventType... eventTypes)Subscribes to streaming notification.StreamingSubscriptionsubscribeToStreamingNotificationsOnAllFolders(EventType... eventTypes)Subscribes to streaming notification on all folder in the authenticated user's mailbox.ChangeCollection<FolderChange>syncFolderHierarchy(PropertySet propertySet, String syncState)Synchronizes the entire folder hierarchy of the mailbox this Service is connected to.ChangeCollection<FolderChange>syncFolderHierarchy(FolderId syncFolderId, PropertySet propertySet, String syncState)Synchronizes the sub-folder of a specific folder.ChangeCollection<ItemChange>syncFolderItems(FolderId syncFolderId, PropertySet propertySet, Iterable<ItemId> ignoredItemIds, int maxChangesReturned, SyncFolderItemsScope syncScope, String syncState)Synchronizes the item of a specific folder.voidunsubscribe(String subscriptionId)Unsubscribes from a pull subscription.Collection<DelegateUserResponse>updateDelegates(Mailbox mailbox, MeetingRequestsDeliveryScope meetingRequestsDeliveryScope, Iterable<DelegateUser> delegateUsers)Updates delegates on a specific mailbox.Collection<DelegateUserResponse>updateDelegates(Mailbox mailbox, MeetingRequestsDeliveryScope meetingRequestsDeliveryScope, DelegateUser... delegateUsers)Updates delegates on a specific mailbox.voidupdateFolder(Folder folder)Updates a folder.voidupdateInboxRules(Iterable<RuleOperation> operations, boolean removeOutlookRuleBlob)Updates the authenticated user's inbox rules by applying the specified operations.voidupdateInboxRules(Iterable<RuleOperation> operations, boolean removeOutlookRuleBlob, String mailboxSmtpAddress)Updates the authenticated user's inbox rules by applying the specified operations.ItemupdateItem(Item item, FolderId savedItemsDestinationFolderId, ConflictResolutionMode conflictResolution, MessageDisposition messageDisposition, SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode)Updates an item.ServiceResponseCollection<UpdateItemResponse>updateItems(Iterable<Item> items, FolderId savedItemsDestinationFolderId, ConflictResolutionMode conflictResolution, MessageDisposition messageDisposition, SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode)Updates multiple item in a single EWS call.voidupdateUserConfiguration(UserConfiguration userConfiguration)Updates a UserConfiguration.UploadItemsResponseuploadItem(UploadItem item)ServiceResponseCollection<UploadItemsResponse>uploadItems(List<UploadItem> items)voidvalidate()Validates this instance.-
Methods inherited from class microsoft.exchange.webservices.data.core.ExchangeServiceBase
checkURIPath, close, convertDateTimeToUniversalDateTimeString, createConnectionSocketFactoryRegistry, doOnSerializeCustomSoapHeaders, getAcceptGzipEncoding, getCredentials, getHttpHeaders, getHttpResponseHeaders, getMaximumPoolingConnections, getOnSerializeCustomSoapHeaders, getRequestedServerVersion, getServerInfo, getSessionKey, getTimeout, getTraceFlags, getTraceListener, getUseDefaultCredentials, getUserAgent, getWebProxy, initializeHttpClient, initializeHttpPoolingClient, internalProcessHttpErrorResponse, isPreAuthenticate, isTraceEnabled, isTraceEnabledFor, isUseGlobalCookieStore, prepareCredentials, prepareHttpPoolingWebRequestForUrl, prepareHttpWebRequestForUrl, processHttpResponseHeaders, setAcceptGzipEncoding, setCredentials, setCustomUserAgent, setMaximumPoolingConnections, setOnSerializeCustomSoapHeaders, setPreAuthenticate, setServerInfo, setServiceRequestTracer, setTimeout, setTraceEnabled, setTraceFlags, setTraceListener, setUseDefaultCredentials, setUseGlobalCookieStore, setUserAgent, setWebProxy, traceHttpRequestHeaders, traceMessage, traceServiceRequestError, traceServiceRequestStart, traceServiceRequestSuccess, traceXml
-
-
-
-
Constructor Detail
-
ExchangeService
public ExchangeService()
Initializes a new instance of theExchangeServiceclass, targeting the specified version of EWS and scoped to the to the system's current time zone.
-
ExchangeService
public ExchangeService(ExchangeVersion requestedServerVersion)
Initializes a new instance of theExchangeServiceclass, targeting the specified version of EWS and scoped to the system's current time zone.- Parameters:
requestedServerVersion- the requested server version
-
ExchangeService
public ExchangeService(ExchangeVersion requestedServerVersion, org.apache.http.impl.client.CloseableHttpClient httpClient, org.apache.http.impl.client.CloseableHttpClient httpPoolingClient)
Initializes a new instance of theExchangeServiceclass, targeting the specified version of EWS and scoped to the system's current time zone. Additionally specifies an external HttpClient to use, e.g. one wired up with a thread-safe pooling http connection factory. It is perfectly acceptable for both arguments to use the same HttpClient.- Parameters:
requestedServerVersion- the requested server versionhttpClient- external HttpClient instance to usehttpPoolingClient- external HttpClient instance to use for pooling
-
-
Method Detail
-
internalCreateResponseObject
public List<Item> internalCreateResponseObject(ServiceObject responseObject, FolderId parentFolderId, MessageDisposition messageDisposition) throws Exception
Create response object.- Parameters:
responseObject- the response objectparentFolderId- the parent folder idmessageDisposition- the message disposition- Returns:
- The list of item created or modified as a result of the "creation" of the response object.
- Throws:
Exception- the exception
-
createFolder
public void createFolder(Folder folder, FolderId parentFolderId) throws Exception
Creates a folder. Calling this method results in a call to EWS.- Parameters:
folder- The folder.parentFolderId- The parent folder Id- Throws:
Exception- the exception
-
updateFolder
public void updateFolder(Folder folder) throws Exception
Updates a folder.- Parameters:
folder- The folder.- Throws:
Exception- the exception
-
copyFolder
public Folder copyFolder(FolderId folderId, FolderId destinationFolderId) throws Exception
Copies a folder. Calling this method results in a call to EWS.- Parameters:
folderId- The folderId.destinationFolderId- The destination folder id.- Returns:
- the folder
- Throws:
Exception- the exception
-
moveFolder
public Folder moveFolder(FolderId folderId, FolderId destinationFolderId) throws Exception
Move a folder.- Parameters:
folderId- The folderId.destinationFolderId- The destination folder id.- Returns:
- the folder
- Throws:
Exception- the exception
-
findFolders
public FindFoldersResults findFolders(FolderId parentFolderId, SearchFilter searchFilter, FolderView view) throws Exception
Obtains a list of folder by searching the sub-folder of the specified folder.- Parameters:
parentFolderId- The Id of the folder in which to search for folder.searchFilter- The search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollectionview- The view controlling the number of folder returned.- Returns:
- An object representing the results of the search operation.
- Throws:
Exception- the exception
-
findFolders
public FindFoldersResults findFolders(FolderId parentFolderId, FolderView view) throws Exception
Obtains a list of folder by searching the sub-folder of the specified folder.- Parameters:
parentFolderId- The Id of the folder in which to search for folder.view- The view controlling the number of folder returned.- Returns:
- An object representing the results of the search operation.
- Throws:
Exception- the exception
-
findFolders
public FindFoldersResults findFolders(WellKnownFolderName parentFolderName, SearchFilter searchFilter, FolderView view) throws Exception
Obtains a list of folder by searching the sub-folder of the specified folder.- Parameters:
parentFolderName- The name of the folder in which to search for folder.searchFilter- The search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollectionview- The view controlling the number of folder returned.- Returns:
- An object representing the results of the search operation.
- Throws:
Exception- the exception
-
findFolders
public FindFoldersResults findFolders(WellKnownFolderName parentFolderName, FolderView view) throws Exception
Obtains a list of folder by searching the sub-folder of the specified folder.- Parameters:
parentFolderName- the parent folder nameview- the view- Returns:
- An object representing the results of the search operation.
- Throws:
Exception- the exception
-
loadPropertiesForFolder
public void loadPropertiesForFolder(Folder folder, PropertySet propertySet) throws Exception
Load specified property for a folder.- Parameters:
folder- The folderpropertySet- The property set- Throws:
Exception- the exception
-
bindToFolder
public Folder bindToFolder(FolderId folderId, PropertySet propertySet) throws Exception
Binds to a folder.- Parameters:
folderId- the folder idpropertySet- the property set- Returns:
- Folder
- Throws:
Exception- the exception
-
bindToFolder
public <TFolder extends Folder> TFolder bindToFolder(Class<TFolder> cls, FolderId folderId, PropertySet propertySet) throws Exception
Binds to folder.- Type Parameters:
TFolder- The type of the folder.- Parameters:
cls- Folder classfolderId- The folder id.propertySet- The property set.- Returns:
- Folder
- Throws:
Exception- the exception
-
deleteFolder
public void deleteFolder(FolderId folderId, DeleteMode deleteMode) throws Exception
Deletes a folder. Calling this method results in a call to EWS.- Parameters:
folderId- The folder iddeleteMode- The delete mode- Throws:
Exception- the exception
-
emptyFolder
public void emptyFolder(FolderId folderId, DeleteMode deleteMode, boolean deleteSubFolders) throws Exception
Empties a folder. Calling this method results in a call to EWS.- Parameters:
folderId- The folder iddeleteMode- The delete modedeleteSubFolders- if set to "true" empty folder should also delete sub folder.- Throws:
Exception- the exception
-
createItems
public ServiceResponseCollection<ServiceResponse> createItems(Collection<Item> items, FolderId parentFolderId, MessageDisposition messageDisposition, SendInvitationsMode sendInvitationsMode) throws Exception
Creates multiple item in a single EWS call. Supported item classes are EmailMessage, Appointment, Contact, PostItem, Task and Item. CreateItems does not support item that have unsaved attachments.- Parameters:
items- the itemparentFolderId- the parent folder idmessageDisposition- the message dispositionsendInvitationsMode- the send invitations mode- Returns:
- A ServiceResponseCollection providing creation results for each of the specified item.
- Throws:
Exception- the exception
-
createItem
public void createItem(Item item, FolderId parentFolderId, MessageDisposition messageDisposition, SendInvitationsMode sendInvitationsMode) throws Exception
Creates an item. Calling this method results in a call to EWS.- Parameters:
item- the itemparentFolderId- the parent folder idmessageDisposition- the message dispositionsendInvitationsMode- the send invitations mode- Throws:
Exception- the exception
-
updateItems
public ServiceResponseCollection<UpdateItemResponse> updateItems(Iterable<Item> items, FolderId savedItemsDestinationFolderId, ConflictResolutionMode conflictResolution, MessageDisposition messageDisposition, SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode) throws Exception
Updates multiple item in a single EWS call. UpdateItems does not support item that have unsaved attachments.- Parameters:
items- the itemsavedItemsDestinationFolderId- the saved item destination folder idconflictResolution- the conflict resolutionmessageDisposition- the message dispositionsendInvitationsOrCancellationsMode- the send invitations or cancellations mode- Returns:
- A ServiceResponseCollection providing update results for each of the specified item.
- Throws:
Exception- the exception
-
updateItem
public Item updateItem(Item item, FolderId savedItemsDestinationFolderId, ConflictResolutionMode conflictResolution, MessageDisposition messageDisposition, SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode) throws Exception
Updates an item.- Parameters:
item- the itemsavedItemsDestinationFolderId- the saved item destination folder idconflictResolution- the conflict resolutionmessageDisposition- the message dispositionsendInvitationsOrCancellationsMode- the send invitations or cancellations mode- Returns:
- A ServiceResponseCollection providing deletion results for each of the specified item Ids.
- Throws:
Exception- the exception
-
sendItem
public void sendItem(Item item, FolderId savedCopyDestinationFolderId) throws Exception
Send item.- Parameters:
item- the itemsavedCopyDestinationFolderId- the saved copy destination folder id- Throws:
Exception- the exception
-
copyItems
public ServiceResponseCollection<MoveCopyItemResponse> copyItems(Iterable<ItemId> itemIds, FolderId destinationFolderId) throws Exception
Copies multiple item in a single call to EWS.- Parameters:
itemIds- the item idsdestinationFolderId- the destination folder id- Returns:
- A ServiceResponseCollection providing copy results for each of the specified item Ids.
- Throws:
Exception- the exception
-
copyItems
public ServiceResponseCollection<MoveCopyItemResponse> copyItems(Iterable<ItemId> itemIds, FolderId destinationFolderId, boolean returnNewItemIds) throws Exception
Copies multiple item in a single call to EWS.- Parameters:
itemIds- The Ids of the item to copy.destinationFolderId- The Id of the folder to copy the item to.returnNewItemIds- Flag indicating whether service should return new ItemIds or not.- Returns:
- A ServiceResponseCollection providing copy results for each of the specified item Ids.
- Throws:
Exception- on error
-
copyItem
public Item copyItem(ItemId itemId, FolderId destinationFolderId) throws Exception
Copies an item. Calling this method results in a call to EWS.- Parameters:
itemId- The Id of the item to copy.destinationFolderId- The folder in which to save sent messages, meeting invitations or cancellations. If null, the message, meeting invitation or cancellation is saved in the Sent Items folder- Returns:
- The copy of the item.
- Throws:
Exception- the exception
-
moveItems
public ServiceResponseCollection<MoveCopyItemResponse> moveItems(Iterable<ItemId> itemIds, FolderId destinationFolderId) throws Exception
Moves multiple item in a single call to EWS.- Parameters:
itemIds- the item idsdestinationFolderId- the destination folder id- Returns:
- A ServiceResponseCollection providing copy results for each of the specified item Ids.
- Throws:
Exception- the exception
-
moveItems
public ServiceResponseCollection<MoveCopyItemResponse> moveItems(Iterable<ItemId> itemIds, FolderId destinationFolderId, boolean returnNewItemIds) throws Exception
Moves multiple item in a single call to EWS.- Parameters:
itemIds- The Ids of the item to move.destinationFolderId- The Id of the folder to move the item to.returnNewItemIds- Flag indicating whether service should return new ItemIds or not.- Returns:
- A ServiceResponseCollection providing copy results for each of the specified item Ids.
- Throws:
Exception- on error
-
moveItem
public Item moveItem(ItemId itemId, FolderId destinationFolderId) throws Exception
Copies multiple item in a single call to EWS.- Parameters:
itemId- the item iddestinationFolderId- the destination folder id- Returns:
- A ServiceResponseCollection providing copy results for each of the specified item Ids.
- Throws:
Exception- the exception
-
findItems
public <TItem extends Item> ServiceResponseCollection<FindItemResponse<TItem>> findItems(Iterable<FolderId> parentFolderIds, SearchFilter searchFilter, String queryString, ViewBase view, Grouping groupBy, ServiceErrorHandling errorHandlingMode) throws Exception
Finds item.- Type Parameters:
TItem- The type of item- Parameters:
parentFolderIds- The parent folder ids.searchFilter- The search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollectionqueryString- the query stringview- The view controlling the number of folder returned.groupBy- The group by.errorHandlingMode- Indicates the type of error handling should be done.- Returns:
- Service response collection.
- Throws:
Exception- the exception
-
findItems
public FindItemsResults<Item> findItems(FolderId parentFolderId, String queryString, ItemView view) throws Exception
Obtains a list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderId- the parent folder idqueryString- the query stringview- the view- Returns:
- An object representing the results of the search operation.
- Throws:
Exception- the exception
-
findItems
public FindItemsResults<Item> findItems(FolderId parentFolderId, SearchFilter searchFilter, ItemView view) throws Exception
Obtains a list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderId- the parent folder idsearchFilter- the search filterview- the view- Returns:
- An object representing the results of the search operation.
- Throws:
Exception- the exception
-
findItems
public FindItemsResults<Item> findItems(FolderId parentFolderId, ItemView view) throws Exception
Obtains a list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderId- the parent folder idview- the view- Returns:
- An object representing the results of the search operation.
- Throws:
Exception- the exception
-
findItems
public FindItemsResults<Item> findItems(WellKnownFolderName parentFolderName, String queryString, ItemView view) throws Exception
Obtains a list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderName- the parent folder namequeryString- the query stringview- the view- Returns:
- An object representing the results of the search operation.
- Throws:
Exception- the exception
-
findItems
public FindItemsResults<Item> findItems(WellKnownFolderName parentFolderName, SearchFilter searchFilter, ItemView view) throws Exception
Obtains a list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderName- the parent folder namesearchFilter- the search filterview- the view- Returns:
- An object representing the results of the search operation.
- Throws:
Exception- the exception
-
findItems
public FindItemsResults<Item> findItems(WellKnownFolderName parentFolderName, ItemView view) throws Exception
Obtains a list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderName- the parent folder nameview- the view- Returns:
- An object representing the results of the search operation.
- Throws:
Exception- the exception
-
findItems
public GroupedFindItemsResults<Item> findItems(FolderId parentFolderId, String queryString, ItemView view, Grouping groupBy) throws Exception
Obtains a grouped list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderId- the parent folder idqueryString- the query stringview- the viewgroupBy- the group by- Returns:
- A list of item containing the contents of the specified folder.
- Throws:
Exception- the exception
-
findItems
public GroupedFindItemsResults<Item> findItems(FolderId parentFolderId, SearchFilter searchFilter, ItemView view, Grouping groupBy) throws Exception
Obtains a grouped list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderId- the parent folder idsearchFilter- the search filterview- the viewgroupBy- the group by- Returns:
- A list of item containing the contents of the specified folder.
- Throws:
Exception- the exception
-
findItems
public GroupedFindItemsResults<Item> findItems(FolderId parentFolderId, ItemView view, Grouping groupBy) throws Exception
Obtains a grouped list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderId- the parent folder idview- the viewgroupBy- the group by- Returns:
- A list of item containing the contents of the specified folder.
- Throws:
Exception- the exception
-
findItems
protected <TItem extends Item> ServiceResponseCollection<FindItemResponse<TItem>> findItems(Class<TItem> cls, FolderId parentFolderId, SearchFilter searchFilter, ViewBase view, Grouping groupBy) throws Exception
Obtains a grouped list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Type Parameters:
TItem- the generic type- Parameters:
cls- the clsparentFolderId- the parent folder idsearchFilter- the search filterview- the viewgroupBy- the group by- Returns:
- A list of item containing the contents of the specified folder.
- Throws:
Exception- the exception
-
findItems
public GroupedFindItemsResults<Item> findItems(WellKnownFolderName parentFolderName, String queryString, ItemView view, Grouping groupBy) throws Exception
Obtains a grouped list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderName- the parent folder namequeryString- the query stringview- the viewgroupBy- the group by- Returns:
- A collection of grouped item containing the contents of the specified.
- Throws:
Exception- the exception
-
findItems
public GroupedFindItemsResults<Item> findItems(WellKnownFolderName parentFolderName, SearchFilter searchFilter, ItemView view, Grouping groupBy) throws Exception
Obtains a grouped list of item by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderName- the parent folder namesearchFilter- the search filterview- the viewgroupBy- the group by- Returns:
- A collection of grouped item containing the contents of the specified.
- Throws:
Exception- the exception
-
findAppointments
public FindItemsResults<Appointment> findAppointments(FolderId parentFolderId, CalendarView calendarView) throws Exception
Obtains a list of appointments by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderId- the parent folder idcalendarView- the calendar view- Returns:
- A collection of appointments representing the contents of the specified folder.
- Throws:
Exception- the exception
-
findAppointments
public FindItemsResults<Appointment> findAppointments(WellKnownFolderName parentFolderName, CalendarView calendarView) throws Exception
Obtains a list of appointments by searching the contents of a specific folder. Calling this method results in a call to EWS.- Parameters:
parentFolderName- the parent folder namecalendarView- the calendar view- Returns:
- A collection of appointments representing the contents of the specified folder.
- Throws:
Exception- the exception
-
loadPropertiesForItems
public ServiceResponseCollection<ServiceResponse> loadPropertiesForItems(Iterable<Item> items, PropertySet propertySet) throws Exception
Loads the property of multiple item in a single call to EWS.- Parameters:
items- the itempropertySet- the property set- Returns:
- A ServiceResponseCollection providing results for each of the specified item.
- Throws:
Exception- the exception
-
internalLoadPropertiesForItems
public ServiceResponseCollection<ServiceResponse> internalLoadPropertiesForItems(Iterable<Item> items, PropertySet propertySet, ServiceErrorHandling errorHandling) throws Exception
Loads the property of multiple item in a single call to EWS.- Parameters:
items- the itempropertySet- the property seterrorHandling- the error handling- Returns:
- A ServiceResponseCollection providing results for each of the specified item.
- Throws:
Exception- the exception
-
bindToItems
public ServiceResponseCollection<GetItemResponse> bindToItems(Iterable<ItemId> itemIds, PropertySet propertySet) throws Exception
Binds to multiple item in a single call to EWS.- Parameters:
itemIds- the item idspropertySet- the property set- Returns:
- A ServiceResponseCollection providing results for each of the specified item Ids.
- Throws:
Exception- the exception
-
bindToItem
public Item bindToItem(ItemId itemId, PropertySet propertySet) throws Exception
Binds to multiple item in a single call to EWS.- Parameters:
itemId- the item idpropertySet- the property set- Returns:
- A ServiceResponseCollection providing results for each of the specified item Ids.
- Throws:
Exception- the exception
-
bindToItem
public <TItem extends Item> TItem bindToItem(Class<TItem> c, ItemId itemId, PropertySet propertySet) throws Exception
Bind to item.- Type Parameters:
TItem- The type of the item.- Parameters:
c- the citemId- the item idpropertySet- the property set- Returns:
- the t item
- Throws:
Exception- the exception
-
deleteItems
public ServiceResponseCollection<ServiceResponse> deleteItems(Iterable<ItemId> itemIds, DeleteMode deleteMode, SendCancellationsMode sendCancellationsMode, AffectedTaskOccurrence affectedTaskOccurrences) throws Exception
Deletes multiple item in a single call to EWS.- Parameters:
itemIds- the item idsdeleteMode- the delete modesendCancellationsMode- the send cancellations modeaffectedTaskOccurrences- the affected task occurrences- Returns:
- A ServiceResponseCollection providing deletion results for each of the specified item Ids.
- Throws:
Exception- the exception
-
deleteItem
public void deleteItem(ItemId itemId, DeleteMode deleteMode, SendCancellationsMode sendCancellationsMode, AffectedTaskOccurrence affectedTaskOccurrences) throws Exception
Deletes an item. Calling this method results in a call to EWS.- Parameters:
itemId- the item iddeleteMode- the delete modesendCancellationsMode- the send cancellations modeaffectedTaskOccurrences- the affected task occurrences- Throws:
Exception- the exception
-
getAttachments
protected ServiceResponseCollection<GetAttachmentResponse> getAttachments(Attachment[] attachments, BodyType bodyType, Iterable<PropertyDefinitionBase> additionalProperties) throws Exception
Gets attachments.- Parameters:
attachments- the attachmentsbodyType- the body typeadditionalProperties- the additional property- Returns:
- service response collection
- Throws:
Exception- on error
-
getAttachment
public void getAttachment(Attachment attachment, BodyType bodyType, Iterable<PropertyDefinitionBase> additionalProperties) throws Exception
Gets the attachment.- Parameters:
attachment- the attachmentbodyType- the body typeadditionalProperties- the additional property- Throws:
Exception- the exception
-
createAttachments
public ServiceResponseCollection<CreateAttachmentResponse> createAttachments(String parentItemId, Iterable<Attachment> attachments) throws ServiceResponseException, Exception
Creates attachments.- Parameters:
parentItemId- the parent item idattachments- the attachments- Returns:
- Service response collection.
- Throws:
ServiceResponseException- the service response exceptionException- the exception
-
deleteAttachments
public ServiceResponseCollection<DeleteAttachmentResponse> deleteAttachments(Iterable<Attachment> attachments) throws ServiceResponseException, Exception
Deletes attachments.- Parameters:
attachments- the attachments- Returns:
- the service response collection
- Throws:
ServiceResponseException- the service response exceptionException- the exception
-
resolveName
public NameResolutionCollection resolveName(String nameToResolve) throws Exception
Finds contacts in the user's Contacts folder and the Global Address List (in that order) that have names that match the one passed as a parameter. Calling this method results in a call to EWS.- Parameters:
nameToResolve- the name to resolve- Returns:
- A collection of name resolutions whose names match the one passed as a parameter.
- Throws:
Exception- the exception
-
resolveName
public NameResolutionCollection resolveName(String nameToResolve, Iterable<FolderId> parentFolderIds, ResolveNameSearchLocation searchScope, boolean returnContactDetails) throws Exception
Finds contacts in the user's Contacts folder and the Global Address List (in that order) that have names that match the one passed as a parameter. Calling this method results in a call to EWS.- Parameters:
nameToResolve- the name to resolveparentFolderIds- the parent folder idssearchScope- the search scopereturnContactDetails- the return contact details- Returns:
- A collection of name resolutions whose names match the one passed as a parameter.
- Throws:
Exception- the exception
-
resolveName
public NameResolutionCollection resolveName(String nameToResolve, Iterable<FolderId> parentFolderIds, ResolveNameSearchLocation searchScope, boolean returnContactDetails, PropertySet contactDataPropertySet) throws Exception
Finds contacts in the Global Address List and/or in specific contact folder that have names that match the one passed as a parameter. Calling this method results in a call to EWS.- Parameters:
nameToResolve- The name to resolve.parentFolderIds- The Ids of the contact folder in which to look for matching contacts.searchScope- The scope of the search.returnContactDetails- Indicates whether full contact information should be returned for each of the found contacts.contactDataPropertySet- The property set for the contact details- Returns:
- a collection of name resolutions whose names match the one passed as a parameter
- Throws:
Exception- on error
-
resolveName
public NameResolutionCollection resolveName(String nameToResolve, ResolveNameSearchLocation searchScope, boolean returnContactDetails, PropertySet contactDataPropertySet) throws Exception
Finds contacts in the Global Address List that have names that match the one passed as a parameter. Calling this method results in a call to EWS.- Parameters:
nameToResolve- The name to resolve.searchScope- The scope of the search.returnContactDetails- Indicates whether full contact information should be returned for each of the found contacts.contactDataPropertySet- The property set for the contact details- Returns:
- A collection of name resolutions whose names match the one passed as a parameter.
- Throws:
Exception- on error
-
resolveName
public NameResolutionCollection resolveName(String nameToResolve, ResolveNameSearchLocation searchScope, boolean returnContactDetails) throws Exception
Finds contacts in the user's Contacts folder and the Global Address List (in that order) that have names that match the one passed as a parameter. Calling this method results in a call to EWS.- Parameters:
nameToResolve- the name to resolvesearchScope- the search scopereturnContactDetails- the return contact details- Returns:
- A collection of name resolutions whose names match the one passed as a parameter.
- Throws:
Exception- the exception
-
expandGroup
public ExpandGroupResults expandGroup(EmailAddress emailAddress) throws Exception
Expands a group by retrieving a list of its members. Calling this method results in a call to EWS.- Parameters:
emailAddress- the email address- Returns:
- URL of the Exchange Web Services.
- Throws:
Exception- the exception
-
expandGroup
public ExpandGroupResults expandGroup(ItemId groupId) throws Exception
Expands a group by retrieving a list of its members. Calling this method results in a call to EWS.- Parameters:
groupId- the group id- Returns:
- An ExpandGroupResults containing the members of the group.
- Throws:
Exception- the exception
-
expandGroup
public ExpandGroupResults expandGroup(String smtpAddress) throws Exception
Expands a group by retrieving a list of its members. Calling this method results in a call to EWS.- Parameters:
smtpAddress- the smtp address- Returns:
- An ExpandGroupResults containing the members of the group.
- Throws:
Exception- the exception
-
expandGroup
public ExpandGroupResults expandGroup(String address, String routingType) throws Exception
Expands a group by retrieving a list of its members. Calling this method results in a call to EWS.- Parameters:
address- the addressroutingType- the routing type- Returns:
- An ExpandGroupResults containing the members of the group.
- Throws:
Exception- the exception
-
getPasswordExpirationDate
public Date getPasswordExpirationDate(String mailboxSmtpAddress) throws Exception
Get the password expiration date- Parameters:
mailboxSmtpAddress- The e-mail address of the user.- Returns:
- The password expiration date
- Throws:
Exception- on error
-
subscribeToPullNotifications
public PullSubscription subscribeToPullNotifications(Iterable<FolderId> folderIds, int timeout, String watermark, EventType... eventTypes) throws Exception
Subscribes to pull notification. Calling this method results in a call to EWS.- Parameters:
folderIds- The Ids of the folder to subscribe totimeout- The timeout, in minutes, after which the subscription expires. Timeout must be between 1 and 1440.watermark- An optional watermark representing a previously opened subscription.eventTypes- The event types to subscribe to.- Returns:
- A PullSubscription representing the new subscription.
- Throws:
Exception- on error
-
beginSubscribeToPullNotifications
public AsyncRequestResult beginSubscribeToPullNotifications(AsyncCallback callback, Object state, Iterable<FolderId> folderIds, int timeout, String watermark, EventType... eventTypes) throws Exception
Begins an asynchronous request to subscribes to pull notification. Calling this method results in a call to EWS.- Parameters:
callback- The AsyncCallback delegate.state- An object that contains state information for this request.folderIds- The Ids of the folder to subscribe to.timeout- The timeout, in minutes, after which the subscription expires. Timeout must be between 1 and 1440.watermark- An optional watermark representing a previously opened subscription.eventTypes- The event types to subscribe to.- Returns:
- An IAsyncResult that references the asynchronous request.
- Throws:
Exception
-
subscribeToPullNotificationsOnAllFolders
public PullSubscription subscribeToPullNotificationsOnAllFolders(int timeout, String watermark, EventType... eventTypes) throws Exception
Subscribes to pull notification on all folder in the authenticated user's mailbox. Calling this method results in a call to EWS.- Parameters:
timeout- the timeoutwatermark- the watermarkeventTypes- the event types- Returns:
- A PullSubscription representing the new subscription.
- Throws:
Exception- the exception
-
beginSubscribeToPullNotificationsOnAllFolders
public IAsyncResult beginSubscribeToPullNotificationsOnAllFolders(AsyncCallback callback, Object state, int timeout, String watermark, EventType... eventTypes) throws Exception
Begins an asynchronous request to subscribe to pull notification on all folder in the authenticated user's mailbox. Calling this method results in a call to EWS.- Parameters:
callback- The AsyncCallback delegate.state- An object that contains state information for this request.timeout- The timeout, in minutes, after which the subscription expires. Timeout must be between 1 and 1440.watermark- An optional watermark representing a previously opened subscription.eventTypes- The event types to subscribe to.- Returns:
- An IAsyncResult that references the asynchronous request.
- Throws:
Exception
-
endSubscribeToPullNotifications
public PullSubscription endSubscribeToPullNotifications(IAsyncResult asyncResult) throws Exception
Ends an asynchronous request to subscribe to pull notification in the authenticated user's mailbox.- Parameters:
asyncResult- An IAsyncResult that references the asynchronous request.- Returns:
- A PullSubscription representing the new subscription.
- Throws:
Exception
-
unsubscribe
public void unsubscribe(String subscriptionId) throws Exception
Unsubscribes from a pull subscription. Calling this method results in a call to EWS.- Parameters:
subscriptionId- the subscription id- Throws:
Exception- the exception
-
beginUnsubscribe
public IAsyncResult beginUnsubscribe(AsyncCallback callback, Object state, String subscriptionId) throws Exception
Begins an asynchronous request to unsubscribe from a subscription. Calling this method results in a call to EWS.- Parameters:
callback- The AsyncCallback delegate.state- An object that contains state information for this request.subscriptionId- The Id of the pull subscription to unsubscribe from.- Returns:
- An IAsyncResult that references the asynchronous request.
- Throws:
Exception
-
endUnsubscribe
public void endUnsubscribe(IAsyncResult asyncResult) throws Exception
Ends an asynchronous request to unsubscribe from a subscription.- Parameters:
asyncResult- An IAsyncResult that references the asynchronous request.- Throws:
Exception
-
getEvents
public GetEventsResults getEvents(String subscriptionId, String waterMark) throws Exception
Retrieves the latests events associated with a pull subscription. Calling this method results in a call to EWS.- Parameters:
subscriptionId- the subscription idwaterMark- the water mark- Returns:
- A GetEventsResults containing a list of events associated with the subscription.
- Throws:
Exception- the exception
-
beginGetEvents
public IAsyncResult beginGetEvents(AsyncCallback callback, Object state, String subscriptionId, String watermark) throws Exception
Begins an asynchronous request to retrieve the latest events associated with a pull subscription. Calling this method results in a call to EWS.- Parameters:
callback- The AsyncCallback delegate.state- An object that contains state information for this request.subscriptionId- The id of the pull subscription for which to get the eventswatermark- The watermark representing the point in time where to start receiving events- Returns:
- An IAsynResult that references the asynchronous request
- Throws:
Exception
-
endGetEvents
public GetEventsResults endGetEvents(IAsyncResult asyncResult) throws Exception
Ends an asynchronous request to retrieve the latest events associated with a pull subscription.- Parameters:
asyncResult- An IAsyncResult that references the asynchronous request.- Returns:
- A GetEventsResults containing a list of events associated with the subscription.
- Throws:
Exception
-
subscribeToPushNotifications
public PushSubscription subscribeToPushNotifications(Iterable<FolderId> folderIds, URI url, int frequency, String watermark, EventType... eventTypes) throws Exception
Subscribes to push notification. Calling this method results in a call to EWS.- Parameters:
folderIds- the folder idsurl- the urlfrequency- the frequencywatermark- the watermarkeventTypes- the event types- Returns:
- A PushSubscription representing the new subscription.
- Throws:
Exception- the exception
-
beginSubscribeToPushNotifications
public IAsyncResult beginSubscribeToPushNotifications(AsyncCallback callback, Object state, Iterable<FolderId> folderIds, URI url, int frequency, String watermark, EventType... eventTypes) throws Exception
Begins an asynchronous request to subscribe to push notification. Calling this method results in a call to EWS.- Parameters:
callback- The asynccallback delegatestate- An object that contains state information for this requestfolderIds- The ids of the folder to subscribeurl- the url of web service endpoint the exchange server shouldfrequency- the frequency,in minutes at which the exchange server should contact the web Service endpoint. Frequency must be between 1 and 1440.watermark- An optional watermark representing a previously opened subscriptioneventTypes- The event types to subscribe to.- Returns:
- An IAsyncResult that references the asynchronous request.
- Throws:
Exception
-
subscribeToPushNotificationsOnAllFolders
public PushSubscription subscribeToPushNotificationsOnAllFolders(URI url, int frequency, String watermark, EventType... eventTypes) throws Exception
Subscribes to push notification on all folder in the authenticated user's mailbox. Calling this method results in a call to EWS.- Parameters:
url- the urlfrequency- the frequencywatermark- the watermarkeventTypes- the event types- Returns:
- A PushSubscription representing the new subscription.
- Throws:
Exception- the exception
-
beginSubscribeToPushNotificationsOnAllFolders
public IAsyncResult beginSubscribeToPushNotificationsOnAllFolders(AsyncCallback callback, Object state, URI url, int frequency, String watermark, EventType... eventTypes) throws Exception
Begins an asynchronous request to subscribe to push notification on all folder in the authenticated user's mailbox. Calling this method results in a call to EWS.- Parameters:
callback- The asynccallback delegatestate- An object that contains state inforamtion for this requesturl- the urlfrequency- the frequency,in minutes at which the exchange server should contact the web Service endpoint. Frequency must be between 1 and 1440.watermark- An optional watermark representing a previously opened subscriptioneventTypes- The event types to subscribe to.- Returns:
- An IAsyncResult that references the asynchronous request.
- Throws:
Exception
-
endSubscribeToPushNotifications
public PushSubscription endSubscribeToPushNotifications(IAsyncResult asyncResult) throws Exception
Ends an asynchronous request to subscribe to push notification in the authenticated user's mailbox.- Parameters:
asyncResult- An IAsyncResult that references the asynchronous request.- Returns:
- A PushSubscription representing the new subscription
- Throws:
Exception
-
subscribeToStreamingNotifications
public StreamingSubscription subscribeToStreamingNotifications(Iterable<FolderId> folderIds, EventType... eventTypes) throws Exception
Subscribes to streaming notification. Calling this method results in a call to EWS.- Parameters:
folderIds- The Ids of the folder to subscribe to.eventTypes- The event types to subscribe to.- Returns:
- A StreamingSubscription representing the new subscription
- Throws:
Exception
-
subscribeToStreamingNotificationsOnAllFolders
public StreamingSubscription subscribeToStreamingNotificationsOnAllFolders(EventType... eventTypes) throws Exception
Subscribes to streaming notification on all folder in the authenticated user's mailbox. Calling this method results in a call to EWS.- Parameters:
eventTypes- The event types to subscribe to.- Returns:
- A StreamingSubscription representing the new subscription.
- Throws:
Exception
-
beginSubscribeToStreamingNotifications
public IAsyncResult beginSubscribeToStreamingNotifications(AsyncCallback callback, Object state, Iterable<FolderId> folderIds, EventType... eventTypes) throws Exception
Begins an asynchronous request to subscribe to streaming notification. Calling this method results in a call to EWS.- Parameters:
callback- The AsyncCallback delegatestate- An object that contains state information for this request.folderIds- The Ids of the folder to subscribe to.eventTypes- The event types to subscribe to.- Returns:
- An IAsyncResult that references the asynchronous request
- Throws:
Exception
-
beginSubscribeToStreamingNotificationsOnAllFolders
public IAsyncResult beginSubscribeToStreamingNotificationsOnAllFolders(AsyncCallback callback, Object state, EventType... eventTypes) throws Exception
Begins an asynchronous request to subscribe to streaming notification on all folder in the authenticated user's mailbox. Calling this method results in a call to EWS.- Parameters:
callback- The AsyncCallback delegatestate- An object that contains state information for this request.- Returns:
- An IAsyncResult that references the asynchronous request.
- Throws:
Exception
-
endSubscribeToStreamingNotifications
public StreamingSubscription endSubscribeToStreamingNotifications(IAsyncResult asyncResult) throws IndexOutOfBoundsException, Exception
Ends an asynchronous request to subscribe to push notification in the authenticated user's mailbox.- Parameters:
asyncResult- An IAsyncResult that references the asynchronous request.- Returns:
- A streamingSubscription representing the new subscription
- Throws:
ExceptionIndexOutOfBoundsException
-
syncFolderItems
public ChangeCollection<ItemChange> syncFolderItems(FolderId syncFolderId, PropertySet propertySet, Iterable<ItemId> ignoredItemIds, int maxChangesReturned, SyncFolderItemsScope syncScope, String syncState) throws Exception
Synchronizes the item of a specific folder. Calling this method results in a call to EWS.- Parameters:
syncFolderId- The Id of the folder containing the item to synchronize with.propertySet- The set of property to retrieve for synchronized item.ignoredItemIds- The optional list of item Ids that should be ignored.maxChangesReturned- The maximum number of changes that should be returned.syncScope- The sync scope identifying item to include in the ChangeCollection.syncState- The optional sync state representing the point in time when to start the synchronization.- Returns:
- A ChangeCollection containing a list of changes that occurred in the specified folder.
- Throws:
Exception- the exception
-
beginSyncFolderItems
public IAsyncResult beginSyncFolderItems(AsyncCallback callback, Object state, FolderId syncFolderId, PropertySet propertySet, Iterable<ItemId> ignoredItemIds, int maxChangesReturned, SyncFolderItemsScope syncScope, String syncState) throws Exception
Begins an asynchronous request to synchronize the item of a specific folder. Calling this method results in a call to EWS.- Parameters:
callback- The AsyncCallback delegatestate- An object that contains state information for this requestsyncFolderId- The Id of the folder containing the item to synchronize withpropertySet- The set of property to retrieve for synchronized item.ignoredItemIds- The optional list of item Ids that should be ignored.maxChangesReturned- The maximum number of changes that should be returned.syncScope- The sync scope identifying item to include in the ChangeCollectionsyncState- The optional sync state representing the point in time when to start the synchronization- Returns:
- An IAsyncResult that references the asynchronous request.
- Throws:
Exception
-
endSyncFolderItems
public ChangeCollection<ItemChange> endSyncFolderItems(IAsyncResult asyncResult) throws Exception
Ends an asynchronous request to synchronize the item of a specific folder.- Parameters:
asyncResult- An IAsyncResult that references the asynchronous request.- Returns:
- A ChangeCollection containing a list of changes that occurred in the specified folder.
- Throws:
Exception
-
syncFolderHierarchy
public ChangeCollection<FolderChange> syncFolderHierarchy(FolderId syncFolderId, PropertySet propertySet, String syncState) throws Exception
Synchronizes the sub-folder of a specific folder. Calling this method results in a call to EWS.- Parameters:
syncFolderId- the sync folder idpropertySet- the property setsyncState- the sync state- Returns:
- A ChangeCollection containing a list of changes that occurred in the specified folder.
- Throws:
Exception- the exception
-
beginSyncFolderHierarchy
public IAsyncResult beginSyncFolderHierarchy(AsyncCallback callback, Object state, FolderId syncFolderId, PropertySet propertySet, String syncState) throws Exception
Begins an asynchronous request to synchronize the sub-folder of a specific folder. Calling this method results in a call to EWS.- Parameters:
callback- The AsyncCallback delegatestate- An object that contains state information for this request.syncFolderId- The Id of the folder containing the item to synchronize with. A null value indicates the root folder of the mailbox.propertySet- The set of property to retrieve for synchronized item.syncState- The optional sync state representing the point in time when to start the synchronization.- Returns:
- An IAsyncResult that references the asynchronous request
- Throws:
Exception
-
syncFolderHierarchy
public ChangeCollection<FolderChange> syncFolderHierarchy(PropertySet propertySet, String syncState) throws Exception
Synchronizes the entire folder hierarchy of the mailbox this Service is connected to. Calling this method results in a call to EWS.- Parameters:
propertySet- The set of property to retrieve for synchronized item.syncState- The optional sync state representing the point in time when to start the synchronization.- Returns:
- A ChangeCollection containing a list of changes that occurred in the specified folder.
- Throws:
Exception
-
endSyncFolderHierarchy
public ChangeCollection<FolderChange> endSyncFolderHierarchy(IAsyncResult asyncResult) throws Exception
Ends an asynchronous request to synchronize the specified folder hierarchy of the mailbox this Service is connected to.- Parameters:
asyncResult- An IAsyncResult that references the asynchronous request.- Returns:
- A ChangeCollection containing a list of changes that occurred in the specified folder.
- Throws:
Exception
-
getUserOofSettings
public OofSettings getUserOofSettings(String smtpAddress) throws Exception
Gets Out of Office (OOF) settings for a specific user. Calling this method results in a call to EWS.- Parameters:
smtpAddress- the smtp address- Returns:
- An OofSettings instance containing OOF information for the specified user.
- Throws:
Exception- the exception
-
setUserOofSettings
public void setUserOofSettings(String smtpAddress, OofSettings oofSettings) throws Exception
Sets Out of Office (OOF) settings for a specific user. Calling this method results in a call to EWS.- Parameters:
smtpAddress- the smtp addressoofSettings- the oof settings- Throws:
Exception- the exception
-
getUserAvailability
public GetUserAvailabilityResults getUserAvailability(Iterable<AttendeeInfo> attendees, TimeWindow timeWindow, AvailabilityData requestedData, AvailabilityOptions options) throws Exception
Gets detailed information about the availability of a set of users, rooms, and resources within a specified time window.- Parameters:
attendees- the attendeestimeWindow- the time windowrequestedData- the requested dataoptions- the options- Returns:
- The availability information for each user appears in a unique FreeBusyResponse object. The order of users in the request determines the order of availability data for each user in the response.
- Throws:
Exception- the exception
-
getUserAvailability
public GetUserAvailabilityResults getUserAvailability(Iterable<AttendeeInfo> attendees, TimeWindow timeWindow, AvailabilityData requestedData) throws Exception
Gets detailed information about the availability of a set of users, rooms, and resources within a specified time window.- Parameters:
attendees- the attendeestimeWindow- the time windowrequestedData- the requested data- Returns:
- The availability information for each user appears in a unique FreeBusyResponse object. The order of users in the request determines the order of availability data for each user in the response.
- Throws:
Exception- the exception
-
getRoomLists
public EmailAddressCollection getRoomLists() throws Exception
Retrieves a collection of all room lists in the organization.- Returns:
- An EmailAddressCollection containing all the room lists in the organization
- Throws:
Exception- the exception
-
getRooms
public Collection<EmailAddress> getRooms(EmailAddress emailAddress) throws Exception
Retrieves a collection of all room lists in the specified room list in the organization.- Parameters:
emailAddress- the email address- Returns:
- A collection of EmailAddress objects representing all the rooms within the specifed room list.
- Throws:
Exception- the exception
-
findConversation
public Collection<Conversation> findConversation(ConversationIndexedItemView view, FolderId folderId) throws Exception
Retrieves a collection of all Conversations in the specified Folder.- Parameters:
view- The view controlling the number of conversations returned.folderId- The Id of the folder in which to search for conversations.- Throws:
Exception
-
enableAlwaysCategorizeItemsInConversations
public ServiceResponseCollection<ServiceResponse> enableAlwaysCategorizeItemsInConversations(Iterable<ConversationId> conversationId, Iterable<String> categories, boolean processSynchronously) throws Exception
Sets up a conversation so that any item received within that conversation is always categorized. Calling this method results in a call to EWS.- Parameters:
conversationId- The id of the conversation.categories- The categories that should be stamped on item in the conversation.processSynchronously- Indicates whether the method should return only once enabling this rule and stamping existing item in the conversation is completely done. If processSynchronously is false, the method returns immediately.- Throws:
Exception
-
disableAlwaysCategorizeItemsInConversations
public ServiceResponseCollection<ServiceResponse> disableAlwaysCategorizeItemsInConversations(Iterable<ConversationId> conversationId, boolean processSynchronously) throws Exception
Sets up a conversation so that any item received within that conversation is no longer categorized. Calling this method results in a call to EWS.- Parameters:
conversationId- The id of the conversation.processSynchronously- Indicates whether the method should return only once enabling this rule and stamping existing item in the conversation is completely done. If processSynchronously is false, the method returns immediately.- Throws:
Exception
-
enableAlwaysDeleteItemsInConversations
public ServiceResponseCollection<ServiceResponse> enableAlwaysDeleteItemsInConversations(Iterable<ConversationId> conversationId, boolean processSynchronously) throws Exception
Sets up a conversation so that any item received within that conversation is always moved to Deleted Items folder. Calling this method results in a call to EWS.- Parameters:
conversationId- The id of the conversation.processSynchronously- Indicates whether the method should return only once enabling this rule and stamping existing item in the conversation is completely done. If processSynchronously is false, the method returns immediately.- Throws:
Exception
-
disableAlwaysDeleteItemsInConversations
public ServiceResponseCollection<ServiceResponse> disableAlwaysDeleteItemsInConversations(Iterable<ConversationId> conversationId, boolean processSynchronously) throws Exception
Sets up a conversation so that any item received within that conversation is no longer moved to Deleted Items folder. Calling this method results in a call to EWS.- Parameters:
conversationId- The id of the conversation.processSynchronously- Indicates whether the method should return only once enabling this rule and stamping existing item in the conversation is completely done. If processSynchronously is false, the method returns immediately.- Throws:
Exception
-
enableAlwaysMoveItemsInConversations
public ServiceResponseCollection<ServiceResponse> enableAlwaysMoveItemsInConversations(Iterable<ConversationId> conversationId, FolderId destinationFolderId, boolean processSynchronously) throws Exception
Sets up a conversation so that any item received within that conversation is always moved to a specific folder. Calling this method results in a call to EWS.- Parameters:
conversationId- The Id of the folder to which conversation item should be moved.destinationFolderId- The Id of the destination folder.processSynchronously- Indicates whether the method should return only once enabling this rule and stamping existing item in the conversation is completely done. If processSynchronously is false, the method returns immediately.- Throws:
Exception
-
disableAlwaysMoveItemsInConversations
public ServiceResponseCollection<ServiceResponse> disableAlwaysMoveItemsInConversations(Iterable<ConversationId> conversationIds, boolean processSynchronously) throws Exception
Sets up a conversation so that any item received within that conversation is no longer moved to a specific folder. Calling this method results in a call to EWS.- Parameters:
conversationIds- The conversation ids.processSynchronously- Indicates whether the method should return only once disabling this rule is completely done. If processSynchronously is false, the method returns immediately.- Throws:
Exception
-
moveItemsInConversations
public ServiceResponseCollection<ServiceResponse> moveItemsInConversations(Iterable<HashMap<ConversationId,Date>> idLastSyncTimePairs, FolderId contextFolderId, FolderId destinationFolderId) throws Exception
Moves the item in the specified conversation to the specified destination folder. Calling this method results in a call to EWS.- Parameters:
idLastSyncTimePairs- The pairs of Id of conversation whose item should be moved and the dateTime conversation was last synced (Items received after that dateTime will not be moved).contextFolderId- The Id of the folder that contains the conversation.destinationFolderId- The Id of the destination folder.- Throws:
Exception
-
copyItemsInConversations
public ServiceResponseCollection<ServiceResponse> copyItemsInConversations(Iterable<HashMap<ConversationId,Date>> idLastSyncTimePairs, FolderId contextFolderId, FolderId destinationFolderId) throws Exception
Copies the item in the specified conversation to the specified destination folder. Calling this method results in a call to EWS.- Parameters:
idLastSyncTimePairs- The pairs of Id of conversation whose item should be copied and the dateTime conversation was last synced (Items received after that dateTime will not be copied).contextFolderId- The context folder id.destinationFolderId- The destination folder id.- Throws:
Exception
-
deleteItemsInConversations
public ServiceResponseCollection<ServiceResponse> deleteItemsInConversations(Iterable<HashMap<ConversationId,Date>> idLastSyncTimePairs, FolderId contextFolderId, DeleteMode deleteMode) throws Exception
Deletes the item in the specified conversation. Calling this method results in a call to EWS.- Parameters:
idLastSyncTimePairs- The pairs of Id of conversation whose item should be deleted and the date and time conversation was last synced (Items received after that date will not be deleted). conversation was last synced (Items received after that dateTime will not be copied).contextFolderId- The Id of the folder that contains the conversation.deleteMode- The deletion mode- Throws:
Exception
-
setReadStateForItemsInConversations
public ServiceResponseCollection<ServiceResponse> setReadStateForItemsInConversations(Iterable<HashMap<ConversationId,Date>> idLastSyncTimePairs, FolderId contextFolderId, boolean isRead) throws Exception
Sets the read state for item in conversation. Calling this mehtod would result in call to EWS.- Parameters:
idLastSyncTimePairs- The pairs of Id of conversation whose item should read state set and the date and time conversation was last synced (Items received after that date will not have their read state set). was last synced (Items received after that date will not be deleted). conversation was last synced (Items received after that dateTime will not be copied).contextFolderId- The Id of the folder that contains the conversation.isRead- if set to true, conversation item are marked as read; otherwise they are marked as unread.- Throws:
Exception
-
exportItem
public ExportItemsResponse exportItem(ItemId itemId) throws Exception
- Throws:
Exception
-
exportItems
public ServiceResponseCollection<ExportItemsResponse> exportItems(Iterable<ItemId> itemIds) throws Exception
- Throws:
Exception
-
uploadItem
public UploadItemsResponse uploadItem(UploadItem item) throws Exception
- Throws:
Exception
-
uploadItems
public ServiceResponseCollection<UploadItemsResponse> uploadItems(List<UploadItem> items) throws Exception
- Throws:
Exception
-
convertIds
public ServiceResponseCollection<ConvertIdResponse> convertIds(Iterable<AlternateIdBase> ids, IdFormat destinationFormat) throws Exception
Converts multiple Ids from one format to another in a single call to EWS.- Parameters:
ids- the idsdestinationFormat- the destination format- Returns:
- A ServiceResponseCollection providing conversion results for each specified Ids.
- Throws:
Exception- the exception
-
convertId
public AlternateIdBase convertId(AlternateIdBase id, IdFormat destinationFormat) throws Exception
Converts Id from one format to another in a single call to EWS.- Parameters:
id- the iddestinationFormat- the destination format- Returns:
- The converted Id.
- Throws:
Exception- the exception
-
addDelegates
public Collection<DelegateUserResponse> addDelegates(Mailbox mailbox, MeetingRequestsDeliveryScope meetingRequestsDeliveryScope, DelegateUser... delegateUsers) throws Exception
Adds delegates to a specific mailbox. Calling this method results in a call to EWS.- Parameters:
mailbox- the mailboxmeetingRequestsDeliveryScope- the meeting request delivery scopedelegateUsers- the delegate users- Returns:
- A collection of DelegateUserResponse objects providing the results of the operation.
- Throws:
Exception- the exception
-
addDelegates
public Collection<DelegateUserResponse> addDelegates(Mailbox mailbox, MeetingRequestsDeliveryScope meetingRequestsDeliveryScope, Iterable<DelegateUser> delegateUsers) throws Exception
Adds delegates to a specific mailbox. Calling this method results in a call to EWS.- Parameters:
mailbox- the mailboxmeetingRequestsDeliveryScope- the meeting request delivery scopedelegateUsers- the delegate users- Returns:
- A collection of DelegateUserResponse objects providing the results of the operation.
- Throws:
Exception- the exception
-
updateDelegates
public Collection<DelegateUserResponse> updateDelegates(Mailbox mailbox, MeetingRequestsDeliveryScope meetingRequestsDeliveryScope, DelegateUser... delegateUsers) throws Exception
Updates delegates on a specific mailbox. Calling this method results in a call to EWS.- Parameters:
mailbox- the mailboxmeetingRequestsDeliveryScope- the meeting request delivery scopedelegateUsers- the delegate users- Returns:
- A collection of DelegateUserResponse objects providing the results of the operation.
- Throws:
Exception- the exception
-
updateDelegates
public Collection<DelegateUserResponse> updateDelegates(Mailbox mailbox, MeetingRequestsDeliveryScope meetingRequestsDeliveryScope, Iterable<DelegateUser> delegateUsers) throws Exception
Updates delegates on a specific mailbox. Calling this method results in a call to EWS.- Parameters:
mailbox- the mailboxmeetingRequestsDeliveryScope- the meeting request delivery scopedelegateUsers- the delegate users- Returns:
- A collection of DelegateUserResponse objects providing the results of the operation.
- Throws:
Exception- the exception
-
removeDelegates
public Collection<DelegateUserResponse> removeDelegates(Mailbox mailbox, UserId... userIds) throws Exception
Removes delegates on a specific mailbox. Calling this method results in a call to EWS.- Parameters:
mailbox- the mailboxuserIds- the user ids- Returns:
- A collection of DelegateUserResponse objects providing the results of the operation.
- Throws:
Exception- the exception
-
removeDelegates
public Collection<DelegateUserResponse> removeDelegates(Mailbox mailbox, Iterable<UserId> userIds) throws Exception
Removes delegates on a specific mailbox. Calling this method results in a call to EWS.- Parameters:
mailbox- the mailboxuserIds- the user ids- Returns:
- A collection of DelegateUserResponse objects providing the results of the operation.
- Throws:
Exception- the exception
-
getDelegates
public DelegateInformation getDelegates(Mailbox mailbox, boolean includePermissions, UserId... userIds) throws Exception
Retrieves the delegates of a specific mailbox. Calling this method results in a call to EWS.- Parameters:
mailbox- the mailboxincludePermissions- the include permissionsuserIds- the user ids- Returns:
- A GetDelegateResponse providing the results of the operation.
- Throws:
Exception- the exception
-
getDelegates
public DelegateInformation getDelegates(Mailbox mailbox, boolean includePermissions, Iterable<UserId> userIds) throws Exception
Retrieves the delegates of a specific mailbox. Calling this method results in a call to EWS.- Parameters:
mailbox- the mailboxincludePermissions- the include permissionsuserIds- the user ids- Returns:
- A GetDelegateResponse providing the results of the operation.
- Throws:
Exception- the exception
-
createUserConfiguration
public void createUserConfiguration(UserConfiguration userConfiguration) throws Exception
Creates the user configuration.- Parameters:
userConfiguration- the user configuration- Throws:
Exception- the exception
-
deleteUserConfiguration
public void deleteUserConfiguration(String name, FolderId parentFolderId) throws Exception
Creates a UserConfiguration.- Parameters:
name- the nameparentFolderId- the parent folder id- Throws:
Exception- the exception
-
getUserConfiguration
public UserConfiguration getUserConfiguration(String name, FolderId parentFolderId, UserConfigurationProperties properties) throws Exception
Creates a UserConfiguration.- Parameters:
name- the nameparentFolderId- the parent folder idproperties- the property- Returns:
- the user configuration
- Throws:
Exception- the exception
-
loadPropertiesForUserConfiguration
public void loadPropertiesForUserConfiguration(UserConfiguration userConfiguration, UserConfigurationProperties properties) throws Exception
Loads the property of the specified userConfiguration.- Parameters:
userConfiguration- the user configurationproperties- the property- Throws:
Exception- the exception
-
updateUserConfiguration
public void updateUserConfiguration(UserConfiguration userConfiguration) throws Exception
Updates a UserConfiguration.- Parameters:
userConfiguration- the user configuration- Throws:
Exception- the exception
-
getInboxRules
public RuleCollection getInboxRules() throws Exception
Retrieves inbox rules of the authenticated user.- Returns:
- A RuleCollection object containing the authenticated users inbox rules.
- Throws:
Exception
-
getInboxRules
public RuleCollection getInboxRules(String mailboxSmtpAddress) throws Exception
Retrieves the inbox rules of the specified user.- Parameters:
mailboxSmtpAddress- The SMTP address of the user whose inbox rules should be retrieved- Returns:
- A RuleCollection object containing the inbox rules of the specified user.
- Throws:
Exception
-
updateInboxRules
public void updateInboxRules(Iterable<RuleOperation> operations, boolean removeOutlookRuleBlob) throws Exception
Updates the authenticated user's inbox rules by applying the specified operations.- Parameters:
operations- The operations that should be applied to the user's inbox rules.removeOutlookRuleBlob- Indicate whether or not to remove Outlook Rule Blob.- Throws:
Exception
-
updateInboxRules
public void updateInboxRules(Iterable<RuleOperation> operations, boolean removeOutlookRuleBlob, String mailboxSmtpAddress) throws Exception
Updates the authenticated user's inbox rules by applying the specified operations.- Parameters:
operations- The operations that should be applied to the user's inbox rules.removeOutlookRuleBlob- Indicate whether or not to remove Outlook Rule Blob.mailboxSmtpAddress- The SMTP address of the user whose inbox rules should be retrieved- Throws:
Exception
-
autodiscoverUrl
public void autodiscoverUrl(String emailAddress) throws Exception
Initializes the Url property to the Exchange Web Services URL for the specified e-mail address by calling the Autodiscover service.- Parameters:
emailAddress- the email address- Throws:
Exception- the exception
-
autodiscoverUrl
public void autodiscoverUrl(String emailAddress, IAutodiscoverRedirectionUrl validateRedirectionUrlCallback) throws Exception
Initializes the Url property to the Exchange Web Services URL for the specified e-mail address by calling the Autodiscover service.- Parameters:
emailAddress- the email address to use.validateRedirectionUrlCallback- The callback used to validate redirection URL- Throws:
Exception- the exception
-
executeDiagnosticMethod
protected Document executeDiagnosticMethod(String verb, Node parameter) throws Exception
Executes the diagnostic method.- Parameters:
verb- The verb.parameter- The parameter.- Throws:
Exception
-
validate
public void validate() throws ServiceLocalException
Validates this instance.- Overrides:
validatein classExchangeServiceBase- Throws:
ServiceLocalException- the service local exception
-
prepareHttpWebRequest
public HttpWebRequest prepareHttpWebRequest() throws ServiceLocalException, URISyntaxException
Prepare http web request.- Returns:
- the http web request
- Throws:
ServiceLocalException- the service local exceptionURISyntaxException- the uRI syntax exception
-
prepareHttpPoolingWebRequest
public HttpWebRequest prepareHttpPoolingWebRequest() throws ServiceLocalException, URISyntaxException
Prepares a http web request from a pooling connection manager, used for subscriptions.- Returns:
- A http web request
- Throws:
ServiceLocalException- The service local exceptionURISyntaxException- the uRI syntax exception
-
processHttpErrorResponse
public void processHttpErrorResponse(HttpWebRequest httpWebResponse, Exception webException) throws Exception
Processes an HTTP error response.- Specified by:
processHttpErrorResponsein classExchangeServiceBase- Parameters:
httpWebResponse- The HTTP web response.webException- The web exception- Throws:
Exception
-
getUrl
public URI getUrl()
Gets the URL of the Exchange Web Services.- Returns:
- URL of the Exchange Web Services.
-
setUrl
public void setUrl(URI url)
Sets the URL of the Exchange Web Services.- Parameters:
url- URL of the Exchange Web Services.
-
getImpersonatedUserId
public ImpersonatedUserId getImpersonatedUserId()
Gets the impersonated user id.- Returns:
- the impersonated user id
-
setImpersonatedUserId
public void setImpersonatedUserId(ImpersonatedUserId impersonatedUserId)
Sets the impersonated user id.- Parameters:
impersonatedUserId- the new impersonated user id
-
getPreferredCulture
public Locale getPreferredCulture()
Gets the preferred culture.- Returns:
- the preferred culture
-
setPreferredCulture
public void setPreferredCulture(Locale preferredCulture)
Sets the preferred culture.- Parameters:
preferredCulture- the new preferred culture
-
getDateTimePrecision
public DateTimePrecision getDateTimePrecision()
Gets the DateTime precision for DateTime values returned from Exchange Web Services.- Returns:
- the DateTimePrecision
-
setDateTimePrecision
public void setDateTimePrecision(DateTimePrecision d)
Sets the DateTime precision for DateTime values Web Services.- Parameters:
d- date time precision
-
setPreferredCulture
public void setPreferredCulture(DateTimePrecision dateTimePrecision)
Sets the DateTime precision for DateTime values returned from Exchange Web Services.- Parameters:
dateTimePrecision- the new DateTimePrecision
-
getFileAttachmentContentHandler
public IFileAttachmentContentHandler getFileAttachmentContentHandler()
Gets the file attachment content handler.- Returns:
- the file attachment content handler
-
setFileAttachmentContentHandler
public void setFileAttachmentContentHandler(IFileAttachmentContentHandler fileAttachmentContentHandler)
Sets the file attachment content handler.- Parameters:
fileAttachmentContentHandler- the new file attachment content handler
-
getUnifiedMessaging
public UnifiedMessaging getUnifiedMessaging()
Provides access to the Unified Messaging functionalities.- Returns:
- the unified messaging
-
getEnableScpLookup
public boolean getEnableScpLookup()
Gets or sets a value indicating whether the AutodiscoverUrl method should perform SCP (Service Connection Point) record lookup when determining the Autodiscover service URL.- Returns:
- enable scp lookup flag.
-
setEnableScpLookup
public void setEnableScpLookup(boolean value)
-
getExchange2007CompatibilityMode
public boolean getExchange2007CompatibilityMode()
Returns true whether Exchange2007 compatibility mode is enabled, false otherwise.
-
setExchange2007CompatibilityMode
public void setExchange2007CompatibilityMode(boolean value)
Set the flag indicating if the Exchange2007 compatibility mode is enabled.In order to support E12 servers, the
exchange2007CompatibilityModeproperty, set to true, can be used to indicate that we should use "Exchange2007" as the server version String rather than Exchange2007_SP1.- Parameters:
value- true if the Exchange2007 compatibility mode is enabled.
-
getServerTimeZones
public Collection<TimeZoneDefinition> getServerTimeZones(Iterable<String> timeZoneIds) throws Exception
Retrieves the definitions of the specified server-side time zones.- Parameters:
timeZoneIds- the time zone ids- Returns:
- A Collection containing the definitions of the specified time zones.
- Throws:
Exception
-
getServerTimeZones
public Collection<TimeZoneDefinition> getServerTimeZones() throws Exception
Retrieves the definitions of all server-side time zones.- Returns:
- A Collection containing the definitions of the specified time zones.
- Throws:
Exception
-
autodiscoverRedirectionUrlValidationCallback
public boolean autodiscoverRedirectionUrlValidationCallback(String redirectionUrl) throws AutodiscoverLocalException
Description copied from interface:IAutodiscoverRedirectionUrlAutodiscover redirection url validation callback.- Specified by:
autodiscoverRedirectionUrlValidationCallbackin interfaceIAutodiscoverRedirectionUrl- Parameters:
redirectionUrl- the redirection url- Returns:
- true, if successful
- Throws:
AutodiscoverLocalException- the autodiscover local exception
-
-