Compoze Software, Inc.

com.compoze.exchange.webdav
Class Session


java.lang.Object

  |

  +--com.compoze.exchange.webdav.Session

All Implemented Interfaces:
java.io.Serializable

public class Session
extends java.lang.Object
implements java.io.Serializable

This class provides a wrapper around a session to Microsoft Exchange, and is the entry point into the WebDAV API. It is designed to access the Microsoft Exchange Store via the WebDAV protocol.

Below is an example of how to start using this API:

  Properties connectionProps = new Properties();
  connectionProps.setProperty(Session.PROP_EXCHANGE_SERVER, "my_exchange_server");
  connectionProps.setProperty(Session.PROP_EXCHANGE_MAILBOX, "my_exchange_mailbox");
  connectionProps.setProperty(Session.PROP_USER_DOMAIN, "my_domain");
  connectionProps.setProperty(Session.PROP_USER_USERNAME, "my_username");
  connectionProps.setProperty(Session.PROP_USER_PASSWORD, "my_password");

  Session exchangeSession = new Session(connectionProps);
  Mailbox mailbox = exchangeSession.serverGetMailbox();
 

The example constructs a Session object using the specifed connection propteries. The first property Session.PROP_EXCHANGE_SERVER, is the host name or IP address of the server where Exchange Server is installed. The properties: Session.PROP_USER_DOMAIN, Session.PROP_USER_USERNAME, Session.PROP_USER_PASSWORD, are the credentials used to log in the user.

The property, Session.PROP_EXCHANGE_MAILBOX, represensts the alias of the mailbox the user wants to log into. In most Exchange configurations, the mailbox alias is the same as the user's username, allowing the user to specify the username as the mailbox alias. In a few others (probably the minority), this is not the case, and a look up against Active Directory is required to retrieve the mailbox alias. In order to perform the lookup, the following properties must be set:

Two authentication protocols, Basic and NTLM, are supported to authenticate with Microsoft Exchange Server. Basic authentication is the original and most compatible authentication scheme, but is also the least secure. NTLM authentication is a proprietary protocol designed by Microsoft. It authenticates a connection rather than a request, so authentication must happen every time a new connection is made. It is also more secure than Basic in that it simulates a challenge/response scheme.

Basic authentication is the default authentication used to authenticate with Exchange Server. To change the authentication protocol used, "Basic" or "NTLM", set the property Session.PROP_AUTHENICATION_PROTOCOL.

To connect to Exchange Server using SSL, set the following properties (also see Harmony Developers guide for SSL setup):

  connectionProps.setProperty(Session.PROP_EXCHANGE_PROTOCOL, "https");
  connectionProps.setProperty(Session.PROP_EXCHANGE_PORT, "443");
 

See Also:
Serialized Form

Field Summary
static java.lang.String PROP_AD_LOOKUP
          Property used to store the the flag to determine to perform a lookup against Active Directory for the mailbox alias.
static java.lang.String PROP_AD_PORT
          Property used to store the port number for communicating with the domain controller.
static java.lang.String PROP_AD_PROTOCOL
          Property used to store the protocol for communicating with the domain controller.
static java.lang.String PROP_AUTHENICATION_PROTOCOL
          Property used to store the authentication protocol to login to Exchange server.
static java.lang.String PROP_DOMAIN_CONTROLLER
          Property used to store the domain controller host name or IP address.
static java.lang.String PROP_EXCHANGE_MAILBOX
          Property used to store the Exchange server login mailbox.
