com.moyosoft.exchange
Class Exchange

java.lang.Object
  extended by com.moyosoft.exchange.Exchange

public class Exchange
extends java.lang.Object

Provides access to the Exchange server. An Exchange object is the starting point for connecting and accessing the Microsoft Exchange server, its data, folders and items.

The Exchange class constructor connects to the server using the specified hostname, credentials and domain. Usage example:

Exchange exchange = new Exchange("hostname", "username", "password");
System.out.println("Exchange server version is: " + exchange.getExchangeVersion());

See Also:
Exchange(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

Nested Class Summary
static class Exchange.Settings
           
 
Constructor Summary
Exchange(java.lang.String hostname, java.lang.String username, java.lang.String password)
          Connects to the Exchange server using the specified parameters over a secure SSL channel.
Exchange(java.lang.String hostname, java.lang.String username, java.lang.String password, boolean useHttps)
          Connects to the Exchange server using the specified parameters.
Exchange(java.lang.String hostname, java.lang.String username, java.lang.String password, java.lang.String domain)
          Connects to the Exchange server using the specified parameters over a secure SSL channel.
Exchange(java.lang.String hostname, java.lang.String username, java.lang.String password, java.lang.String domain, boolean useHttps)
          Connects to the Exchange server using the specified parameters.
Exchange(java.lang.String hostname, java.lang.String username, java.lang.String password, java.lang.String domain, java.lang.String url)
          Connects to the Exchange server using the specified parameters and the specified URL string.
 
Method Summary
 ExchangeNotificationWatermark addNewMailListener(ExchangeNewMailListener listener)
          Adds a listener that will be notified when a new mail is received in the Inbox folder.
 ExchangeNotificationWatermark addNewMailListener(ExchangeNewMailListener listener, java.lang.String watermark)
          Adds a listener that will be notified when a new mail is received in the Inbox folder.
 void checkNewNotifications()
          Forces new notifications to be pulled (when using the Pull method) without waiting the configured pulling period.
 void configureNotificationsPushStatusUpdateFrequency(int statusUpdateFrequencyInMinutes)
           
 void configureNotificationsUsingPull()
          Configures notification events to be pulled periodically from the Exchange server.
 void configureNotificationsUsingPull(int period)
          Configures notification events to be pulled periodically from the Exchange server.
 void configureNotificationsUsingPush(int portNumber)
          Configures notification events to be pushed from the Exchange server to an internal HTTP server.
 void configureNotificationsUsingPush(int portNumber, java.lang.String pushServerHostname)
          Configures notification events to be pushed from the Exchange server to an internal HTTP server.
 void configureNotificationsUsingPush(int portNumber, java.lang.String pushServerHostname, boolean useHttps)
          Configures notification events to be pushed from the Exchange server to an internal HTTP server.
 ExchangeNotificationHandler configureNotificationsUsingPush(java.lang.String pushServerUrl)
          Configures notification events to be pushed from the Exchange server to the specified URL.
 ExchangeCalendarItem createCalendarItem()
          Creates a new calendar item (appointment) in the user's default calendar folder.
 ExchangeMail createMail()
          Creates a new email object that can be filled and sent out.
 ExchangeFolder getCalendarFolder()
          Returns the user's Calendar folder.
 ExchangeServiceClient getClient()
          Returns the current HTTP client used to send requests and receive responses to/from the Exchange server.
 ExchangeFolder getContactsFolder()
          Returns the user's Contacts folder.
 ExchangeFolder getDelegatedFolder(FolderType folderType, java.lang.String mailboxEmailAddress)
          Returns a folder of another user using Delegate Access.
 ExchangeFolder getDeletedItemsFolder()
          Returns the user's Deleted items folder.
 java.lang.String getExchangeFullVersion()
          Returns the full Exchange version including the build numbers.
 java.lang.String getExchangeVersion()
          Returns the major and minor version numbers separated by a dot.
 ExchangeFolder getFolder(FolderType folderType)
          Returns the logged user's folder corresponding to the specified type.
 ExchangeFolder getFolder(java.lang.String folderId)
          Returns an Exchange folder identified by the specified ID or null if the folder is not found.
 ExchangeFolder getInboxFolder()
          Returns the user's Inbox folder containing received messages.
 ExchangeItem getItem(java.lang.String itemId)
          Returns an Exchange item identified by the specified ID or null if the item is not found.
 ExchangeFolder getNotesFolder()
          Returns the user's Notes folder.
 ExchangeFolder getRootFolder()
          Returns the logged user's root folder.
 ExchangeFolder getRootFolder(java.lang.String folderPath)
          Returns a sub-folder of the root folder (FolderType.Root) for the specified name or path.
 FoldersCollection getRootFolders()
          Returns a collection containing the root folder's sub-folders.
 ExchangeFolder getSentItemsFolder()
          Returns the user's Sent items folder.
 ExchangeFolder getTasksFolder()
          Returns the user's Tasks folder.
 ExchangeFolder getTopFolder()
          Returns the 'Top of Information Store' folder of the logged user.
 ExchangeFolder getTopFolder(java.lang.String folderPath)
          Returns a sub-folder of the 'Top of Information Store' folder (FolderType.MsgFolderRoot) for the specified name or path.
 FoldersCollection getTopFolders()
          Returns a collection containing the 'Top of Information Store' folder's sub-folders.
 OutOfOfficeSettings getUserOutOfOfficeSettings(java.lang.String mailboxEmailAddress)
          Returns a mailbox's Out of Office settings and messages.
 UsersAvailability getUsersAvailability(java.util.Date startDate, java.util.Date endDate)
          Returns information on users and rooms availability between the specified dates.
 UsersAvailability getUsersAvailability(java.util.Date startDate, java.util.Date endDate, int freeBusyIntervalInMinutes)
          Returns information on users and rooms availability between the specified dates.
 void removeNewMailListener(ExchangeNewMailListener listener)
          Removes a listener.
 void removeNotificationSubscription(java.lang.String subscriptionId)
          Removes the specified notification subscription.
 java.lang.Iterable<ExchangeMailbox> resolveNames(java.lang.String unresolved)
          Resolves the specified name to a list of mailboxes.
 java.lang.Iterable<ExchangeMailbox> resolveNames(java.lang.String unresolved, boolean includeContactData)
          Resolves the specified name to a list of mailboxes.
 void setClient(ExchangeServiceClient client)
          Changes the HTTP client used to send requests and receive responses to/from the Exchange server.
 void setImpersonationUsingPrimarySmtpAddress(java.lang.String primarySmtpAddress)
          Defines a user's primary SMTP address to be used as Exchange Impersonation method.
 void setImpersonationUsingSecurityIdentifier(java.lang.String securityIdentifier)
          Defines a security identifier to be used as Exchange Impersonation method.
 void setImpersonationUsingUserPricipalName(java.lang.String userPricipalName)
          Defines a user's principal name to be used as Exchange Impersonation method.
 void setTimeZone(java.util.TimeZone timeZone)
           
 void stopNotifications()
          Cleans up the notification system.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exchange

public Exchange(java.lang.String hostname,
                java.lang.String username,
                java.lang.String password)
         throws ExchangeServiceException
Connects to the Exchange server using the specified parameters over a secure SSL channel.

Throws:
ExchangeServiceException - if any errors occur when establishing the communication with Exchange.

Exchange

public Exchange(java.lang.String hostname,
                java.lang.String username,
                java.lang.String password,
                boolean useHttps)
         throws ExchangeServiceException
Connects to the Exchange server using the specified parameters. If the useHttps argument is set to true, the connection is established over a secure SSL channel; if set to false, plain HTTP is used.

Throws:
ExchangeServiceException - if any errors occur when establishing the communication with Exchange.

Exchange

public Exchange(java.lang.String hostname,
                java.lang.String username,
                java.lang.String password,
                java.lang.String domain)
         throws ExchangeServiceException
Connects to the Exchange server using the specified parameters over a secure SSL channel.

Throws:
ExchangeServiceException - if any errors occur when establishing the communication with Exchange.

Exchange

public Exchange(java.lang.String hostname,
                java.lang.String username,
                java.lang.String password,
                java.lang.String domain,
                boolean useHttps)
         throws ExchangeServiceException
Connects to the Exchange server using the specified parameters. If the useHttps argument is set to true, the connection is established over a secure SSL channel; if set to false, plain HTTP is used.

Throws:
ExchangeServiceException - if any errors occur when establishing the communication with Exchange.

Exchange

public Exchange(java.lang.String hostname,
                java.lang.String username,
                java.lang.String password,
                java.lang.String domain,
                java.lang.String url)
         throws ExchangeServiceException
Connects to the Exchange server using the specified parameters and the specified URL string. The hostname/domain arguments are used for authentication purposes only.

Throws:
ExchangeServiceException - if any errors occur when establishing the communication with Exchange.
Method Detail

getFolder

public ExchangeFolder getFolder(FolderType folderType)
                         throws ExchangeServiceException
Returns the logged user's folder corresponding to the specified type.

For example, to access the Inbox folder, the following code can be used:

Exchange exchange = new Exchange("hostname", "username", "password");
ExchangeFolder folder = exchange.getFolder(FolderType.Inbox); System.out.println("Inbox name is: " + folder.getDisplayName());

Returns:
the Exchange folder identified by the specified type.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getRootFolder

public ExchangeFolder getRootFolder(java.lang.String folderPath)
                             throws ExchangeServiceException
Returns a sub-folder of the root folder (FolderType.Root) for the specified name or path. Accepted path separators are '\' or '/'. If the specified name or path doesn't exists, null is returned. For example, the path string "Top of Information Store/Sent Items" can be used.

This method returns the same result as:
getFolder(FolderType.Root).getFolders().get(folderPath);

Returns:
the Exchange folder identified by the specified name/path or null if the folder is not found.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getFolder(FolderType), getTopFolder(String)

getTopFolder

public ExchangeFolder getTopFolder(java.lang.String folderPath)
                            throws ExchangeServiceException
Returns a sub-folder of the 'Top of Information Store' folder (FolderType.MsgFolderRoot) for the specified name or path. Accepted path separators are '\' or '/'. If the specified name or path doesn't exists, null is returned. For example, the path string "Sent Items" can be used.

This method returns the same result as:
getFolder(FolderType.MsgFolderRoot).getFolders().get(folderPath);

Returns:
the Exchange folder identified by the specified name/path or null if the folder is not found.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getFolder(FolderType), getRootFolder(String)

getRootFolder

public ExchangeFolder getRootFolder()
                             throws ExchangeServiceException
Returns the logged user's root folder. This folder contains all of the user's sub-folders.

This method returns the same result as:
getFolder(FolderType.Root);

Returns:
the root Exchange folder.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getFolder(FolderType), getTopFolder()

getTopFolder

public ExchangeFolder getTopFolder()
                            throws ExchangeServiceException
Returns the 'Top of Information Store' folder of the logged user. This folder contains information sub-folders like the Inbox, Calendar, Contacts, Notes, Sent Items, Tasks, etc.

This method returns the same result as:
getFolder(FolderType.MsgFolderRoot);

Returns:
the top Exchange folder.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getFolder(FolderType), getRootFolder()

getCalendarFolder

public ExchangeFolder getCalendarFolder()
                                 throws ExchangeServiceException
Returns the user's Calendar folder.

This method returns the same result as:
getFolder(FolderType.Calendar);

Returns:
the Exchange calendar folder.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getFolder(FolderType)

getContactsFolder

public ExchangeFolder getContactsFolder()
                                 throws ExchangeServiceException
Returns the user's Contacts folder.

This method returns the same result as:
getFolder(FolderType.Contacts);

Returns:
the Exchange contacts folder.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getFolder(FolderType)

getDeletedItemsFolder

public ExchangeFolder getDeletedItemsFolder()
                                     throws ExchangeServiceException
Returns the user's Deleted items folder.

This method returns the same result as:
getFolder(FolderType.DeletedItems);

Returns:
the Exchange Deleted items folder.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getFolder(FolderType)

getInboxFolder

public ExchangeFolder getInboxFolder()
                              throws ExchangeServiceException
Returns the user's Inbox folder containing received messages.

This method returns the same result as:
getFolder(FolderType.Inbox);

Returns:
the Exchange Inbox folder.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getFolder(FolderType)

getNotesFolder

public ExchangeFolder getNotesFolder()
                              throws ExchangeServiceException
Returns the user's Notes folder.

This method returns the same result as:
getFolder(FolderType.Notes);

Returns:
the Exchange notes folder.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getFolder(FolderType)

getSentItemsFolder

public ExchangeFolder getSentItemsFolder()
                                  throws ExchangeServiceException
Returns the user's Sent items folder.

This method returns the same result as:
getFolder(FolderType.SentItems);

Returns:
the Exchange Sent items folder.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getFolder(FolderType)

getTasksFolder

public ExchangeFolder getTasksFolder()
                              throws ExchangeServiceException
Returns the user's Tasks folder.

This method returns the same result as:
getFolder(FolderType.Tasks);

Returns:
the Exchange tasks folder.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getFolder(FolderType)

getRootFolders

public FoldersCollection getRootFolders()
                                 throws ExchangeServiceException
Returns a collection containing the root folder's sub-folders.

This method returns the same result as:
getFolder(FolderType.Root).getFolders();

Returns:
a collection of the root Exchange folders.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getRootFolder(), getRootFolder(String), getTopFolders()

getTopFolders

public FoldersCollection getTopFolders()
                                throws ExchangeServiceException
Returns a collection containing the 'Top of Information Store' folder's sub-folders. This collection contains information sub-folders like the Inbox, Calendar, Contacts, Notes, Sent Items, Tasks, etc.

This method returns the same result as:
getFolder(FolderType.MsgFolderRoot).getFolders();

Returns:
a collection of the top Exchange folders.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.
See Also:
getTopFolder(), getTopFolder(String), getRootFolders()

getFolder

public ExchangeFolder getFolder(java.lang.String folderId)
                         throws ExchangeServiceException
Returns an Exchange folder identified by the specified ID or null if the folder is not found.

Returns:
the Exchange folder.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getItem

public ExchangeItem getItem(java.lang.String itemId)
                     throws ExchangeServiceException
Returns an Exchange item identified by the specified ID or null if the item is not found.

Returns:
the Exchange item.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

createMail

public ExchangeMail createMail()
                        throws ExchangeServiceException
Creates a new email object that can be filled and sent out. If the save() method is called on the returned ExchangeMail object, the email will be saved in the Drafts folder.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

createCalendarItem

public ExchangeCalendarItem createCalendarItem()
                                        throws ExchangeServiceException
Creates a new calendar item (appointment) in the user's default calendar folder.

Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

getExchangeVersion

public java.lang.String getExchangeVersion()
Returns the major and minor version numbers separated by a dot. For example, the following values can be returned:

"8.0" for Exchange 2007
"8.1" for Exchange 2007 with Service Pack 1
"8.2" for Exchange 2007 with Service Pack 2
"14.0" for Exchange 2010

Returns:
the Exchange version number.

getExchangeFullVersion

public java.lang.String getExchangeFullVersion()
Returns the full Exchange version including the build numbers. Numbers are separated by a dot. For example, the following values can be returned:

"8.1.240.6"
"14.0.639.21"

Returns:
the Exchange full version number.

setTimeZone

public void setTimeZone(java.util.TimeZone timeZone)

getDelegatedFolder

public ExchangeFolder getDelegatedFolder(FolderType folderType,
                                         java.lang.String mailboxEmailAddress)
                                  throws ExchangeServiceException
Returns a folder of another user using Delegate Access. The specified mailbox address identifies the other user which has to grant the logged user access to her folder. For example, Delegate Access can be configured in Outlook from the menu Tools | Options | Delegates tab.

This method is only available in the Professional edition of the library.

Returns:
the Exchange folder of the specified user and identified by the specified type.
Throws:
ExchangeServiceException - if any errors occur during the communication with Exchange.

setImpersonationUsingUserPricipalName

public void setImpersonationUsingUserPricipalName(java.lang.String userPricipalName)
Defines a user's principal name to be used as Exchange Impersonation method. This allows a given account to perform operations with the rights of the impersonated account instead of the rights of the caller's account.

This method is only available in the Professional edition of the library.


setImpersonationUsingSecurityIdentifier

public void setImpersonationUsingSecurityIdentifier(java.lang.String securityIdentifier)
Defines a security identifier to be used as Exchange Impersonation method. This allows a given account to perform operations with the rights of the impersonated account instead of the rights of the caller's account.

This method is only available in the Professional edition of the library.


setImpersonationUsingPrimarySmtpAddress

public void setImpersonationUsingPrimarySmtpAddress(java.lang.String primarySmtpAddress)
Defines a user's primary SMTP address to be used as Exchange Impersonation method. This allows a given account to perform operations with the rights of the impersonated account instead of the rights of the caller's account.

This method is only available in the Professional edition of the library.


getUserOutOfOfficeSettings

public OutOfOfficeSettings getUserOutOfOfficeSettings(java.lang.String mailboxEmailAddress)
                                               throws ExchangeServiceException
Returns a mailbox's Out of Office settings and messages. The mailbox is identified by the specified e-mail address which has to be owned by the logged user.

This method is only available in the Professional edition of the library.

Throws:
ExchangeServiceException

getUsersAvailability

public UsersAvailability getUsersAvailability(java.util.Date startDate,
                                              java.util.Date endDate)
                                       throws ExchangeServiceException
Returns information on users and rooms availability between the specified dates.

This method is only available in the Professional edition of the library.

Throws:
ExchangeServiceException

getUsersAvailability

public UsersAvailability getUsersAvailability(java.util.Date startDate,
                                              java.util.Date endDate,
                                              int freeBusyIntervalInMinutes)
                                       throws ExchangeServiceException
Returns information on users and rooms availability between the specified dates.

This method is only available in the Professional edition of the library.

Throws:
ExchangeServiceException

resolveNames

public java.lang.Iterable<ExchangeMailbox> resolveNames(java.lang.String unresolved)
                                                 throws ExchangeServiceException
Resolves the specified name to a list of mailboxes.

This method is only available in the Professional edition of the library.

Throws:
ExchangeServiceException

resolveNames

public java.lang.Iterable<ExchangeMailbox> resolveNames(java.lang.String unresolved,
                                                        boolean includeContactData)
                                                 throws ExchangeServiceException
Resolves the specified name to a list of mailboxes.

This method is only available in the Professional edition of the library.

Parameters:
includeContactData - if true detailed contact information are included in the resulting mailboxes; if false, contact data are not queried.
Throws:
ExchangeServiceException

addNewMailListener

public ExchangeNotificationWatermark addNewMailListener(ExchangeNewMailListener listener)
                                                 throws ExchangeServiceException
Adds a listener that will be notified when a new mail is received in the Inbox folder.

This method is only available in the Professional edition of the library.

Parameters:
listener - the listener to be notified
Throws:
ExchangeServiceException

addNewMailListener

public ExchangeNotificationWatermark addNewMailListener(ExchangeNewMailListener listener,
                                                        java.lang.String watermark)
                                                 throws ExchangeServiceException
Adds a listener that will be notified when a new mail is received in the Inbox folder.

This method is only available in the Professional edition of the library.

Parameters:
listener - the listener to be notified
Throws:
ExchangeServiceException

removeNewMailListener

public void removeNewMailListener(ExchangeNewMailListener listener)
                           throws ExchangeServiceException
Removes a listener.

This method is only available in the Professional edition of the library.

Parameters:
listener - the listener to be removed
Throws:
ExchangeServiceException

configureNotificationsUsingPull

public void configureNotificationsUsingPull(int period)
                                     throws ExchangeServiceException
Configures notification events to be pulled periodically from the Exchange server. An internal pulling thread will be used checking for new events every X seconds (specified by the parameter period). When new events are received, registered listeners will be notified.

Pulling is the default method used. It is not necessary to call this method except to adjust the default period or to change the notification method back to Pull.

This method is only available in the Professional edition of the library.

Parameters:
period - the pulling period in seconds
Throws:
ExchangeServiceException

configureNotificationsUsingPull

public void configureNotificationsUsingPull()
                                     throws ExchangeServiceException
Configures notification events to be pulled periodically from the Exchange server. An internal pulling thread will be used checking for new events periodically. When new events are received, registered listeners will be notified.

Pulling is the default method used. It is not necessary to call this method except to change the notification method back to Pull.

This method is only available in the Professional edition of the library.

Throws:
ExchangeServiceException

configureNotificationsUsingPush

public ExchangeNotificationHandler configureNotificationsUsingPush(java.lang.String pushServerUrl)
                                                            throws ExchangeServiceException
Configures notification events to be pushed from the Exchange server to the specified URL. The URL has to be a valid HTTP URL and accept Exchange requests. When events are pushed, the application serving the specified URL should use the returned handler object to dispatch the events to the registered listeners.

This method is only available in the Professional edition of the library.

Parameters:
pushServerUrl - the push server URL
Throws:
ExchangeServiceException

configureNotificationsUsingPush

public void configureNotificationsUsingPush(int portNumber,
                                            java.lang.String pushServerHostname,
                                            boolean useHttps)
                                     throws ExchangeServiceException
Configures notification events to be pushed from the Exchange server to an internal HTTP server. The HTTP server will be automatically started and will accept connections on the specified port number. When events are pushed from Exchange to the HTTP server, registered listeners will be notified.

This method is only available in the Professional edition of the library.

Parameters:
portNumber - the TCP port number used to start the local HTTP server.
pushServerHostname - the hostname or IP address of this local server that Exchange will send notifications to.
useHttps - if true, a secure HTTPS connection will be used, otherwise a plain HTTP will be used. Note that notifications do not contain sensitive data (only a numeric ID is transmitted), so using a secure HTTPS channel is not necessary.
Throws:
ExchangeServiceException

configureNotificationsUsingPush

public void configureNotificationsUsingPush(int portNumber,
                                            java.lang.String pushServerHostname)
                                     throws ExchangeServiceException
Configures notification events to be pushed from the Exchange server to an internal HTTP server. The HTTP server will be automatically started and will accept connections on the specified port number. When events are pushed from Exchange to the HTTP server, registered listeners will be notified.

This method is only available in the Professional edition of the library.

Parameters:
portNumber - the TCP port number used to start the local HTTP server.
pushServerHostname - the hostname or IP address of this local server that Exchange will send notifications to.
Throws:
ExchangeServiceException

configureNotificationsUsingPush

public void configureNotificationsUsingPush(int portNumber)
                                     throws ExchangeServiceException
Configures notification events to be pushed from the Exchange server to an internal HTTP server. The HTTP server will be automatically started and will accept connections on the specified port number. When events are pushed from Exchange to the HTTP server, registered listeners will be notified.

This method is only available in the Professional edition of the library.

Parameters:
portNumber - the TCP port number used to start the local HTTP server.
Throws:
ExchangeServiceException

configureNotificationsPushStatusUpdateFrequency

public void configureNotificationsPushStatusUpdateFrequency(int statusUpdateFrequencyInMinutes)
                                                     throws ExchangeServiceException
Throws:
ExchangeServiceException

checkNewNotifications

public void checkNewNotifications()
                           throws ExchangeServiceException
Forces new notifications to be pulled (when using the Pull method) without waiting the configured pulling period.

This method is only available in the Professional edition of the library.

Throws:
ExchangeServiceException

stopNotifications

public void stopNotifications()
                       throws ExchangeServiceException
Cleans up the notification system. Notification events will no longer be received by the listeners.

This method is only available in the Professional edition of the library.

Throws:
ExchangeServiceException

removeNotificationSubscription

public void removeNotificationSubscription(java.lang.String subscriptionId)
                                    throws ExchangeServiceException
Removes the specified notification subscription. Notification events will no longer be received by the associated listener. The subscription ID is returned by the method ExchangeNotificationWatermark.getSubscriptionId().

This method is only available in the Professional edition of the library.

Throws:
ExchangeServiceException

getClient

public ExchangeServiceClient getClient()
Returns the current HTTP client used to send requests and receive responses to/from the Exchange server. The client can be used to send raw requests for debugging purposes or to be wrapped in a proxy client.

This method is only available in the Professional edition of the library.

See Also:
ExchangeServiceClient, setClient(com.moyosoft.exchange.util.ExchangeServiceClient)

setClient

public void setClient(ExchangeServiceClient client)
Changes the HTTP client used to send requests and receive responses to/from the Exchange server. This allows to implement a custom client or wrap the existing client in a proxy client.

This method is only available in the Professional edition of the library.

See Also:
ExchangeServiceClient, getClient()