Moyosoft Products | Services | Download | Contact us    
Java Bridge to Exchange
Products  >  Java Bridge to Exchange  >  API Reference    
API Reference
   
Overview  |  
Classic JavaDoc

Class Exchange

java.lang.Object
  └ com.moyosoft.exchange.Exchange


public class Exchange

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:

Constructors

public
Exchange (String hostname, String username, String password)
Connects to the Exchange server using the specified parameters over a secure SSL channel.
public
Exchange (String hostname, String username, String password, boolean useHttps)
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.
public
Exchange (String hostname, String username, String password, String domain)
Connects to the Exchange server using the specified parameters over a secure SSL channel.
public
Exchange (String hostname, String username, String password, String domain, boolean useHttps)
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.
public
Exchange (String hostname, String username, String password, String domain, String url)
Connects to the Exchange server using the specified parameters and the specified URL string. The hostname/domain arguments are used for authentication purposes only.

Methods

addNewMailListener (ExchangeNewMailListener listener)
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.
addNewMailListener (ExchangeNewMailListener listener, String watermark)
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.
void
checkNewNotifications ()
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.
void
configureNotificationsPushStatusUpdateFrequency (int statusUpdateFrequencyInMinutes)
void
configureNotificationsUsingPull (int period)
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 ... more >
void
configureNotificationsUsingPull ()
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 necessar ... more >
configureNotificationsUsingPush (String pushServerUrl)
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 ... more >
void
configureNotificationsUsingPush (int portNumber, String pushServerHostname, boolean useHttps)
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 ... more >
void
configureNotificationsUsingPush (int portNumber, String pushServerHostname)
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 ... more >
void
configureNotificationsUsingPush (int portNumber)
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 ... more >
convertId (ExchangeId id, ExchangeIdFormat destinationFormat)
convertIds (ExchangeId ids, ExchangeIdFormat destinationFormat)
createCalendarItem ()
Creates a new calendar item (appointment) in the user's default calendar folder.
createMail ()
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.
getCalendarFolder ()
Returns the user's Calendar folder. This method returns the same result as: getFolder(FolderType.Calendar);
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.
getContactsFolder ()
Returns the user's Contacts folder. This method returns the same result as: getFolder(FolderType.Contacts);
getDelegatedFolder (FolderType folderType, String mailboxEmailAddress)
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 meth ... more >
getDeletedItemsFolder ()
Returns the user's Deleted items folder. This method returns the same result as: getFolder(FolderType.DeletedItems);
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"
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
getFolder (FolderType folderType)
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); Sy ... more >
getFolder (String folderId)
Returns an Exchange folder identified by the specified ID or null if the folder is not found.
getInboxFolder ()
Returns the user's Inbox folder containing received messages. This method returns the same result as: getFolder(FolderType.Inbox);
getItem (String itemId)
Returns an Exchange item identified by the specified ID or null if the item is not found.
getNotesFolder ()
Returns the user's Notes folder. This method returns the same result as: getFolder(FolderType.Notes);
getRootFolder (String folderPath)
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 me ... more >
getRootFolder ()
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);
getRootFolders ()
Returns a collection containing the root folder's sub-folders. This method returns the same result as: getFolder(FolderType.Root).getFolders();
getSentItemsFolder ()
Returns the user's Sent items folder. This method returns the same result as: getFolder(FolderType.SentItems);
getTasksFolder ()
Returns the user's Tasks folder. This method returns the same result as: getFolder(FolderType.Tasks);
getTopFolder (String folderPath)
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. Th ... more >
getTopFolder ()
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);
getTopFolders ()
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();
getUserOutOfOfficeSettings (String mailboxEmailAddress)
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.
getUsersAvailability (java.util.Date startDate, java.util.Date endDate)
Returns information on users and rooms availability between the specified dates. This method is only available in the Professional edition of the library.
getUsersAvailability (java.util.Date startDate, java.util.Date endDate, int freeBusyIntervalInMinutes)
Returns information on users and rooms availability between the specified dates. This method is only available in the Professional edition of the library.
void
removeNewMailListener (ExchangeNewMailListener listener)
Removes a listener. This method is only available in the Professional edition of the library.
void
removeNotificationSubscription (String subscriptionId)
Removes the specified notification subscription. Notification events will no longer be received by the associated listener. The subscription ID is returned by the method com.moyosoft.exchange.util.ExchangeNotificationWatermark#getSubscriptionId(). This method is only available in t ... more >
Iterable
resolveNames (String unresolved)
Resolves the specified name to a list of mailboxes. This method is only available in the Professional edition of the library.
Iterable
resolveNames (String unresolved, boolean includeContactData)
Resolves the specified name to a list of mailboxes. This method is only available in the Professional edition of the library.
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.
void
setImpersonationUsingPrimarySmtpAddress (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 o ... more >
void
setImpersonationUsingSecurityIdentifier (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.
void
setImpersonationUsingUserPricipalName (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.
void
setTimeZone (java.util.TimeZone timeZone)
void
stopNotifications ()
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.

Community comments



Powered by JavaDocPlus