static java.lang.String PROP_EXCHANGE_MAILBOX_CONTEXT
          Property used to store the Exchange server mailbox context (the mailbox will be accessed with a URL like http://server/context/mailbox).
static java.lang.String PROP_EXCHANGE_PORT
          Property used to store the port number for communicating with the Exchange server.
static java.lang.String PROP_EXCHANGE_PROTOCOL
          Property used to store the protocol for communicating with the Exchange server.
static java.lang.String PROP_EXCHANGE_SERVER
          Property used to store the Exchange server host name or IP address.
static java.lang.String PROP_POOL_PARSER_FACTORIES
          Property used to store the the flag to determine to pool parser factories.
static java.lang.String PROP_POOL_PARSERS
          Property used to store the the flag to determine to pool parsers.
static java.lang.String PROP_PROXY_HOST
           
static java.lang.String PROP_PROXY_PASSWORD
           
static java.lang.String PROP_PROXY_PORT
           
static java.lang.String PROP_PROXY_PROTOCOL
           
static java.lang.String PROP_PROXY_USER
          Properties used to connect through a proxy server
static java.lang.String PROP_SAX_PARSER_FACTORY
          Property used to store the name of the class used to create new XML parsers.
static java.lang.String PROP_USER_DOMAIN
          Property used to store the user's domain.
static java.lang.String PROP_USER_PASSWORD
          Property used to store the user's password.
static java.lang.String PROP_USER_USERNAME
          Property used to store the user's username.
 
Constructor Summary
Session(java.util.Properties connectionProps)
          Constructor.
 
Method Summary
 void close()
          Close the session to the Exchange server and release any resources held by the session.
 ActiveDirectorySession getActiveDirectorySession()
          Gets the Active Directory session.
 ActiveDirectorySession getActiveDirectorySession(java.lang.String sHostURL)
          Gets the Active Directory session.
 ActiveDirectorySession getActiveDirectorySession(java.lang.String sHostURL, java.lang.String sUsername, java.lang.String sPassword)
          Gets the Active Directory session.
 Appointment getAppointment(UniqueID uniqueID)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetAppointment(UniqueID)
 Appointment getAppointment(UniqueID uniqueID, boolean bOpenSeries)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetAppointment(UniqueID, boolean)
 Appointment getAppointment(UniqueID uniqueID, java.util.List properties, boolean bOpenSeries)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetAppointment(UniqueID, List, boolean)
 CalendarFolder getCalendarFolder()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetCalendarFolder()
 Contact getContact(UniqueID uniqueID)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContact(UniqueID)
 Contact getContact(UniqueID uniqueID, java.util.List properties)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContact(UniqueID, List)
 ContactFolder getContactsFolder()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContactsFolder()
 Folder getDefaultPublicFolder()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetDefaultPublicFolder()
 Folder getDeletedItemsFolder()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetDeletedItemsFolder()
 MailFolder getDraftsFolder()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetDraftsFolder()
 java.lang.String getExchangeServer()
          Gets the Exchange server for the session.
 Folder getFolder(UniqueID uniqueID)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetFolder(UniqueID)
 Folder getFolder(UniqueID uniqueID, java.util.List properties)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetFolder(UniqueID, List)
 MailFolder getInboxFolder()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetInboxFolder()
 IItem getItem(UniqueID uniqueID)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetItem(UniqueID)
 IItem getItem(UniqueID uniqueID, java.util.List properties)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetItem(UniqueID, List)
 JournalFolder getJournalFolder()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetJournalFolder()
 Mailbox getMailbox()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetMailbox()
 Mailbox getMailbox(java.lang.String sMailbox)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetMailbox() DO NOT USE!!!
 Message getMessage(UniqueID uniqueID)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetMessage(UniqueID)
 Message getMessage(UniqueID uniqueID, java.util.List properties)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetMessage(UniqueID, List)
 NoteFolder getNotesFolder()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetNotesFolder()
 Folder getOutboxFolder()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetOutboxFolder()
 Folder getPublicFolder(java.lang.String sPathname)
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetPublicFolder(String, List)
 Folder getSentItemsFolder()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetSentItemsFolder()
static Session getSession(java.lang.String sServerURL, java.lang.String sUsername, java.lang.String sPassword)
          Gets the session connecting to the Exchange Store over WebDAV protocol.
static Session getSession(java.net.URL serverURL, java.lang.String sUsername, java.lang.String sPassword)
          Gets the session connecting to the Exchange Store over WebDAV protocol.
 TaskFolder getTasksFolder()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetTasksFolder()
 java.util.TimeZone getTimeZone()
          Get the timezone for the current session
 java.lang.String getUserAlias()
          Gets the user alias for the session.
 java.lang.String getUserDomain()
          Gets the user domain for the session.
 User getUserInfo()
          Gets the user information of the person who logged into this session.
 User getUserInfo(java.lang.String sHostURL)
          Gets the user information of the person who logged into this session.
 Mailbox getUserMailbox()
          Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetMailbox()
 java.lang.String getUserUsername()
          Gets the user username for the session.
 boolean isServerExchange()
          Determine if the server supplied by the PROP_EXCHANGE_SERVER is a WebDAV Exchange 2000 or 2003 server.
 void serverDeleteItems(java.lang.String sSource, java.lang.String[] subItems)
          Requests the server to delete one or more items, either folders, messages, or both, from specified folder.
 void serverDeleteItems(java.lang.String sSource, java.lang.String[] subItems, boolean bDeletedItems)
          Requests the server to delete one or more items, either folders, messages, or both, from specified folder.
 Appointment serverGetAppointment(UniqueID uniqueID)
          Queries the server for the message with the specified unique ID.
 Appointment serverGetAppointment(UniqueID uniqueID, boolean bOpenSeries)
          Queries the server for the message with the specified unique ID.
 Appointment serverGetAppointment(UniqueID uniqueID, java.util.List properties, boolean bOpenSeries)
          Queries the server for the message with the specified unique ID.
 Appointment[] serverGetAppointments(UniqueID[] uniqueIDs, java.util.Date instanceDate, java.util.List properties)
          Queries the server for appointment instances based on the IDs of master appointments
 CalendarFolder serverGetCalendarFolder()
          Queries the server for the user's "Calendar" folder.
 CalendarFolder serverGetCalendarFolder(java.util.List properties)
          Queries the server for the user's "Calendar" folder.
 Contact serverGetContact(UniqueID uniqueID)
          Queries the server for the contact with the specified unique ID.
 Contact serverGetContact(UniqueID uniqueID, java.util.List properties)
          Queries the server for the contact with the specified unique ID.
 ContactFolder serverGetContactsFolder()
          Queries the server for the user's "Contacts" folder.
 ContactFolder serverGetContactsFolder(java.util.List properties)
          Queries the server for the user's "Contacts" folder.
 Folder serverGetDefaultPublicFolder()
          Queries the server for the default MAPI folder (/public) installed by Exchange.
 Folder serverGetDefaultPublicFolder(java.util.List properties)
          Queries the server for the default MAPI folder (/public) installed by Exchange.
 Folder serverGetDeletedItemsFolder()
          Queries the server for the user's "Deleted Items" folder.
 Folder serverGetDeletedItemsFolder(java.util.List properties)
          Queries the server for the user's "Deleted Items" folder.
 MailFolder serverGetDraftsFolder()
          Queries the server for the user's "Drafts" folder.
 MailFolder serverGetDraftsFolder(java.util.List properties)
          Queries the server for the user's "Drafts" folder.
 Folder serverGetFolder(UniqueID uniqueID)
          Queries the server for the folder with the specified unique ID.
 Folder serverGetFolder(UniqueID uniqueID, java.util.List properties)
          Queries the server for the folder with the specified unique ID.
 FreeBusy[] serverGetFreeBusy(java.util.List listAttendees, java.util.Date startDate, java.util.Date endDate, int iInterval)
          Queries the server for free busy information for each of the specified attendees
 MailFolder serverGetInboxFolder()
          Queries the server for the user's "Inbox" folder.
 MailFolder serverGetInboxFolder(java.util.List properties)
          Queries the server for the user's "Inbox" folder.
 IItem serverGetItem(UniqueID uniqueID)
          Queries the server for the item with the specified unique ID.
 IItem serverGetItem(UniqueID uniqueID, java.util.List properties)
          Queries the server for the item with the specified unique ID.
 JournalFolder serverGetJournalFolder()
          Gets the user's "Journal" folder.
 JournalFolder serverGetJournalFolder(java.util.List properties)
          Gets the user's "Journal" folder.
 Mailbox serverGetMailbox()
          Gets the mailbox currently logged into.
 Message serverGetMessage(UniqueID uniqueID)
          Queries the server for the message with the specified unique ID.
 Message serverGetMessage(UniqueID uniqueID, java.util.List properties)
          Queries the server for the message with the specified unique ID.
 NoteFolder serverGetNotesFolder()
          Queries the server for the user's "Notes" folder.
 NoteFolder serverGetNotesFolder(java.util.List properties)
          Queries the server for the user's "Notes" folder.
 Folder serverGetOutboxFolder()
          Queries the server for the user's "Outbox" folder.
 Folder serverGetOutboxFolder(java.util.List properties)
          Queries the server for the user's "Outbox" folder.
 Folder serverGetPublicFolder(java.lang.String sPathname, java.util.List properties)
          Queries the server for the speicifed public folder.
 Folder serverGetSentItemsFolder()
          Queries the server for the user's "Sent Items" folder.
 Folder serverGetSentItemsFolder(java.util.List properties)
          Queries the server for the user's "Sent Items" folder.
 Task serverGetTask(UniqueID uniqueID)
          Queries the server for the task with the specified unique ID.
 Task serverGetTask(UniqueID uniqueID, java.util.List properties)
          Queries the server for the task with the specified unique ID.
 TaskFolder serverGetTasksFolder()
          Queries the server for the user's "Tasks" folder.
 TaskFolder serverGetTasksFolder(java.util.List properties)
          Queries the server for the user's "Tasks" folder.
 ResultSet serverSearch(java.lang.String sSource, java.lang.String[] properties, IFilter filter, SortOrder order, RowRange range)
          Queries the Exchange store.
 ResultSet serverSearch(java.lang.String sSource, java.lang.String[] properties, int iScope, IFilter filter, SortOrder order, RowRange range)
          Queries the Exchange store.
 ResultSet serverSearch(java.lang.String sSource, java.lang.String[] properties, java.lang.String[] subSources, IFilter filter, SortOrder order, RowRange range)
          Queries the Exchange store.
 ResultSet serverSearch(java.lang.String sSource, java.lang.String[] properties, java.lang.String[] subSources, int iScope, IFilter filter, SortOrder order, RowRange range)
          Queries the Exchange store.
 ResultSet serverSearch(java.lang.String sSource, java.lang.String sSQL, RowRange range)
          Queries the Exchange store.
 void setTimeZone(java.util.TimeZone timeZone)
          Set the timezone for the current session
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_EXCHANGE_SERVER


public static final java.lang.String PROP_EXCHANGE_SERVER
Property used to store the Exchange server host name or IP address.

PROP_EXCHANGE_PROTOCOL


public static final java.lang.String PROP_EXCHANGE_PROTOCOL
Property used to store the protocol for communicating with the Exchange server.

PROP_EXCHANGE_PORT


public static final java.lang.String PROP_EXCHANGE_PORT
Property used to store the port number for communicating with the Exchange server.

PROP_EXCHANGE_MAILBOX


public static final java.lang.String PROP_EXCHANGE_MAILBOX
Property used to store the Exchange server login mailbox.

PROP_EXCHANGE_MAILBOX_CONTEXT


public static final java.lang.String PROP_EXCHANGE_MAILBOX_CONTEXT
Property used to store the Exchange server mailbox context (the mailbox will be accessed with a URL like http://server/context/mailbox).

PROP_USER_DOMAIN


public static final java.lang.String PROP_USER_DOMAIN
Property used to store the user's domain.

PROP_USER_USERNAME


public static final java.lang.String PROP_USER_USERNAME
Property used to store the user's username.

PROP_USER_PASSWORD


public static final java.lang.String PROP_USER_PASSWORD
Property used to store the user's password.

PROP_DOMAIN_CONTROLLER


public static final java.lang.String PROP_DOMAIN_CONTROLLER
Property used to store the domain controller host name or IP address.

PROP_AD_PROTOCOL


public static final java.lang.String PROP_AD_PROTOCOL
Property used to store the protocol for communicating with the domain controller.

PROP_AD_PORT


public static final java.lang.String PROP_AD_PORT
Property used to store the port number for communicating with the domain controller.

PROP_AD_LOOKUP


public static final java.lang.String PROP_AD_LOOKUP
Property used to store the the flag to determine to perform a lookup against Active Directory for the mailbox alias.

PROP_AUTHENICATION_PROTOCOL


public static final java.lang.String PROP_AUTHENICATION_PROTOCOL
Property used to store the authentication protocol to login to Exchange server.

PROP_SAX_PARSER_FACTORY


public static final java.lang.String PROP_SAX_PARSER_FACTORY
Property used to store the name of the class used to create new XML parsers.

PROP_POOL_PARSERS


public static final java.lang.String PROP_POOL_PARSERS
Property used to store the the flag to determine to pool parsers.

PROP_POOL_PARSER_FACTORIES


public static final java.lang.String PROP_POOL_PARSER_FACTORIES
Property used to store the the flag to determine to pool parser factories.

PROP_PROXY_USER


public static final java.lang.String PROP_PROXY_USER
Properties used to connect through a proxy server

PROP_PROXY_PASSWORD


public static final java.lang.String PROP_PROXY_PASSWORD

PROP_PROXY_HOST


public static final java.lang.String PROP_PROXY_HOST

PROP_PROXY_PORT


public static final java.lang.String PROP_PROXY_PORT

PROP_PROXY_PROTOCOL


public static final java.lang.String PROP_PROXY_PROTOCOL
Constructor Detail

Session


public Session(java.util.Properties connectionProps)
        throws ExchangeException
Constructor.

The following table contains the properties used to establish a session with Exchange Server:

Property name Java constant Required Details
user.domain PROP_USER_DOMAIN No The domain name the user logs into.
user.username PROP_USER_USERNAME Yes The user's username.
user.password PROP_USER_PASSWORD Yes The user's password.
exchange.mailbox PROP_EXCHANGE_MAILBOX Yes The name of the mailbox to log into (the username may be used)
exchange.mailbox.context PROP_EXCHANGE_MAILBOX_CONTEXT No (default /exchange) The web context of the mailbox such that the URL ends up being protocol://server/context/mailbox.
exchange.server PROP_EXCHANGE_SERVER Yes The host name or IP address of the server where Exchange Server is installed.
exchange.protocol PROP_EXCHANGE_PROTOCOL No The protocol in which to communicate with Exchange Server.
If not specified, the protocol "http" is used.
exchange.port PROP_EXCHANGE_PORT No The port in which to communicate with Exchange Server.
If not specified, the port 80 is used.
domain.controller PROP_DOMAIN_CONTROLLER Yes The host name or IP address of the server acting as the domain controller.
active_directory.protocol PROP_AD_PROTOCOL No The protocol in which to communicate with the domain controller.
If not specified, the protocol "ldap" is used.
active_directory.port PROP_AD_PORT No The port in which to communicate with the domain controller.
If not specified, the port 389 is used.
active_directory.lookup PROP_AD_LOOKUP No Determines if a lookup agaist Active Directory for the mailbox alias is performed. By default, set to false.
authentication.protocol PROP_AUTHENICATION_PROTOCOL No The protocol used to authenticate with Exchange Server.
If not specified, Basic authentication is used.
sax.parser.factory PROP_SAX_PARSER_FACTORY No Sets the class to use to create new XML parsers (must be an instance of com.compoze.xml.parsers.SAXParserFactory). If left unset, then the default, com.compoze.piccolo.xml.JAXSAXParserFactory, is used.
pool.parsers PROP_POOL_PARSERS No If set (true), then pool instances of the SAX parser and re-use them. If parsers are pooled then parser factories are also pooled. If you are experiencing exceptions related to SAX parsers being used concurrently (
happens in some VM combinations) then set this to false. By default, set to true.
pool.parser.factories PROP_POOL_PARSER_FACTORIES No If set (true), then pool instances of the SAX parser factories and re-use them.
If not set (true), then both parsers and parser factories are not pooled.
CAUTION: Instantiating parser factories is an expensive operation so only disable this if absolutely necessary. By default, set to true.

Parameters:
connectionProps - properties used for establishing a session with Exchange Server
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
Method Detail

getSession


public static Session getSession(java.net.URL serverURL,
                                 java.lang.String sUsername,
                                 java.lang.String sPassword)
                          throws ExchangeException
Gets the session connecting to the Exchange Store over WebDAV protocol.
Parameters:
serverURL - the URL to the Microsoft Exchange server
sUsername - the username
sPassword - the password
Returns:
the Exchange Store session
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server

getSession


public static Session getSession(java.lang.String sServerURL,
                                 java.lang.String sUsername,
                                 java.lang.String sPassword)
                          throws ExchangeException,
                                 java.net.MalformedURLException
Gets the session connecting to the Exchange Store over WebDAV protocol.
Parameters:
sServerURL - the URL to the Microsoft Exchange server
sUsername - the username
sPassword - the password
Returns:
the Exchange Store session
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server

close


public void close()
Close the session to the Exchange server and release any resources held by the session.

getActiveDirectorySession


public ActiveDirectorySession getActiveDirectorySession()
                                                 throws ActiveDirectoryException
Gets the Active Directory session.
Throws:
ActiveDirectoryException - if a problem occurred while interacting with Active Directory
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
ActiveDirectorySession

getActiveDirectorySession


public ActiveDirectorySession getActiveDirectorySession(java.lang.String sHostURL)
                                                 throws ActiveDirectoryException
Gets the Active Directory session.
Throws:
ActiveDirectoryException - if a problem occurred while interacting with Active Directory
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
ActiveDirectorySession

getActiveDirectorySession


public ActiveDirectorySession getActiveDirectorySession(java.lang.String sHostURL,
                                                        java.lang.String sUsername,
                                                        java.lang.String sPassword)
                                                 throws ActiveDirectoryException
Gets the Active Directory session.
Parameters:
sHostURL - the host URL of the domain controller.
sUsername - the username.
sPassword - the password.
Throws:
ActiveDirectoryException - if a problem occurred while interacting with Active Directory
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
ActiveDirectorySession

getUserInfo


public User getUserInfo()
                 throws ActiveDirectoryException
Gets the user information of the person who logged into this session.

See getActiveDirectorySession() for further information.

Returns:
the user information.
Throws:
ActiveDirectoryException - if a problem occurred while interacting with Active Directory
ExchangeRuntimeException - if this object has been released and can no longer be used

getUserInfo


public User getUserInfo(java.lang.String sHostURL)
                 throws ActiveDirectoryException
Gets the user information of the person who logged into this session.
Parameters:
sHostURL - the host URL of the domain controller.
Returns:
the user information.
Throws:
ActiveDirectoryException - if a problem occurred while interacting with Active Directory
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
getActiveDirectorySession(String, String, String)

getExchangeServer


public java.lang.String getExchangeServer()
Gets the Exchange server for the session.
Returns:
the server
See Also:
PROP_EXCHANGE_SERVER

getUserDomain


public java.lang.String getUserDomain()
Gets the user domain for the session.
Returns:
the user domain
See Also:
PROP_USER_DOMAIN

getUserUsername


public java.lang.String getUserUsername()
Gets the user username for the session.
Returns:
the user username
See Also:
PROP_USER_USERNAME

serverGetMailbox


public Mailbox serverGetMailbox()
                         throws ExchangeException
Gets the mailbox currently logged into.
Returns:
the mailbox currently logged into.
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used

getUserMailbox


public Mailbox getUserMailbox()
                       throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetMailbox()

Gets the default mailbox of the user. A call to Active Directory is made to retrieve the alias of the mailbox.
Returns:
the user's mailbox
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used

getMailbox


public Mailbox getMailbox()
                   throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetMailbox()

Gets the mailbox currently logged into. By default, if no mailbox has been specified (via {&link #getMailbox(String)}), the user mailbox is returned.
Returns:
the mailbox currently logged into.
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used

getMailbox


public Mailbox getMailbox(java.lang.String sMailbox)
                   throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetMailbox() DO NOT USE!!!

Gets the specified mailbox to log into. This methods allows a user to log into other mailboxes, given the user has permissions to do so. Examples of valid mailbox names are:
Returns:
the mailbox to log into.
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used

getCalendarFolder


public CalendarFolder getCalendarFolder()
                                 throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetCalendarFolder()

Gets the user's "Calendar" folder.

Calling this method is the same as calling Mailbox.getCalendarFolder()

Returns:
the "Calendar" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.getCalendarFolder()

serverGetCalendarFolder


public CalendarFolder serverGetCalendarFolder()
                                       throws ExchangeException
Queries the server for the user's "Calendar" folder.

This method queries the server only if this nor serverGetCalendarFolder(List) were previously called, requesting the following properties:

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Calendar" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetCalendarFolder()

serverGetCalendarFolder


public CalendarFolder serverGetCalendarFolder(java.util.List properties)
                                       throws ExchangeException
Queries the server for the user's "Calendar" folder.

Use this method to request specific properties or refresh the properties pertaining to the "Calendar" folder.

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Calendar" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetCalendarFolder(List)

getContactsFolder


public ContactFolder getContactsFolder()
                                throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContactsFolder()

Gets the user's "Contacts" folder.

Calling this method is the same as calling Mailbox.getContactsFolder()

Returns:
the "Contacts" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.getContactsFolder()

serverGetContactsFolder


public ContactFolder serverGetContactsFolder()
                                      throws ExchangeException
Queries the server for the user's "Contacts" folder.

This method queries the server only if this nor serverGetContactsFolder(List) were previously called, requesting the following properties:

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Contacts" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetContactsFolder()

serverGetContactsFolder


public ContactFolder serverGetContactsFolder(java.util.List properties)
                                      throws ExchangeException
Queries the server for the user's "Contacts" folder.

Use this method to request specific properties or refresh the properties pertaining to the "Contacts" folder.

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Contacts" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetContactsFolder(List)

getDraftsFolder


public MailFolder getDraftsFolder()
                           throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetDraftsFolder()

Gets the user's "Drafts" folder.

Calling this method is the same as calling Mailbox.getDraftsFolder()

Returns:
the "Drafts" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.getDraftsFolder()

serverGetDraftsFolder


public MailFolder serverGetDraftsFolder()
                                 throws ExchangeException
Queries the server for the user's "Drafts" folder.

This method queries the server only if this nor serverGetDraftsFolder(List) were previously called, requesting the following properties:

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Drafts" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetDraftsFolder()

serverGetDraftsFolder


public MailFolder serverGetDraftsFolder(java.util.List properties)
                                 throws ExchangeException
Queries the server for the user's "Drafts" folder.

Use this method to request specific properties or refresh the properties pertaining to the "Drafts" folder.

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Drafts" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetDraftsFolder(List)

getDeletedItemsFolder


public Folder getDeletedItemsFolder()
                             throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetDeletedItemsFolder()

Gets the user's "Deleted Items" folder.

Calling this method is the same as calling Mailbox.getDeletedItems()

Returns:
the "Deleted Items" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.getDeletedItems()

serverGetDeletedItemsFolder


public Folder serverGetDeletedItemsFolder()
                                   throws ExchangeException
Queries the server for the user's "Deleted Items" folder.

This method queries the server only if this nor serverGetDeletedItemsFolder(List) were previously called, requesting the following properties:

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Deleted Items" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetDeletedItemsFolder()

serverGetDeletedItemsFolder


public Folder serverGetDeletedItemsFolder(java.util.List properties)
                                   throws ExchangeException
Queries the server for the user's "Deleted Items" folder.

Use this method to request specific properties or refresh the properties pertaining to the "Deleted Items" folder.

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Deleted Items" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetDeletedItemsFolder(List)

getInboxFolder


public MailFolder getInboxFolder()
                          throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetInboxFolder()

Gets the user's "Inbox" folder.

Calling this method is the same as calling Mailbox.getInbox()

Returns:
the "Inbox" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.getInbox()

serverGetInboxFolder


public MailFolder serverGetInboxFolder()
                                throws ExchangeException
Queries the server for the user's "Inbox" folder.

This method queries the server only if this nor serverGetInboxFolder(List) were previously called, requesting the following properties:

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Inbox" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetInboxFolder()

serverGetInboxFolder


public MailFolder serverGetInboxFolder(java.util.List properties)
                                throws ExchangeException
Queries the server for the user's "Inbox" folder.

Use this method to request specific properties or refresh the properties pertaining to the "Inbox" folder.

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Inbox" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetInboxFolder(List)

getJournalFolder


public JournalFolder getJournalFolder()
                               throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetJournalFolder()

Gets the user's "Journal" folder.

Calling this method is the same as calling Mailbox.getJournalFolder()

Returns:
the "Journal" folder or null if folder does not exist.
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.getJournalFolder()

serverGetJournalFolder


public JournalFolder serverGetJournalFolder()
                                     throws ExchangeException
Gets the user's "Journal" folder.

This method queries the server only if this nor serverGetJournalFolder(List) were previously called, requesting the following properties:

Returns:
the "Journal" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetJournalFolder()

serverGetJournalFolder


public JournalFolder serverGetJournalFolder(java.util.List properties)
                                     throws ExchangeException
Gets the user's "Journal" folder.

This method queries the server only if this nor serverGetJournalFolder(List) were previously called, requesting the following properties:

Returns:
the "Journal" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetJournalFolder(List)

getNotesFolder


public NoteFolder getNotesFolder()
                          throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetNotesFolder()

Gets the user's "Notes" folder.

Calling this method is the same as calling Mailbox.getNotesFolder()

Returns:
the "Notes" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.getNotesFolder()

serverGetNotesFolder


public NoteFolder serverGetNotesFolder()
                                throws ExchangeException
Queries the server for the user's "Notes" folder.

This method queries the server only if this nor serverGetNotesFolder(List) were previously called, requesting the following properties:

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Notes" folder or null if folder does not exist.
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetNotesFolder()

serverGetNotesFolder


public NoteFolder serverGetNotesFolder(java.util.List properties)
                                throws ExchangeException
Queries the server for the user's "Notes" folder.

Use this method to request specific properties or refresh the properties pertaining to the "Notes" folder.

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Notes" folder or null if folder does not exist.
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetNotesFolder(List)

getOutboxFolder


public Folder getOutboxFolder()
                       throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetOutboxFolder()

Gets the user's "Outbox" folder.

Calling this method is the same as calling Mailbox.getOutboxFolder()

Returns:
the "Outbox" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.getOutboxFolder()

serverGetOutboxFolder


public Folder serverGetOutboxFolder()
                             throws ExchangeException
Queries the server for the user's "Outbox" folder.

This method queries the server only if this nor serverGetOutboxFolder(List) were previously called, requesting the following properties:

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Outbox" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetOutboxFolder()

serverGetOutboxFolder


public Folder serverGetOutboxFolder(java.util.List properties)
                             throws ExchangeException
Queries the server for the user's "Outbox" folder.

Use this method to request specific properties or refresh the properties pertaining to the "Outbox" folder.

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Outbox" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetOutboxFolder(List)

getSentItemsFolder


public Folder getSentItemsFolder()
                          throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetSentItemsFolder()

Gets the user's "Sent Items" folder.

Calling this method is the same as calling Mailbox.getSentItems()

Returns:
the "Sent Items" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.getSentItems()

serverGetSentItemsFolder


public Folder serverGetSentItemsFolder()
                                throws ExchangeException
Queries the server for the user's "Sent Items" folder.

This method queries the server only if this nor serverGetSentItemsFolder(List) were previously called, requesting the following properties:

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Sent Items" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetSentItemsFolder()

serverGetSentItemsFolder


public Folder serverGetSentItemsFolder(java.util.List properties)
                                throws ExchangeException
Queries the server for the user's "Sent Items" folder.

Use this method to request specific properties or refresh the properties pertaining to the "Sent Items" folder.

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Sent Items" folder or null if folder does not exist
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetSentItemsFolder(List)

getTasksFolder


public TaskFolder getTasksFolder()
                          throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetTasksFolder()

Gets the user's "Tasks" folder.

Calling this method is the same as calling Mailbox.getTasksFolder()

Returns:
the "Tasks" folder or null if folder does not exist.
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.getTasksFolder()

serverGetTasksFolder


public TaskFolder serverGetTasksFolder()
                                throws ExchangeException
Queries the server for the user's "Tasks" folder.

This method queries the server only if this nor serverGetTasksFolder(List) were previously called, requesting the following properties:

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Tasks" folder or null if folder does not exist.
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetTasksFolder()

serverGetTasksFolder


public TaskFolder serverGetTasksFolder(java.util.List properties)
                                throws ExchangeException
Queries the server for the user's "Tasks" folder.

Use this method to request specific properties or refresh the properties pertaining to the "Tasks" folder.

Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the "Tasks" folder or null if folder does not exist.
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Mailbox.serverGetTasksFolder(List)

getDefaultPublicFolder


public Folder getDefaultPublicFolder()
                              throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetDefaultPublicFolder()

Gets the default MAPI folder (/public) installed by Exchange.
Returns:
the default MAPI folder
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used

serverGetDefaultPublicFolder


public Folder serverGetDefaultPublicFolder()
                                    throws ExchangeException
Queries the server for the default MAPI folder (/public) installed by Exchange.
Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the default MAPI folder
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used

serverGetDefaultPublicFolder


public Folder serverGetDefaultPublicFolder(java.util.List properties)
                                    throws ExchangeException
Queries the server for the default MAPI folder (/public) installed by Exchange.
Parameters:
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the default MAPI folder
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used

getPublicFolder


public Folder getPublicFolder(java.lang.String sPathname)
                       throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetPublicFolder(String, List)

Gets the specified public folder.
Parameters:
sPathname - path of the public folder
Returns:
the public folder
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used

serverGetPublicFolder


public Folder serverGetPublicFolder(java.lang.String sPathname,
                                    java.util.List properties)
                             throws ExchangeException
Queries the server for the speicifed public folder.
Parameters:
sPathname - path of the public folder
properties - list of AbstractProperty objects representing Exchange WebDAV properties to query from the Exchange store (must not be null)
Returns:
the public folder
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used

getFolder


public Folder getFolder(UniqueID uniqueID)
                 throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetFolder(UniqueID)

Gets a folder with the specified unique ID.
A list of selected properties Folder.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use getFolder(UniqueID, List).
Parameters:
uniqueID - the id of the folder to search for
Returns:
the folder or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Folder.getDefaultProperties()

serverGetFolder


public Folder serverGetFolder(UniqueID uniqueID)
                       throws ExchangeException
Queries the server for the folder with the specified unique ID.
A list of selected properties Folder.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use serverGetFolder(UniqueID, List).
Parameters:
uniqueID - the id of the folder to search for
Returns:
the folder or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Folder.getDefaultProperties()

getFolder


public Folder getFolder(UniqueID uniqueID,
                        java.util.List properties)
                 throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetFolder(UniqueID, List)

Gets a folder with the specified unique ID.
Parameters:
uniqueID - the id of the folder to search for
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
Returns:
the folder or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified
See Also:
Folder.getDefaultProperties()

serverGetFolder


public Folder serverGetFolder(UniqueID uniqueID,
                              java.util.List properties)
                       throws ExchangeException
Queries the server for the folder with the specified unique ID.
Parameters:
uniqueID - the id of the folder to search for
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
Returns:
the folder or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified
See Also:
Folder.getDefaultProperties()

getContact


public Contact getContact(UniqueID uniqueID)
                   throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContact(UniqueID)

Gets a contact with the specified unique ID.
A list of selected properties Contact.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use getContact(UniqueID, List).
Parameters:
uniqueID - the id of the contact to search for
Returns:
the contact or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Contact.getDefaultProperties()

serverGetContact


public Contact serverGetContact(UniqueID uniqueID)
                         throws ExchangeException
Queries the server for the contact with the specified unique ID.
A list of selected properties Contact.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use serverGetContact(UniqueID, List).
Parameters:
uniqueID - the id of the contact to search for
Returns:
the contact or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Contact.getDefaultProperties()

getContact


public Contact getContact(UniqueID uniqueID,
                          java.util.List properties)
                   throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetContact(UniqueID, List)

Gets a contact with the specified unique ID.
Parameters:
uniqueID - the id of the contact to search for
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
Returns:
the contact or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified
See Also:
Contact.getDefaultProperties()

serverGetContact


public Contact serverGetContact(UniqueID uniqueID,
                                java.util.List properties)
                         throws ExchangeException
Queries the server for the contact with the specified unique ID.
Parameters:
uniqueID - the id of the contact to search for
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
Returns:
the contact or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified
See Also:
Contact.getDefaultProperties()

getAppointment


public Appointment getAppointment(UniqueID uniqueID)
                           throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetAppointment(UniqueID)

Get a single appointment occurrence with the specified unique ID.
A list of selected properties Appointment.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use getAppointment(UniqueID, List, boolean).
Parameters:
uniqueID - the id of the appointment to search for
Returns:
the appointment or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Appointment.getDefaultProperties()

serverGetAppointment


public Appointment serverGetAppointment(UniqueID uniqueID)
                                 throws ExchangeException
Queries the server for the message with the specified unique ID.

A list of selected properties Appointment.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use serverGetAppointment(UniqueID, List, boolean).

Parameters:
uniqueID - the id of the appointment to search for
Returns:
the appointment or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Appointment.getDefaultProperties()

getAppointment


public Appointment getAppointment(UniqueID uniqueID,
                                  boolean bOpenSeries)
                           throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetAppointment(UniqueID, boolean)

Get an appointment occurrence with the specified unique ID. If bOpenSeries is true, and the appointment is recurring, the master appointment is returned, otherwise a single appointment occurrence is returned.
A list of selected properties Appointment.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use getAppointment(UniqueID, List, boolean).
Parameters:
uniqueID - the id of the appointment to search for
bOpenSeries - true to open series of recurring appointments; false otherwise
Returns:
the appointment or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Appointment.getDefaultProperties()

serverGetAppointment


public Appointment serverGetAppointment(UniqueID uniqueID,
                                        boolean bOpenSeries)
                                 throws ExchangeException
Queries the server for the message with the specified unique ID.

If bOpenSeries is true, and the appointment is recurring, the master appointment is returned, otherwise a single appointment occurrence is returned.

A list of selected properties Appointment.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use serverGetAppointment(UniqueID, List, boolean).

Parameters:
uniqueID - the id of the appointment to search for
bOpenSeries - true to open series of recurring appointments; false otherwise
Returns:
the appointment or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Appointment.getDefaultProperties()

getAppointment


public Appointment getAppointment(UniqueID uniqueID,
                                  java.util.List properties,
                                  boolean bOpenSeries)
                           throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetAppointment(UniqueID, List, boolean)

Get an appointment occurrence with the specified unique ID. If bOpenSeries is true, and the appointment is recurring, the master appointment is returned, otherwise a single appointment occurrence is returned.
Parameters:
uniqueID - the id of the appointment to search for
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
bOpenSeries - true to open series of recurring appointments; false otherwise
Returns:
the appointment or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified
See Also:
Appointment.getDefaultProperties()

serverGetAppointment


public Appointment serverGetAppointment(UniqueID uniqueID,
                                        java.util.List properties,
                                        boolean bOpenSeries)
                                 throws ExchangeException
Queries the server for the message with the specified unique ID.

If bOpenSeries is true, and the appointment is recurring, the master appointment is returned, otherwise a single appointment occurrence is returned.

Parameters:
uniqueID - the id of the appointment to search for
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
bOpenSeries - true to open series of recurring appointments; false otherwise
Returns:
the appointment or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified
See Also:
Appointment.getDefaultProperties()

serverGetAppointments


public Appointment[] serverGetAppointments(UniqueID[] uniqueIDs,
                                           java.util.Date instanceDate,
                                           java.util.List properties)
                                    throws ExchangeException
Queries the server for appointment instances based on the IDs of master appointments
Parameters:
uniqueIDs - the IDs of the master recurring appointments to retrieve
instanceDate - the date on which the instances occur
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
Returns:
the appointments or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store

getMessage


public Message getMessage(UniqueID uniqueID)
                   throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetMessage(UniqueID)

Gets a message with the specified unique ID.
A list of selected properties Message.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use getMessage(UniqueID, List).
Parameters:
uniqueID - the id of the message to search for
Returns:
the message or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Message.getDefaultProperties()

serverGetMessage


public Message serverGetMessage(UniqueID uniqueID)
                         throws ExchangeException
Queries the server for the message with the specified unique ID.
A list of selected properties Message.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use serverGetMessage(UniqueID, List).
Parameters:
uniqueID - the id of the message to search for
Returns:
the message or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Message.getDefaultProperties()

getMessage


public Message getMessage(UniqueID uniqueID,
                          java.util.List properties)
                   throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetMessage(UniqueID, List)

Gets a message with the specified unique ID.
Parameters:
uniqueID - the id of the message to search for
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
Returns:
the message or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified
See Also:
Message.getDefaultProperties()

serverGetMessage


public Message serverGetMessage(UniqueID uniqueID,
                                java.util.List properties)
                         throws ExchangeException
Queries the server for the message with the specified unique ID.
Parameters:
uniqueID - the id of the message to search for
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
Returns:
the message or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified
See Also:
Message.getDefaultProperties()

getItem


public IItem getItem(UniqueID uniqueID)
              throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetItem(UniqueID)

Gets an item with the specified unique ID.
A list of selected properties AbstractItem.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use getItem(UniqueID, List).
Parameters:
uniqueID - the id of the item to search for
Returns:
an item or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
AbstractItem.getDefaultProperties()

serverGetItem


public IItem serverGetItem(UniqueID uniqueID)
                    throws ExchangeException
Queries the server for the item with the specified unique ID.
A list of selected properties AbstractItem.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use serverGetItem(UniqueID, List).
Parameters:
uniqueID - the id of the item to search for
Returns:
an item or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
AbstractItem.getDefaultProperties()

getItem


public IItem getItem(UniqueID uniqueID,
                     java.util.List properties)
              throws ExchangeException
Deprecated. This method has been deprecated and will be removed by version 3.1. Replaced with serverGetItem(UniqueID, List)

Gets an item with the specified unique ID.
Parameters:
uniqueID - the id of the item to search for
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
Returns:
an item or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified
See Also:
AbstractItem.getDefaultProperties()

serverGetItem


public IItem serverGetItem(UniqueID uniqueID,
                           java.util.List properties)
                    throws ExchangeException
Queries the server for the item with the specified unique ID.
Parameters:
uniqueID - the id of the item to search for
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
Returns:
an item or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified or the ID of the item is null
See Also:
AbstractItem.getDefaultProperties()

serverDeleteItems


public void serverDeleteItems(java.lang.String sSource,
                              java.lang.String[] subItems)
                       throws ExchangeException
Requests the server to delete one or more items, either folders, messages, or both, from specified folder.

The items are moved to the user's "Deleted Items" folder.

Parameters:
sSource - the URI of the source collection (must not be null)
subItems - an array of items, either folders, messages, or both, that are to be deleted

serverDeleteItems


public void serverDeleteItems(java.lang.String sSource,
                              java.lang.String[] subItems,
                              boolean bDeletedItems)
                       throws ExchangeException
Requests the server to delete one or more items, either folders, messages, or both, from specified folder.

The items are moved to the user's "Deleted Items" folder by specifying bDeletedItems = true, otherwise they are removed from the Exhange store.

Parameters:
sSource - the URI of the source collection (must not be null)
subItems - an array of items, either folders, messages, or both, that are to be deleted
bDeletedItems - if false, remove items from Exchange store

serverSearch


public ResultSet serverSearch(java.lang.String sSource,
                              java.lang.String[] properties,
                              IFilter filter,
                              SortOrder order,
                              RowRange range)
                       throws ExchangeException
Queries the Exchange store.
Parameters:
sSource - the URI of the source collection (must not be null)
properties - an array of properties to query for
filter - the conditions to search by
order - the order to sort by
range - the range of rows to return
Returns:
a set of results based from the query
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
serverSearch(String, String[], String[], int, IFilter, SortOrder, RowRange)

serverSearch


public ResultSet serverSearch(java.lang.String sSource,
                              java.lang.String[] properties,
                              int iScope,
                              IFilter filter,
                              SortOrder order,
                              RowRange range)
                       throws ExchangeException
Queries the Exchange store.
Parameters:
sSource - the URI of the source collection (must not be null)
properties - an array of properties to query for
iScope - the scope of the search
filter - the conditions to search by
order - the order to sort by
range - the range of rows to return
Returns:
a set of results based from the query
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
serverSearch(String, String[], String[], int, IFilter, SortOrder, RowRange), IScope

serverSearch


public ResultSet serverSearch(java.lang.String sSource,
                              java.lang.String[] properties,
                              java.lang.String[] subSources,
                              IFilter filter,
                              SortOrder order,
                              RowRange range)
                       throws ExchangeException
Queries the Exchange store.
Parameters:
sSource - the URI of the source collection (must not be null)
properties - an array of properties to query for
subSources - the URIs of sub source collections
filter - the conditions to search by
order - the order to sort by
range - the range of rows to return
Returns:
a set of results based from the query
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
serverSearch(String, String[], String[], int, IFilter, SortOrder, RowRange)

serverSearch


public ResultSet serverSearch(java.lang.String sSource,
                              java.lang.String[] properties,
                              java.lang.String[] subSources,
                              int iScope,
                              IFilter filter,
                              SortOrder order,
                              RowRange range)
                       throws ExchangeException
Queries the Exchange store.

The following example illustrates the use of search.

  com.compoze.exchange.webdav.filter.MessageFilter filter = new com.compoze.exchange.webdav.filter.MessageFilter();
  filter.setHasAttachment(true);

  ResultSet rs = session.search("/exchange/skip.ogrudnick/Inbox/", 
      new String[] 
	    {
	    "\"DAV:href\"",
 	    "\"DAV:displayname\"",
 	    "\"DAV:contentclass\"",
 	    "\"urn:schemas:httpmail:subject\""
	    }, 
 	new String[]
 	    {
 	    "\"/exchange/skip.ogrudnick/Inbox/\""
 	    "\"/exchange/skip.ogrudnick/Inbox/sub1/\""
 	    "\"/exchange/skip.ogrudnick/Inbox/sub2/\""
	    },
	    IScope.SHALLOW_TRAVERSAL,
	    filter,
	    SortOrder.create(HttpMailProperty.DATE_RECEIVED, SortOrder.DESCENDING),
	    new Range(10));

  while (rs.next())
      {
      System.out.println("urn:schemas:httpmail:subject = " + rs.getString("urn:schemas:httpmail:subject"));
	}
 
Parameters:
sSource - the URI of the source collection (must not be null)
properties - an array of properties to query for
subSources - the URIs of sub source collections
iScope - the scope of the search
filter - the conditions to search by
order - the order to sort by
range - the range of rows to return
Returns:
a set of results based from the query
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
serverSearch(String, String, RowRange), IScope

serverSearch


public ResultSet serverSearch(java.lang.String sSource,
                              java.lang.String sSQL,
                              RowRange range)
                       throws ExchangeException
Queries the Exchange store.

The following example illustrates the use of search.

  StringBuffer buffer = new StringBuffer(64);
  buffer.append("SELECT \"DAV:href\", \"DAV:displayname\", \"DAV:contentclass\", \"urn:schemas:httpmail:subject\" ");
  buffer.append("FROM scope('shallow traversal of \"/exchange/skip.ogrudnick/Inbox/\"') ");
  buffer.append("WHERE \"urn:schemas:httpmail:hasattachment" = true");

  ResultSet rs = session.search("/exchange/skip.ogrudnick/Inbox/", buffer.toString(), new Range(10));

  while (rs.next())
      {
      System.out.println("urn:schemas:httpmail:subject = " + rs.getString("urn:schemas:httpmail:subject"));
	}
 
Parameters:
sSQL - SQL (must not be null)
range - the range of rows to return
Returns:
a set of results based from the query
Throws:
ExchangeException - if a problem occurred while interacting with Exchange Server
ExchangeRuntimeException - if this object has been released and can no longer be used

getUserAlias


public java.lang.String getUserAlias()
Gets the user alias for the session. This is the value specified by PROP_EXCHANGE_MAILBOX, or the mailbox name resolved by setting PROP_AD_LOOKUP to "true".
Returns:
the user alias
See Also:
PROP_EXCHANGE_MAILBOX, PROP_AD_LOOKUP

toString


public java.lang.String toString()
Returns a string representation of this object.
Overrides:
toString in class java.lang.Object
Returns:
the string representation of this object

serverGetTask


public Task serverGetTask(UniqueID uniqueID,
                          java.util.List properties)
                   throws ExchangeException
Queries the server for the task with the specified unique ID.
Parameters:
uniqueID - the id of the task to search for
properties - list of AbstractProperty objects representing Exchange WebDAV properties to request from the Exchange store (must not be null)
Returns:
the task or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
java.lang.IllegalArgumentException - if properties are not specified
See Also:
Task.getDefaultProperties()

serverGetTask


public Task serverGetTask(UniqueID uniqueID)
                   throws ExchangeException
Queries the server for the task with the specified unique ID.
A list of selected properties Task.getDefaultProperties() are requested from the Exchange store. To specify a list of properties, use serverGetTask(UniqueID, List).
Parameters:
uniqueID - the id of the task to search for
Returns:
the task or null if not found
Throws:
ExchangeException - if a problem occurred while interacting with the Exchange store
ExchangeRuntimeException - if this object has been released and can no longer be used
See Also:
Task.getDefaultProperties()

serverGetFreeBusy


public FreeBusy[] serverGetFreeBusy(java.util.List listAttendees,
                                    java.util.Date startDate,
                                    java.util.Date endDate,
                                    int iInterval)
                             throws ExchangeException
Queries the server for free busy information for each of the specified attendees
Parameters:
listAttendees - a list of strings representing the email addresses of the attendees
startDate - the date to begin searching on
endDate - the date to stop searching on
iInterval - the time interval to return information for (in minutes)
Returns:
an array of FreeBusy information that is parallel to the users in listAttendees
Throws:
ExchangeException -  

getTimeZone


public java.util.TimeZone getTimeZone()
Get the timezone for the current session
Returns:
the timezone previously set for this session, or the host's default timezone

setTimeZone


public void setTimeZone(java.util.TimeZone timeZone)
Set the timezone for the current session
Parameters:
timeZone - the timezone to set the session to

isServerExchange


public boolean isServerExchange()
                         throws ExchangeException
Determine if the server supplied by the PROP_EXCHANGE_SERVER is a WebDAV Exchange 2000 or 2003 server. This method does require that the following properties are correctly set for connecting to a possible Exchange server: PROP_EXCHANGE_SERVER, PROP_EXCHANGE_PROTOCOL, PROP_EXCHANGE_PORT, PROP_AUTHENICATION_PROTOCOL. When connecting to servers that use NTLM authentication, PROP_USER_USERNAME, PROP_USER_PASSWORD and PROP_USER_DOMAIN must be specified.
Returns:
true if the server is running Exchange on the specified port and protocol false otherwise
Throws:
ExchangeException - if this method could not determine if the specified server is running Exchange or if there was a problem communicating with the server

Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.