com.openexchange.messaging
Interface MessagingAccountAccess

All Superinterfaces:
MessagingResource

public interface MessagingAccountAccess
extends MessagingResource

MessagingAccountAccess - Provides access to a messaging account.

Since:
Open-Xchange v6.16
Author:
Francisco Laguna, Thorben Betten

Method Summary
 int getAccountId()
          Gets the account identifier of this access.
 MessagingFolderAccess getFolderAccess()
          Gets the folder access for associated account.
 MessagingMessageAccess getMessageAccess()
          Gets the message access for associated account.
 MessagingFolder getRootFolder()
          Convenience method to obtain root folder in a fast way; meaning no default folder check is performed which is not necessary to return the root folder.
 
Methods inherited from interface com.openexchange.messaging.MessagingResource
cacheable, close, connect, isConnected, ping
 

Method Detail

getAccountId

int getAccountId()
Gets the account identifier of this access.

Returns:
The account identifier

getMessageAccess

MessagingMessageAccess getMessageAccess()
                                        throws MessagingException
Gets the message access for associated account.

Returns:
The message access
Throws:
MessagingException - If message access cannot be returned

getFolderAccess

MessagingFolderAccess getFolderAccess()
                                      throws MessagingException
Gets the folder access for associated account.

Returns:
The folder access
Throws:
MessagingException - If folder access cannot be returned

getRootFolder

MessagingFolder getRootFolder()
                              throws MessagingException
Convenience method to obtain root folder in a fast way; meaning no default folder check is performed which is not necessary to return the root folder.

The same result is yielded through calling getFolderAccess().getRootFolder() on a connected MessagingFolderAccess.

Since this account access instance is connected if not already done before, the MessagingResource.close() operation should be invoked afterwards:

 final MessagingMessageAccess access = MailAccess.getInstance(session);
 final MessagingFolder rootFolder = access.getRootFolder();
 try {
     // Do something with root folder
 } finally {
     access.close();
 }
 

Throws:
MessagingException - If returning the root folder fails